:root {
  color-scheme: dark;
  --black: #000000;
  --white: #f7f4ef;
  --muted: #a8a39b;
  --line: rgba(247, 244, 239, 0.16);
  --silver: #d8d5ce;
  --ease-lux: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--white); color: var(--black); }
:focus-visible { outline: 1px solid var(--white); outline-offset: 3px; }

/* ---------- header ---------- */
.shop-header {
  position: fixed; top: 0; left: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 72px;
  padding: 0 max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px));
  background: rgba(0,0,0,0.82); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.shop-header .brand { font-size: 14px; letter-spacing: 2px; font-weight: 700; }
.shop-header nav { display: flex; gap: 26px; align-items: center; color: var(--muted); font-size: 13px; }
.shop-header nav a { position: relative; padding: 4px 0; transition: color .28s ease; }
.shop-header nav a:hover, .shop-header nav a.active { color: var(--white); }
.cart-link { color: var(--white) !important; }
.cart-count {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; margin-left: 4px; border-radius: 9px; text-align: center;
  background: var(--white); color: var(--black); font-size: 11px; font-weight: 700;
}

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 124px 28px 120px; }
.page-kicker { color: var(--muted); font-size: 12px; letter-spacing: 2.6px; text-transform: uppercase; margin: 0 0 18px; }
h1.page-title { font-size: clamp(30px, 4vw, 50px); line-height: 1.04; letter-spacing: -0.01em; font-weight: 760; margin: 0 0 14px; }
.page-sub { color: var(--muted); max-width: 620px; line-height: 1.65; margin: 0 0 56px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 30px; border: 1px solid var(--white);
  background: var(--white); color: var(--black); font-size: 14px; letter-spacing: .04em;
  transition: background .3s var(--ease-lux), color .3s var(--ease-lux), opacity .3s ease;
}
.btn:hover { background: transparent; color: var(--white); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--white); background: transparent; color: var(--white); }
.text-link {
  display: inline-flex; align-items: center; min-height: 40px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-size: 100% 1px; background-position: 0 100%;
  padding-bottom: 2px; font-size: 14px;
}

