:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #617184;
  --paper: #f3f6f7;
  --card: #ffffff;
  --line: #d9e1e7;
  --navy: #0c2033;
  --blue: #1268a8;
  --orange: #f26b2b;
  --orange-dark: #d95116;
  --green: #15805f;
  --red: #b4433c;
  --shadow: 0 14px 40px rgba(12, 32, 51, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% -10%, rgba(242, 107, 43, .12), transparent 31rem),
    var(--paper);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 48px; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 20px 12px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
}
h1 { margin: 0; font-size: clamp(22px, 5.5vw, 31px); line-height: 1.12; letter-spacing: -.025em; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: #21a67a; box-shadow: 0 0 0 6px rgba(33,166,122,.13); }

main { max-width: 760px; margin: 0 auto; padding: 8px 16px 130px; }
.card, .loading-card {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(217,225,231,.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 20px; }
.loading-card { padding: 30px 20px; text-align: center; color: var(--muted); }

.event-strip { display: grid; gap: 3px; padding: 15px 17px; margin-bottom: 14px; background: var(--navy); color: #fff; border-radius: 18px; }
.event-strip strong { font-size: 17px; }
.event-strip span { color: #bcd0df; font-size: 13px; }

.section-label { margin: 22px 0 10px; font-size: 14px; font-weight: 800; }
.field-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.search-wrap { position: relative; }
.search-wrap input, .store-select {
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 15px;
  background: #f9fbfc; color: var(--ink); font-size: 16px; outline: none;
}
.store-select { appearance: auto; }
.search-wrap input:focus, .store-select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(18,104,168,.12); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 720;
}
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.quick-products { margin-top: 10px; }
.section-label.first { margin-top: 0; }
.browse-controls { margin-bottom: 14px; }
.city-chips { max-height: 150px; overflow: auto; padding-bottom: 2px; }
.results-overview { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 4px 8px; }
.results-overview strong { font-size: 18px; }
.results-overview span { color: var(--muted); font-size: 13px; }
.city-heading { margin: 24px 4px 10px; color: var(--navy); font-size: 20px; letter-spacing: -.02em; }
.store-card { margin-bottom: 12px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px rgba(12,32,51,.07); }
.store-card-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.store-card-header h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.store-card-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.store-tools { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.favorite-btn { width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #a2acb5; font-size: 23px; line-height: 1; }
.favorite-btn[aria-pressed="true"] { color: #e7a400; background: #fff8dc; border-color: #f0d57d; }
.item-count { flex: 0 0 auto; padding: 5px 9px; background: #e8f2f8; border-radius: 999px; color: var(--blue); font-size: 12px; font-weight: 850; }
.product-list { margin: 14px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.product-list li { position: relative; padding: 10px 4px 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.product-list li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.more-products summary, .pick-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 800; }
.more-products .product-list { margin-top: 0; }
.store-start { min-height: 56px; margin-top: 6px; }
.pick-details { margin-top: 6px; }
.pick-list { display: grid; gap: 7px; padding: 4px 0 8px; }
.pick-row { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 8px; min-height: 44px; padding: 9px 10px; background: #f6f8fa; border-radius: 11px; font-size: 13px; line-height: 1.4; }
.pick-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--orange); }
.pick-start { margin-top: 4px; }
.empty-state { padding: 28px 18px; background: #fff; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }

.count-box { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 0 14px; padding: 16px; border-radius: 16px; background: #eef3f6; }
.count-box strong { display: block; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.count-box span { color: var(--muted); font-size: 13px; }

.primary, .secondary, .danger-ghost {
  width: 100%; border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 850; cursor: pointer;
}
.primary { min-height: 58px; background: var(--orange); color: #fff; box-shadow: 0 8px 18px rgba(242,107,43,.22); font-size: 17px; }
.primary:active { background: var(--orange-dark); transform: translateY(1px); }
.primary:disabled { opacity: .45; box-shadow: none; }
.secondary { background: #eaf0f4; color: var(--navy); }
.danger-ghost { background: transparent; color: var(--red); border: 1px solid #ecd1ce; }
.helper { margin: 11px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.progress-card { padding: 18px; margin-bottom: 14px; }
.progress-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.progress-row strong { font-size: 18px; }
.progress-row span { color: var(--muted); font-size: 13px; }
.progress-track { height: 9px; margin-top: 11px; overflow: hidden; background: #e7edf1; border-radius: 99px; }
.progress-fill { height: 100%; background: var(--orange); border-radius: inherit; transition: width .25s ease; }

.current-card { position: relative; overflow: hidden; padding: 0; }
.current-card::before { content: ""; display: block; height: 7px; background: var(--orange); }
.current-inner { padding: 22px; }
.step-tag { display: inline-flex; margin-bottom: 14px; padding: 6px 10px; color: var(--blue); background: #e8f2f8; border-radius: 999px; font-size: 12px; font-weight: 850; }
.store { margin: 0; color: var(--muted); font-size: 15px; font-weight: 720; }
.product { margin: 6px 0 10px; font-size: clamp(23px, 6.2vw, 34px); line-height: 1.18; letter-spacing: -.025em; }
.period { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.return-tip { margin: 18px 0; padding: 13px 15px; background: #fff3e9; border-radius: 14px; color: #82380f; font-size: 13px; font-weight: 730; line-height: 1.5; }
.actions { display: grid; gap: 10px; }
.actions .primary { min-height: 66px; font-size: 19px; }
.action-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.action-pair button { font-size: 13px; }

.summary { text-align: center; padding: 28px 22px; }
.summary-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #dff3eb; color: var(--green); font-size: 30px; font-weight: 900; }
.summary h2 { margin: 0 0 8px; }
.summary p { margin: 0 0 20px; color: var(--muted); }

.queue-details { margin-top: 14px; }
.queue-details summary { padding: 15px 4px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 750; }
.queue-list { display: grid; gap: 8px; max-height: 44svh; overflow: auto; padding: 2px 0 10px; }
.queue-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.queue-status { font-weight: 900; }
.queue-status.done { color: var(--green); }
.queue-status.skipped { color: var(--muted); }
.queue-status.opened { color: var(--orange-dark); }
.queue-item strong { display: block; font-size: 13px; }
.queue-item small { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20; transform: translate(-50%, 20px); width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 999px; background: var(--navy); color: #fff; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 13px; font-weight: 750; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { max-width: 760px; margin: 0 auto; padding: 0 20px calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 11px; line-height: 1.5; }
footer p { margin: 3px 0; }
footer a { color: var(--blue); }
.credit { margin-top: 10px; color: var(--navy); font-weight: 750; letter-spacing: .03em; }

@media (min-width: 700px) {
  main { padding-inline: 20px; }
  .card { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
