/* ============================================================
   shop.ca —— 移动优先风格，配色取自 amazon.ca
   深蓝导航 #131921 · 橙色强调 #ff9900 · 浅灰画布 #eaeded
   ============================================================ */

:root {
  /* 品牌 */
  --ink:            #0f1111;
  --ink-2:          #1d1d1f;
  --muted:          #565959;
  --muted-2:        #8b8e8e;
  --line:           #e3e6e6;
  --line-soft:      #eef1f1;
  --canvas:         #eaeded;
  --surface:        #ffffff;
  --surface-2:      #f7f8f8;
  --surface-3:      #f0f2f2;

  /* 导航（Amazon 深蓝） */
  --nav:            #131921;
  --nav-2:          #1b2530;
  --nav-3:          #232f3e;

  /* 强调 */
  --orange:         #ff9900;
  --orange-hi:      #e88b00;
  --orange-soft:    #fff3e0;
  --yellow:         #ffd814;
  --yellow-hi:      #f7ca00;
  --link:           #007185;
  --link-hi:        #c7511f;
  --deal:           #cc0c39;
  --price-red:      #b12704;
  --star:           #ffa41c;
  --success:        #067d62;
  --success-bg:     #eaf7f2;
  --danger:         #b12704;
  --danger-bg:      #fdf0ee;
  --warn:           #c45500;

  /* 形状 */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(15,17,17,.06);
  --sh-2: 0 2px 8px rgba(15,17,17,.08);
  --sh-3: 0 8px 24px rgba(15,17,17,.12);
  --sh-focus: 0 0 0 3px rgba(255,153,0,.35);

  /* 排版 */
  --font: "Amazon Ember", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 750px;          /* 移动优先，桌面居中收窄 */
  --pad: 12px;
  --tabbar-h: 62px;
  --header-h: 108px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hi); }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }

/* ---------------- 顶栏 ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav);
  padding-bottom: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.app-header__bar {
  max-width: var(--max);
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
}

.app-header__logo svg { width: 86px; height: 24px; }
.logo-text { font: 700 22px/1 var(--font); fill: #fff; letter-spacing: -.03em; }
.logo-smile { fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-linecap: round; }
.logo-arrow { fill: var(--orange); }

.app-header__actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn svg { width: 20px; height: 20px; fill: #fff; }

.icon-btn__flag {
  font-size: 10px;
  font-weight: 700;
  background: #1f6b3a;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
}
.icon-btn__code { font-size: 12px; font-weight: 700; }

/* 搜索栏 */
.app-header__search {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
}