/* ---------- product grid (shop) ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.product-card { display: block; background: #050505; border: 1px solid var(--line); transition: transform .5s var(--ease-lux), border-color .4s ease; }
.product-card:hover { border-color: rgba(247,244,239,0.4); transform: translateY(-4px); }
.product-card .ph { aspect-ratio: 4/5; overflow: hidden; background: #0a0a0a; }
.product-card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-lux); }
.product-card:hover .ph img { transform: scale(1.05); }
.product-card .meta { padding: 18px 20px 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-card .pc-name { font-size: 15px; font-weight: 600; }
.product-card .pc-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.product-card .pc-price { color: var(--silver); font-size: 14px; white-space: nowrap; }

/* ---------- product detail ---------- */
.pd { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: start; }
.pd-gallery { position: sticky; top: 110px; }
.pd-main { aspect-ratio: 4/5; background: #0a0a0a; border: 1px solid var(--line); overflow: hidden; }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.pd-thumbs button { width: 72px; height: 72px; border: 1px solid var(--line); background: #0a0a0a; padding: 0; overflow: hidden; opacity: .6; transition: opacity .3s ease, border-color .3s ease; }
.pd-thumbs button.active { opacity: 1; border-color: var(--white); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-sub { color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 12px; }
.pd-title { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.05; font-weight: 760; margin: 0 0 18px; }
.pd-price { font-size: 22px; color: var(--silver); margin: 0 0 26px; }
.pd-desc { color: var(--muted); line-height: 1.75; white-space: pre-line; margin: 0 0 32px; }
.opt-label { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.opt-row { display: inline-flex; border: 1px solid var(--line); margin-bottom: 34px; flex-wrap: wrap; }
.opt-row button { min-width: 84px; min-height: 46px; padding: 0 18px; color: var(--white); background: transparent; border: 0; border-right: 1px solid var(--line); transition: background .3s ease, color .3s ease; }
.opt-row button:last-child { border-right: 0; }
.opt-row button.active { background: var(--white); color: var(--black); }
.pd-actions { display: flex; gap: 14px; align-items: center; }
.qty { display: inline-flex; border: 1px solid var(--line); align-items: center; }
.qty button { width: 46px; height: 52px; background: transparent; color: var(--white); border: 0; font-size: 18px; }
.qty span { min-width: 40px; text-align: center; font-size: 15px; }

/* ---------- reviews ---------- */
.reviews { margin-top: 110px; border-top: 1px solid var(--line); padding-top: 56px; }
.reviews-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; margin-bottom: 40px; }
.reviews-head h2 { font-size: clamp(24px,3vw,34px); font-weight: 740; margin: 0; }
.rating-summary { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.stars { display: inline-flex; gap: 2px; font-size: 16px; letter-spacing: 1px; }
.stars .s { color: rgba(247,244,239,0.25); }
.stars .s.on { color: var(--silver); }
.review-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.review-item { background: var(--black); padding: 22px 24px; }
.review-item .ri-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.review-item .ri-author { font-size: 14px; font-weight: 600; }
.review-item .ri-verified { font-size: 11px; color: #8fd6a6; border: 1px solid rgba(143,214,166,.4); padding: 1px 7px; border-radius: 10px; margin-left: 8px; }
.review-item .ri-title { font-size: 15px; margin: 6px 0 4px; }
.review-item .ri-body { color: var(--muted); line-height: 1.65; font-size: 14px; }
.review-item .ri-date { color: var(--muted); font-size: 12px; }
.review-empty { color: var(--muted); padding: 28px 0; }

/* review form */
.review-form { margin-top: 40px; max-width: 620px; }
.review-form h3 { font-size: 18px; font-weight: 700; margin: 0 0 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.input, .textarea, select.input {
  width: 100%; background: #0a0a0a; border: 1px solid var(--line); color: var(--white);
  padding: 13px 14px; font-size: 14px; transition: border-color .3s ease;
}
.input:focus, .textarea:focus { outline: none; border-color: rgba(247,244,239,0.5); }
.textarea { min-height: 110px; resize: vertical; }
.star-pick { display: inline-flex; gap: 4px; font-size: 26px; }
.star-pick span { color: rgba(247,244,239,0.25); cursor: pointer; transition: color .15s ease; }
.star-pick span.on { color: var(--silver); }

/* ---------- cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 0.9fr; gap: 50px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 92px 1fr auto; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line .cl-img { width: 92px; height: 110px; object-fit: cover; background: #0a0a0a; border: 1px solid var(--line); }
.cart-line .cl-name { font-size: 15px; font-weight: 600; }
.cart-line .cl-variant { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cart-line .cl-remove { color: var(--muted); font-size: 12px; background: none; border: 0; padding: 0; margin-top: 10px; text-decoration: underline; }
.cart-line .cl-price { color: var(--silver); font-size: 15px; white-space: nowrap; }
.summary { border: 1px solid var(--line); padding: 28px; position: sticky; top: 110px; }
.summary h3 { margin: 0 0 20px; font-size: 16px; }
.summary .row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--muted); font-size: 14px; }
.summary .row.total { color: var(--white); font-size: 18px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 16px; font-weight: 700; }
.summary .btn { width: 100%; margin-top: 22px; }

/* ---------- checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 50px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.ship-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.ship-opt.active { border-color: var(--white); }
.ship-opt .so-name { font-size: 14px; }
.ship-opt .so-price { margin-left: auto; color: var(--silver); }
.block-title { font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin: 30px 0 16px; }
.block-title:first-child { margin-top: 0; }
.notice { padding: 12px 14px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--white); color: var(--black); padding: 13px 22px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s var(--ease-lux); z-index: 90; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* footer */
.shop-footer { border-top: 1px solid var(--line); padding: 40px 28px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.site-foot { border-top: 1px solid var(--line); margin-top: 80px; padding: 54px 28px 46px; color: var(--muted); }
.site-foot .foot-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 30px 60px; justify-content: space-between; }
.site-foot .foot-brand { font-size: 14px; letter-spacing: 2px; font-weight: 700; color: var(--white); }
.site-foot .foot-tag { font-size: 12px; margin-top: 8px; }
.site-foot .foot-col h4 { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--white); margin: 0 0 14px; font-weight: 600; }
.site-foot .foot-col a { display: block; font-size: 13px; padding: 5px 0; color: var(--muted); transition: color .25s ease; }
.site-foot .foot-col a:hover { color: var(--white); }
.site-foot .foot-bottom { max-width: 1200px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.7; }

/* ---------- legal / policy pages ---------- */
.legal { max-width: 820px; margin: 0 auto; }
.legal .updated { color: var(--muted); font-size: 12px; letter-spacing: 1px; margin: 0 0 40px; }
.legal h2 { font-size: 20px; font-weight: 700; margin: 40px 0 12px; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: #cfcabf; line-height: 1.8; font-size: 15px; margin: 0 0 14px; }
.legal ul { padding-left: 20px; margin: 0 0 14px; }
.legal a.inl { color: var(--white); text-decoration: underline; }
.legal .zh-note { color: var(--muted); font-size: 13px; border-left: 2px solid var(--line); padding: 4px 0 4px 16px; margin: 0 0 30px; line-height: 1.7; }
.legal h2 { scroll-margin-top: 96px; }
.legal-toc { border: 1px solid var(--line); padding: 22px 26px; margin: 0 0 46px; }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 44px; }
.legal-toc li { color: var(--muted); font-size: 13px; margin: 0 0 9px; break-inside: avoid; }
.legal-toc a { color: var(--muted); transition: color .25s ease; }
.legal-toc a:hover { color: var(--white); }
.legal strong { color: var(--white); }
@media (max-width: 560px) { .legal-toc ol { columns: 1; } }

/* ---------- account ---------- */
.acct-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 920px; }
.acct-col { border: 1px solid var(--line); padding: 30px; }
.acct-h { font-size: 18px; font-weight: 700; margin: 0 0 22px; }
.acct-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 1px solid var(--line); padding: 22px 26px; margin-bottom: 44px; }
.acct-name { font-size: 18px; font-weight: 600; }
.order-row { border: 1px solid var(--line); padding: 16px 20px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.order-meta { display: flex; justify-content: space-between; color: var(--silver); font-size: 14px; }
.addr-card { border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 16px; font-size: 14px; line-height: 1.6; color: #cfcabf; }
.addr-add summary { cursor: pointer; color: var(--muted); padding: 14px 0; font-size: 14px; }
@media (max-width: 900px) { .acct-auth { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .wrap { padding: 100px 18px 80px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pd { grid-template-columns: 1fr; gap: 34px; }
  .pd-gallery { position: static; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .shop-header nav { gap: 16px; font-size: 12px; }
  .shop-header { padding: 0 16px; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
