/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
  --ink: #141c2b;
  --ink-soft: #26313f;
  --muted: #5c687a;
  --line: #e3e8f0;
  --paper: #ffffff;
  --bg: #f4f6f9;
  --brand: #176b5b;
  --brand-strong: #0e5346;
  --brand-soft: #e6f2ed;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
  --shadow-sm: 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --tap: 44px;
  --container: 1160px;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ==========================================================================
   2. 基础
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--brand-soft);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.topbar :focus-visible {
  outline-color: #ffffff;
}

/* 按钮与触控目标：全站统一最小 44px 高 */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.16s var(--ease), transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

.button:hover,
button:hover {
  background: var(--ink-soft);
}

.button:active,
button:active {
  transform: translateY(1px);
}

button.primary,
.button.primary {
  background: var(--brand);
  box-shadow: 0 6px 16px rgba(23, 107, 91, 0.18);
}

button.primary:hover,
.button.primary:hover {
  background: var(--brand-strong);
}

button.ghost,
.button.ghost {
  background: #eef1f6;
  color: var(--ink);
}

button.ghost:hover,
.button.ghost:hover {
  background: #e4e9f1;
}

button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   3. 布局
   ========================================================================== */
.shell {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 24px);
}

/* 顶栏：桌面吸顶，手机端取消吸顶以免占用可视高度 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 28, 43, 0.94);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  backdrop-filter: saturate(1.3) blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 70px;
  padding-block: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  padding-block: 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.navlinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px clamp(10px, 1.4vw, 22px);
  min-width: 0;
  font-size: 15px;
}

.navlinks a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 2px 6px;
  opacity: 0.86;
  transition: opacity 0.16s var(--ease);
}

.navlinks a:hover {
  opacity: 1;
}

.navlinks a.active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.cart-link {
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  opacity: 1 !important;
}

.language-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  font-size: 13px;
  opacity: 0.92;
}

.language-wrap select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  max-width: 150px;
  padding: 6px 30px 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23141c2b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 9px 6px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ==========================================================================
   4. 首页与区块
   ========================================================================== */
.hero {
  padding-block: clamp(40px, 7vw, 88px) clamp(36px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(1100px 460px at 16% -12%, #e6f2ec, transparent 65%),
    radial-gradient(900px 420px at 92% 6%, #f6ece0, transparent 62%), var(--bg);
}

.hero h1 {
  max-width: 20ch;
  margin: 0 0 clamp(12px, 1.6vw, 18px);
  font-size: clamp(30px, 5.2vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero p {
  max-width: 56ch;
  margin: 0 0 clamp(18px, 2.4vw, 26px);
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 18px);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: clamp(20px, 2.6vw, 28px) 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 14px;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-points li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.section {
  padding-block: clamp(32px, 5vw, 64px);
}

#products {
  scroll-margin-top: 96px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}

.section h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

/* 商品栅格：自适应列数，超宽屏自然排到 3–4 列 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(14px, 2vw, 24px);
}

#product-grid:empty::after {
  content: "Loading products…";
  grid-column: 1 / -1;
  padding: 36px 8px;
  color: var(--muted);
  text-align: center;
}

/* ==========================================================================
   5. 商品卡
   ========================================================================== */
.product-card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-4px);
    border-color: #d6dee9;
    box-shadow: var(--shadow);
  }
}

.product-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(52px, 8vw, 72px);
  line-height: 1;
  text-shadow: 0 10px 22px rgba(20, 28, 43, 0.14);
  background: linear-gradient(150deg, #e4f1ea, #dbe9e1 55%, #f4e9dc);
  isolation: isolate;
}

.product-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 34%,
    rgba(255, 255, 255, 0.78),
    rgba(255, 255, 255, 0.3) 56%,
    rgba(255, 255, 255, 0) 72%
  );
  filter: blur(1px);
}

.product-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 118%, rgba(255, 255, 255, 0.65), transparent 58%);
  pointer-events: none;
}

.product-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 无商品图时的品牌字母占位，避免留下一个空渐变块 */
.product-monogram,
.card-monogram {
  display: grid;
  place-items: center;
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  color: var(--brand-strong);
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(23, 107, 91, 0.14);
}