.search-box {
  display: flex;
  height: 42px;
  background: #fff;
  border-radius: var(--r-pill);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.search-box:focus-within { box-shadow: 0 0 0 2px var(--orange); }

.search-box__select {
  border: 0;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 13px;
  padding: 0 22px 0 14px;
  max-width: 92px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 12px) 19px, calc(100% - 7px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border-right: 1px solid var(--line);
}

.search-box__input {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  padding: 0 12px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  min-width: 0;
  background: transparent;
}
.search-box__input::placeholder { color: var(--muted-2); }

.search-box__btn {
  width: 48px;
  border: 0;
  background: var(--orange);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  transition: background .15s;
}
.search-box__btn:active { background: var(--orange-hi); }
.search-box__btn svg { width: 19px; height: 19px; fill: #131921; }

/* ---------------- 内容区 ---------------- */
.app-root {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px var(--pad) 20px;
  min-height: calc(100vh - var(--header-h) - var(--tabbar-h));
}

.page { padding-bottom: 8px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 12px;
}
.page-title { font-size: 21px; font-weight: 700; line-height: 1.25; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); padding: 2px 0 8px; }
.crumbs a { color: var(--muted); }
.crumbs span::before { content: "›"; margin-right: 6px; color: #b0b0b0; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.card__title { font-size: 16px; font-weight: 700; }
.card__body { padding: 0 16px 16px; }

.panel {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.panel + .panel { margin-top: 12px; }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel__head h2 { font-size: 16px; font-weight: 700; }
.panel__body { padding: 16px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s, background .15s, box-shadow .15s;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary {
  background: linear-gradient(180deg, #ffb84d, var(--orange));
  color: #131921;
  box-shadow: 0 2px 6px rgba(255,153,0,.3);
}
.btn--primary:hover:not(:disabled) { background: var(--orange-hi); }

.btn--secondary {
  background: var(--yellow);
  border-color: #f2ca00;
  color: #131921;
}
.btn--secondary:hover:not(:disabled) { background: var(--yellow-hi); }

.btn--buy {
  background: linear-gradient(180deg, #ffb84d, var(--orange));
  color: #131921;
  width: 100%;
  border-radius: var(--r-pill);
  font-weight: 700;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover:not(:disabled) { background: var(--surface-3); }

.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--link);
  padding: 6px 8px;
  font-weight: 500;
}

.btn--danger { background: var(--surface); border-color: #f0c8c4; color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); }

.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn--lg { padding: 13px 22px; font-size: 16px; border-radius: var(--r-pill); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label, .field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field__hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d5d9d9;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.4;
  font-size: 15px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--orange);
  box-shadow: var(--sh-focus);
}
.input::placeholder { color: #a8abab; }
.input[aria-invalid="true"] { border-color: var(--danger); }

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.textarea { min-height: 92px; resize: vertical; }

.field__error { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.field__error.show { display: block; }

.captcha-row { display: flex; gap: 8px; align-items: flex-start; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 108px; height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--surface-2);
  flex: none;
  object-fit: cover;
}

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--ok    { background: var(--success-bg); color: var(--success); }
.badge--warn  { background: #fdf5e6; color: var(--warn); }
.badge--danger{ background: var(--danger-bg); color: var(--danger); }
.badge--info  { background: #eef4fb; color: #0f5b96; }
.badge--muted { background: var(--surface-3); color: var(--muted); }
.badge--deal  { background: var(--deal); color: #fff; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

/* ---------------- 评分 ---------------- */
.stars { display: inline-flex; align-items: center; gap: 1px; }
.stars svg { width: 13px; height: 13px; }
.stars__fill { fill: var(--star); }
.stars__empty { fill: #d9dcdc; }

/* ---------------- 价格 ---------------- */
.price { display: inline-flex; align-items: flex-start; color: var(--ink); font-weight: 400; line-height: 1; }
.price__sym { font-size: 12px; margin-top: 3px; margin-right: 2px; }
.price__int { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.price__dec { font-size: 12px; margin-top: 3px; font-weight: 700; }
.price--sm .price__int { font-size: 17px; }
.price--sm .price__sym, .price--sm .price__dec { font-size: 10px; margin-top: 2px; }
.price--lg .price__int { font-size: 30px; }
.price__was { color: var(--muted-2); font-size: 12px; text-decoration: line-through; margin-left: 6px; }
.price__off { color: var(--deal); font-size: 12px; font-weight: 700; margin-left: 6px; }

/* ---------------- 骨架 ---------------- */
@keyframes sk { 0% { background-position: -300px 0 } 100% { background-position: 300px 0 } }
.sk {
  background: #e6e9ec;
  background-image: linear-gradient(90deg, #e6e9ec 0px, #f2f4f6 40px, #e6e9ec 80px);
  background-size: 600px 100%;
  animation: sk 1.2s infinite linear;
  border-radius: var(--r-sm);
}
.boot-skeleton { max-width: var(--max); margin: 0 auto; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------- 底部 Tab ---------------- */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%); width: 100%; bottom: 0;
  z-index: 60;
  display: flex;
  background: rgba(255,255,255,.98);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-width: var(--max);
  margin: 0 auto;
}

.tabbar__item {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tabbar-h);
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  transition: color .15s;
}
.tabbar__item svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.tabbar__item:active { opacity: .7; }
.tabbar__item[aria-current="page"] { color: var(--orange); }

.tabbar__item--center { position: relative; }
.tabbar__fab {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffb84d, var(--orange));
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(255,153,0,.4);
  border: 3px solid #fff;
}
.tabbar__fab svg { width: 24px; height: 24px; fill: #131921; }
.tabbar__item--center > span:last-child { margin-top: 34px; }

/* ---------------- 页脚 ---------------- */
.app-footer {
  max-width: var(--max);
  margin: 24px auto 0;
  padding: 20px var(--pad) 28px;
  background: var(--nav-3);
  color: #c8d2de;
  font-size: 12px;
}
.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-footer__links a { color: #c8d2de; }
.app-footer__links a:hover { color: #fff; }

.app-footer__company {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #9aa4ae;
  line-height: 1.6;
}
.app-footer__company b { color: #fff; }
.app-footer__company a { color: #9aa4ae; }

.app-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 12px;
  color: #7f8b96;
}

/* ---------------- Toast ---------------- */
.toast-stack {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: var(--max);
  margin: 0 auto;
}
.toast {
  pointer-events: auto;
  background: rgba(19,25,33,.96);
  color: #fff;
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  box-shadow: var(--sh-3);
  animation: toastIn .2s ease-out;
}
.toast--error { background: #8c1d18; }
.toast--warn  { background: #8a5a00; }
.toast--info  { background: #1a3a5c; }
.toast__icon {
  flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.2);
  margin-top: 1px;
}
.toast__text { flex: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

/* ---------------- 抽屉 ---------------- */
.drawer { position: fixed; inset: 0; z-index: 400; }
.drawer[hidden] { display: none; }
.drawer__mask { position: absolute; inset: 0; background: rgba(15,17,17,.55); animation: fade .16s; }
.drawer__panel {
  position: absolute; inset: 0 auto 0 0;
  width: min(320px, 84vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-3);
  animation: slideIn .2s ease-out;
}
.drawer__head {
  background: var(--nav);
  color: #fff;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
}
.drawer__close { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.drawer__nav { overflow-y: auto; padding: 6px 0 24px; }
.drawer__group { padding: 14px 18px 6px; font-size: 13px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; }
.drawer__nav a { display: block; padding: 11px 18px; color: var(--ink-2); font-size: 15px; }
.drawer__nav a:active { background: var(--surface-3); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideIn { from { transform: translateX(-100%) } to { transform: none } }

/* ---------------- 语言菜单 ---------------- */
.lang-menu {
  position: absolute;
  top: 50px;
  right: var(--pad);
  min-width: 220px;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  padding: 6px;
  z-index: 200;
  animation: toastIn .15s ease-out;
}
.lang-menu[hidden] { display: none; }
.lang-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.lang-menu__item:active { background: var(--surface-3); }
.lang-menu__item.is-active { background: var(--orange-soft); }
.lang-menu__item.is-active .lang-menu__name { font-weight: 700; }
.lang-menu__name { flex: 1; }
.lang-menu__sub { color: var(--muted-2); font-size: 12px; }
.lang-menu__check { color: var(--orange-hi); font-weight: 700; }
.lang-menu__sep { height: 1px; background: var(--line-soft); margin: 5px 10px; }

/* ---------------- 工具 ---------------- */
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--muted); }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.row { display: flex; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto 12px; opacity: .3; }
.empty__title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ---------------- 桌面适配 ---------------- */
@media (min-width: 751px) {
  body { background: #eef1f1; }
  .app-header { border-radius: 0; }
  .app-root { padding-top: 16px; }
  .tabbar {
    border-radius: 0 0 var(--r) var(--r);
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
}