.card-monogram {
  font-size: clamp(30px, 4vw, 44px);
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
}

.stock-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.stock-pill.out {
  background: #fdecea;
  color: var(--danger);
}

.stock-pill.out::before {
  background: var(--danger);
}

.stock-note {
  margin: 10px 0 0;
  max-width: 42ch;
}

.buy-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 16px 0 4px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.buy-points li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.buy-points li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 详情页底部推荐：填充桌面留白并提供站内交叉入口 */
.related {
  margin: clamp(28px, 5vw, 56px) 0 8px;
  padding-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line);
}

.related .section-head {
  margin-bottom: 16px;
}

.related .product-card .price {
  margin-top: 4px;
}

/* 加购等轻量反馈：不打断操作，也不遮挡内容 */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 70;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(20, 28, 43, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: toast-in 0.18s var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Cookie 说明改为文档内联条：首次访问不再盖住商品卡和加购按钮 */
.cookie-notice {
  border-bottom: 1px solid #efe0bb;
  background: #fff8e8;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.cookie-notice .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 10px;
}

.cookie-notice a {
  color: var(--brand-strong);
  text-decoration: underline;
}

.cookie-notice button {
  min-height: var(--tap);
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--brand);
  font-size: 13px;
}

/* 三组交替底色，商品变多后不会串色 */
.product-card:nth-child(3n + 1) .product-art {
  background: linear-gradient(150deg, #e4f1ea, #dbe9e1 55%, #f4e9dc);
}

.product-card:nth-child(3n + 2) .product-art {
  background: linear-gradient(150deg, #e9e9f6, #e3e2f2 55%, #f6e6da);
}

.product-card:nth-child(3n + 3) .product-art {
  background: linear-gradient(150deg, #f1efe3, #e9eee1 55%, #efdfd8);
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: clamp(14px, 1.8vw, 22px);
}

.product-body h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.price {
  color: var(--brand);
  font-size: clamp(19px, 1.7vw, 23px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.product-body p {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.product-card .actions .button,
.product-card .actions button {
  flex: 1 1 130px;
}

/* ==========================================================================
   6. 商品详情
   ========================================================================== */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(24px, 4vw, 56px);
}

.detail .product-art {
  aspect-ratio: 1 / 1;
  max-height: min(70vh, 520px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: clamp(64px, 10vw, 124px);
}

.detail h1 {
  margin: 6px 0 10px;
  font-size: clamp(26px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.detail-copy p {
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(15px, 1.25vw, 17px);
}

.detail .actions .button,
.detail .actions button {
  flex: 1 1 150px;
  min-height: var(--tap);
}

/* 商品不存在时：隐藏空白图片区，正文占满整行 */
.detail.is-missing {
  grid-template-columns: minmax(0, 1fr);
}

.detail.is-missing .product-art {
  display: none;
}

.detail.is-missing .detail-copy p {
  max-width: 46ch;
}

.feature-list {
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.feature-list li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 800;
}

.back-row {
  margin: 16px 0 0;
}

.qty-input {
  width: 76px;
  min-height: var(--tap);
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  text-align: center;
}

/* ==========================================================================
   7. 表单与账户
   ========================================================================== */
.form-wrap {
  width: 100%;
  max-width: 640px;
  margin: clamp(28px, 5vw, 56px) auto;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel h2 {
  margin: 24px 0 10px;
  font-size: clamp(19px, 2.2vw, 24px);
}

.panel h3 {
  margin: 18px 0 6px;
  font-size: 17px;
}

.field {
  margin: 0 0 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

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

/* 地址表单：两列布局 + 受控下拉提示 */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.field select:disabled {
  background-color: #f1f4f3;
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 620px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.field input[type="checkbox"],
.field input[type="radio"],
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  accent-color: var(--brand);
}

/* 复选框所在 label 整块可点，扩大触控区域 */
label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  cursor: pointer;
}

a[href^="mailto:"] {
  display: inline-block;
  padding: 11px 2px;
}

.section-head a.muted,
.back-row a,
#cart-lines a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 2px 4px;
}

.msg {
  display: none;
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  white-space: pre-wrap;
}

.msg.show {
  display: block;
}

.msg.ok {
  background: #e9f7ed;
  color: #14603a;
  border-left-color: #2f9e63;
}

.msg.err {
  background: #fdecea;
  color: var(--danger);
  border-left-color: var(--danger);
}

.msg.info {
  background: #ebf2fe;
  color: #1d4ed8;
  border-left-color: #3b82f6;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  flex: 0 0 auto;
}

.tabs button.active {
  background: var(--brand);
}

/* ==========================================================================
   8. 购物车、订单与状态
   ========================================================================== */
.cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-row > :first-child {
  min-width: 0;
}

.cart-row > :first-child strong {
  font-size: 16px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty button {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border-radius: 10px;
  background: #eef1f6;
  color: var(--ink);
  font-size: 18px;
}

.qty button:hover {
  background: #e4e9f1;
}

.qty span {
  min-width: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}

.cart-row .remove {
  min-height: var(--tap);
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.cart-row .remove:hover {
  background: #eef1f6;
  color: var(--ink);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1f6;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.pending {
  background: #fff3cd;
  color: #8a5a00;
}

.tag.paid {
  background: #def7e7;
  color: #176b3a;
}

.tag.shipped {
  background: #deebff;
  color: #1856a5;
}

.tag.completed {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tag.cancelled,
.tag.refunded {
  background: #ffe5e2;
  color: #a12a20;
}

.tag.cancel_requested,
.tag.refund_requested {
  background: #fff1e0;
  color: #8a4a00;
}

.order {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.order:last-child {
  border-bottom: 0;
}

.order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-head strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.order-snapshot {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
}

.order-snapshot > div + div {
  margin-top: 4px;
}

/* 结算页地址与运费选择（store.js 运行时注入） */
#checkout-fields {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

#checkout-fields > p {
  margin: 0 0 6px;
}

#selected-address {
  margin-bottom: 4px;
}

.shipping-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.shipping-option:hover {
  border-color: #cbd6e3;
  background: #fbfcfe;
}

.shipping-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.shipping-option input {
  margin: 0 6px 0 0;
}

.shipping-option small {
  font-size: 13px;
}

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--line);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.panel > button.primary {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
}

/* ==========================================================================
   9. 页脚与法务长文
   ========================================================================== */
.footer {
  margin-top: clamp(8px, 2vw, 24px);
  padding-block: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.footer p {
  margin: 4px 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 4px;
}

.footer a {
  display: inline-block;
  padding: 11px 8px;
  color: var(--ink-soft);
  opacity: 0.85;
  border-radius: 8px;
}

.footer a:hover {
  opacity: 1;
  color: var(--brand);
  background: var(--brand-soft);
}

/* 法务页限宽，避免一行 130+ 字符 */
.legal {
  max-width: 820px;
  margin-inline: auto;
}

.prose {
  padding: clamp(18px, 3vw, 34px);
}

.prose h2 {
  margin-top: 28px;
}

.prose p,
.prose li {
  font-size: 16px;
  line-height: 1.7;
}

.prose > h2:first-child {
  margin-top: 0;
}

/* ==========================================================================
   10. 响应式
   ========================================================================== */
@media (max-width: 1080px) {
  /* 平板/窄桌面：隐藏语言货币的文字标签，只留可识别的缩写 */
  .language-wrap span {
    display: none;
  }

  .detail {
    gap: 32px;
  }

  .detail .product-art {
    max-height: 440px;
  }
}

@media (max-width: 900px) {
  /* 平板：压缩导航间距，保持单行，给内容让位 */
  .logo {
    font-size: 18px;
    letter-spacing: 0.11em;
  }

  .navlinks {
    gap: 4px 10px;
    font-size: 14px;
  }

  .navlinks a {
    min-height: 44px;
  }

  .qty button {
    width: var(--tap);
    min-width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
  }

  .cart-row .remove,
  .section-head a.muted,
  .back-row a {
    min-height: var(--tap);
  }

  .hero {
    padding-block: clamp(32px, 7vw, 56px);
  }
}

@media (max-width: 760px) {
  .detail {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .detail .product-art {
    aspect-ratio: 16 / 10;
    max-height: none;
    font-size: clamp(56px, 12vw, 96px);
  }

  /* 手机端不吸顶，避免顶栏占掉可视高度 */
  .topbar {
    position: static;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: 6px;
    padding-block: 10px;
  }

  .navlinks {
    gap: 2px 14px;
    font-size: 14px;
  }

  .navlinks a {
    min-height: var(--tap);
    padding: 8px 2px;
  }

  .language-wrap span {
    display: none;
  }

  .language-wrap select {
    min-height: var(--tap);
    max-width: 118px;
    font-size: 14px;
  }

  .footer a {
    padding: 11px 8px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .product-card .actions .button,
  .product-card .actions button {
    flex: 1 1 100%;
  }

  .qty button {
    width: var(--tap);
    min-width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
  }

  .cart-row .remove,
  .section-head a.muted,
  .back-row a {
    min-height: var(--tap);
  }

  .footer p + p {
    margin-top: 8px;
  }
}

@media (max-width: 620px) {
  /* 购物车行：名称独占一行，数量 / 金额 / 删除排第二行 */
  .cart-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "name name name"
      "qty price remove";
    gap: 10px 12px;
    padding: 14px 0;
  }

  .cart-row > :first-child {
    grid-area: name;
  }

  .cart-row .qty {
    grid-area: qty;
  }

  .cart-row .line-price {
    grid-area: price;
    justify-self: end;
  }

  .cart-row .remove {
    grid-area: remove;
    justify-self: end;
  }
}

@media (max-width: 420px) {
  /* 极窄屏：去掉自定义箭头，给导航腾出宽度，保持单行 */
  .language-wrap select {
    padding: 6px 10px;
    background-image: none;
  }

  .logo {
    font-size: 17px;
    letter-spacing: 0.1em;
  }

  .navlinks {
    gap: 0 10px;
    font-size: 13.5px;
  }

  .hero h1 {
    font-size: clamp(27px, 8vw, 34px);
  }

  .product-art {
    font-size: 52px;
  }

  .detail .product-art {
    font-size: 64px;
  }
}

/* 尊重系统的减少动效设置 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 刘海屏 / 底部手势区安全距离 */
.cookie-notice .shell {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ---------------- Buyer messages ---------------- */
.message-thread{display:flex;flex-direction:column;gap:12px;margin:16px 0;padding:4px;max-height:56vh;overflow-y:auto;overscroll-behavior:contain}
.message-bubble{max-width:min(82%,560px);padding:10px 13px;border-radius:14px;background:#eef1f6;color:var(--ink,#141c2b);overflow-wrap:anywhere}
.message-bubble.mine{align-self:flex-end;background:var(--brand,#176b5b);color:#fff}
.message-bubble .message-meta{font-size:12px;opacity:.72;margin-bottom:4px}
.message-bubble .message-text{white-space:pre-wrap;font-size:14.5px;line-height:1.5}
.message-empty{margin:18px 0;color:var(--muted,#5c687a)}
.message-compose-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px}
.admin-thread-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:8px}
.admin-thread-head h3{margin:0;font-size:16px}
.unread-pill{display:inline-block;min-width:22px;padding:1px 7px;border-radius:999px;background:#fdecea;color:#991b1b;text-align:center}
.message-attach-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
.message-attach-row .button,.message-attach-row button{min-height:44px}
.message-image-preview{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
.message-image-item{position:relative;width:88px;height:88px;border:1px solid var(--line,#e3e8f0);border-radius:10px;overflow:hidden;background:#f4f6f9}
.message-image-item img{display:block;width:100%;height:100%;object-fit:cover}
.message-image-remove{position:absolute;top:4px;right:4px;width:26px;height:26px;min-height:26px;padding:0;border:0;border-radius:50%;background:rgba(20,28,43,.82);color:#fff;font-size:16px;line-height:26px;cursor:pointer}
.message-images{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.message-images a{display:block;width:160px;height:160px;max-width:100%;border-radius:10px;overflow:hidden;border:1px solid rgba(20,28,43,.12)}
.message-images img{display:block;width:100%;height:100%;object-fit:cover}
.message-bubble.mine .message-images a{border-color:rgba(255,255,255,.28)}
.admin-message-attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.order-note{margin:14px 0;padding:12px 14px;border:1px solid var(--line,#e3e8f0);border-radius:10px;background:#f8fafc;white-space:pre-wrap;word-break:break-word}
.order-note strong{display:block;margin-bottom:6px;font-size:13px;color:#475569;text-transform:uppercase;letter-spacing:.08em}
.order-tracking{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:14px 0;padding:12px 14px;border:1px solid var(--line,#e3e8f0);border-radius:10px;background:#f8fafc}
.order-tracking-info{min-width:0}
.order-tracking-info strong{display:block;margin-bottom:6px;font-size:13px;color:#475569;text-transform:uppercase;letter-spacing:.08em}
.order-tracking .tracking-number{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:16px;font-weight:700;letter-spacing:.02em;word-break:break-all;color:#0f172a}
.order-tracking .button{flex:0 0 auto;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:620px){.order-tracking{align-items:flex-start}.order-tracking .button{width:100%;text-align:center}}
.order-address-list{display:grid;gap:10px;margin:12px 0}
.address-choice{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line,#e3e8f0);border-radius:10px;background:#fff;cursor:pointer}
.address-choice:hover{border-color:#94a3b8}
.address-choice input{width:18px;height:18px;margin-top:4px;flex:0 0 auto}
.address-choice span{font-size:14px;line-height:1.5}
.address-choice input:checked{border-color:var(--accent,#0f766e)}
@media(max-width:620px){.message-bubble{max-width:92%}.message-thread{max-height:50vh}.message-images a{width:132px;height:132px}.address-choice{padding:10px 12px}}

/* -------------------------------------------------------------------------
   2026-11 可信度整改样式：店铺状态提示、支付提示、订单金额、移动端导航
   ----------------------------------------------------------------------- */
.store-notice {
  background: #fff6e8;
  color: #5b3b00;
  border-bottom: 1px solid #f0d9b5;
  font-size: 13px;
  line-height: 1.5;
}

.store-notice.demo {
  background: #eef4ff;
  color: #1e3a8a;
  border-bottom-color: #d7e3ff;
}

.store-notice .shell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-block: 9px;
}

.payment-notice {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f7fb;
  border: 1px solid #e3e8f2;
  font-size: 14px;
  line-height: 1.55;
}

.payment-notice.demo {
  background: #fff8e8;
  border-color: #f2dfb8;
  color: #6b4a00;
}

.payment-notice.warn {
  background: #fff4f2;
  border-color: #f3d2ca;
  color: #8a2d1c;
}

.payment-notice button {
  margin-left: 8px;
  vertical-align: middle;
}

.order-summary {
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
  background: #fbfcfe;
}

.order-summary h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 14px;
}

.summary-row.total {
  border-top: 1px solid #e5e8ef;
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 16px;
}

.order-note-block {
  padding: 14px 16px;
  background: #f7f8fa;
  border-left: 3px solid #c9d2e3;
  border-radius: 8px;
  margin: 16px 0;
}

.order-note-block p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.tracking-number-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.order-tracking-line {
  margin: 2px 0 8px;
}

.footer-meta {
  font-size: 13px;
  opacity: 0.82;
  margin-top: 8px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

@media (max-width: 620px) {
  .nav {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 10px;
    padding-block: 10px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .navlinks {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 16px 16px;
    background: #141c2b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    max-height: calc(100vh - 70px);
    overflow: auto;
  }

  .navlinks.open {
    display: flex;
  }

  .navlinks a {
    min-height: 44px;
    padding: 10px 4px;
    justify-content: flex-start;
  }

  .navlinks .cart-link {
    margin-top: 4px;
    justify-content: center;
  }

  .language-wrap {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }

  .language-wrap span {
    display: inline;
  }

  .language-wrap select {
    max-width: none;
    flex: 1;
    margin-left: 8px;
  }

  .store-notice {
    font-size: 12px;
  }

  .order-summary {
    padding: 12px;
  }

  .tracking-inline {
    display: block;
    margin-top: 4px;
  }
}

.legal .feature-list li::before {
  content: none;
}

.legal .feature-list li {
  padding-left: 0;
}

.policy-lang-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f5f7fb;
  border: 1px solid #e3e8f2;
  font-size: 14px;
  line-height: 1.6;
}
.store-legal-pending {
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 3px solid #c9d2e3;
  background: #f7f8fa;
  color: #4a5568;
  font-size: 14px;
  line-height: 1.6;
}
/* -------------------------------------------------------------------------
   留言中心增强：新回复提示、订单/主题上下文、常见问题快捷入口、导航角标
   ----------------------------------------------------------------------- */
.message-service-note{margin-top:6px;font-size:13.5px;line-height:1.5}
.message-new{display:flex;justify-content:center;padding:6px 0;position:sticky;top:0;z-index:2;background:var(--panel,#fff)}
.message-new[hidden]{display:none}
.message-new button{min-height:44px;padding:8px 16px;border:1px solid var(--brand,#176b5b);border-radius:999px;background:var(--brand,#176b5b);color:#fff;font-size:14px;cursor:pointer}
.message-context-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.message-quick{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.message-quick span{font-size:13px}
.message-quick button{min-height:44px;padding:8px 14px;border:1px solid var(--line,#e3e8f0);border-radius:999px;background:#f4f6fa;color:var(--ink,#141c2b);font-size:13.5px;cursor:pointer}
.message-quick button:hover{border-color:var(--brand,#176b5b);color:var(--brand,#176b5b)}
.message-topic-pill,.message-order-pill{display:inline-block;margin:0 6px 6px 0;padding:2px 8px;border-radius:999px;font-size:12px;line-height:1.6;background:rgba(20,28,43,.08);color:inherit;overflow-wrap:anywhere}
.message-bubble.mine .message-topic-pill,.message-bubble.mine .message-order-pill{background:rgba(255,255,255,.18)}
.nav-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:4px;padding:0 5px;border-radius:9px;background:#d9453f;color:#fff;font-size:11px;font-weight:700;line-height:18px;vertical-align:middle}
.order-support-link{margin:14px 0 4px}
@media(max-width:620px){.message-context-row{grid-template-columns:1fr}.message-quick button{flex:1 1 auto}.order-support-link .button{width:100%}}
/* ===== 购物车体验：数量输入、金额明细、缺货提示与操作反馈 ===== */
.cart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cart-toolbar .muted {
  font-size: 14px;
}

.cart-clear {
  min-height: 44px;
}

.cart-row {
  align-items: center;
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cart-thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: #5f6b7a;
  text-decoration: none;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-monogram {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cart-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-name {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cart-name:hover {
  text-decoration: underline;
}

.cart-stock-tag {
  align-self: flex-start;
  margin-top: 2px;
}

.cart-row.is-unavailable .cart-thumb,
.cart-row.is-unavailable .cart-copy,
.cart-row.is-unavailable .line-price {
  opacity: 0.65;
}

.cart-qty-input {
  width: 64px;
  height: 44px;
  padding: 0 4px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: center;
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.qty button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-issue {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cart-issue .ghost {
  min-height: 44px;
}

.cart-breakdown {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e5e8ef;
}

.cart-breakdown .summary-row {
  padding: 4px 0;
}

.cart-note {
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0 0;
}

.cart-empty {
  text-align: center;
  padding: 28px 12px;
}

.cart-empty-mark {
  font-size: 34px;
  line-height: 1;
  color: #9aa6b6;
  margin-bottom: 10px;
}

.cart-empty h3 {
  margin: 0 0 6px;
}

.cart-empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

#toast.with-action {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

#toast .toast-action {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .cart-thumb {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .cart-qty-input {
    width: 56px;
  }

  .cart-empty-actions {
    flex-direction: column;
  }

  .cart-empty-actions .button {
    width: 100%;
  }
}

/* PayPal 收银按钮：用品牌黄和站内主色区分，让买家一眼看出是跳转外部收银台。
   放在文件末尾，保证能覆盖 button.primary 的主色背景。 */
button.paypal-pay,
.button.paypal-pay {
  background: #ffc439;
  color: #111827;
  border: 1px solid #f0b429;
  box-shadow: 0 6px 16px rgba(240, 180, 41, 0.22);
}

button.paypal-pay:hover,
.button.paypal-pay:hover {
  background: #f2b21f;
  border-color: #e0a416;
}

.payment-notice button.paypal-pay {
  margin-left: 6px;
}
