/* ==========================================================================
   智宇网 · 手工编织 / 文创商城  主样式
   说明：配色采用暖色毛线质感，保持手工类目调性；
        所有交互元素具备明确 hover / focus 态，满足可访问性。
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand:        #8a5a3b;
  --brand-dark:   #6b4429;
  --brand-light:  #f0e2d8;
  --accent:       #c2703d;

  /* 中性色 */
  --ink:          #2b2320;
  --ink-2:        #5c4f49;
  --ink-3:        #8d7f78;
  --line:         #e5dbd3;
  --bg:           #faf7f5;
  --card:         #ffffff;

  /* 语义色 */
  --ok:           #3f7d4e;
  --warn:         #b26a1f;
  --danger:       #b23a33;

  --radius:       10px;
  --shadow:       0 2px 12px rgba(43, 35, 32, .07);
  --shadow-lg:    0 8px 32px rgba(43, 35, 32, .13);

  --maxw:         1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部公告条 ---------- */
.notice-bar {
  background: var(--ink);
  color: #f3ece7;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
}
.notice-bar strong { color: #ffd9a8; font-weight: 600; }

/* ---------- 头部 ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
}
.logo small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 1.5px;
  margin-top: -3px;
}

.nav { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink-2);
  font-size: 15px;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--brand);
  transition: width .22s;
}
.nav a:hover { color: var(--brand); }
.nav a:hover::after { width: 100%; }

.cart-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--brand);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background .2s;
}
.cart-btn:hover { background: var(--brand-dark); color: #fff; }
.cart-count {
  background: #fff;
  color: var(--brand);
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #8a5a3b 0%, #a9714a 55%, #c2703d 100%);
  color: #fff;
  padding: 76px 0 82px;
}
.hero h1 {
  font-size: 42px;
  line-height: 1.3;
  margin-bottom: 16px;
  font-weight: 700;
}
.hero p {
  font-size: 17px;
  opacity: .92;
  max-width: 620px;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-primary { background: #fff; color: var(--brand-dark); }
.btn-primary:hover { background: var(--brand-light); color: var(--brand-dark); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.65);
}
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- 信任条 ---------- */
.trust {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.trust-item { font-size: 14px; color: var(--ink-2); }
.trust-item b {
  display: block;
  color: var(--brand);
  font-size: 15px;
  margin-bottom: 2px;
}

/* ---------- 区块 ---------- */
.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 {
  font-size: 30px;
  margin-bottom: 10px;
}
.section-head p { color: var(--ink-3); font-size: 15px; }

.cats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.cat-chip {
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-2);
  transition: all .2s;
}
.cat-chip:hover, .cat-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ---------- 商品网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #efe3da, #e0cec2);
  display: grid;
  place-items: center;
  font-size: 52px;
  overflow: hidden;
}
.tag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 600;
}
.tag-out { background: var(--ink-3); }

.card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.card-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}
.card-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.price { color: var(--danger); font-size: 21px; font-weight: 700; }
.price small { font-size: 13px; }
.price-old {
  color: var(--ink-3);
  text-decoration: line-through;
  font-size: 13px;
}
.stock { font-size: 12px; color: var(--warn); margin-bottom: 12px; }
.stock.zero { color: var(--ink-3); }

.btn-buy {
  width: 100%;
  padding: 10px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-buy:hover { background: var(--brand-dark); }
.btn-buy:disabled {
  background: var(--line);
  color: var(--ink-3);
  cursor: not-allowed;
}

/* ---------- 服务保障 ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 20px;
}
.svc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.svc h3 { font-size: 16px; margin-bottom: 8px; }
.svc h3 span { color: var(--accent); margin-right: 6px; }
.svc p { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }

/* ---------- 常见问题 ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq .faq-body {
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.8;
}

/* ---------- 购物车抽屉 ---------- */
.cart-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  z-index: 200;
}
.cart-mask.on { opacity: 1; pointer-events: auto; }

.cart-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  max-width: 92vw;
  background: var(--bg);
  box-shadow: -6px 0 30px rgba(0,0,0,.16);
  transform: translateX(100%);
  transition: transform .28s;
  z-index: 201;
  display: flex;
  flex-direction: column;
}
.cart-panel.on { transform: translateX(0); }
.cart-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
}
.cart-head h3 { font-size: 17px; }
.cart-close {
  background: none; border: none;
  font-size: 24px; cursor: pointer;
  color: var(--ink-3); line-height: 1;
}
.cart-items { flex: 1; overflow-y: auto; padding: 14px 22px; }
.cart-item {
  display: flex; gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cart-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  background: var(--brand-light);
  display: grid; place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}
.cart-info { flex: 1; min-width: 0; }
.cart-info h4 { font-size: 14.5px; margin-bottom: 3px; }
.cart-info p { font-size: 13px; color: var(--danger); font-weight: 600; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-2);
}
.qty-btn:hover { border-color: var(--brand); color: var(--brand); }
.qty-num { min-width: 20px; text-align: center; font-size: 14px; }
.cart-del { background: none; border: none; color: var(--ink-3); cursor: pointer; font-size: 12px; }
.cart-del:hover { color: var(--danger); }

.cart-empty { text-align: center; padding: 60px 20px; color: var(--ink-3); font-size: 14px; }

.cart-foot {
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  background: var(--card);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.cart-total span { font-size: 14px; color: var(--ink-2); }
.cart-total b { font-size: 23px; color: var(--danger); }
.btn-checkout {
  width: 100%;
  padding: 13px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-checkout:hover { background: var(--brand-dark); }
.btn-checkout:disabled { background: var(--line); color: var(--ink-3); cursor: not-allowed; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
  z-index: 300;
  padding: 20px;
}
.modal-mask.on { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card);
  border-radius: 14px;
  padding: 30px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--ink-2); margin-bottom: 20px; }
.qr-box {
  width: 210px; height: 210px;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid; place-items: center;
  background: #fff;
}
.qr-box img { width: 100%; height: 100%; }
.pay-status { font-size: 14px; color: var(--ink-2); margin-bottom: 18px; }
.modal .btn { width: 100%; justify-content: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 34px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 400;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 底部 ---------- */
.site-footer {
  background: #241c19;
  color: #b8aca5;
  padding: 52px 0 0;
  font-size: 13.5px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 34px;
  padding-bottom: 38px;
}
.site-footer h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}
.site-footer a { color: #b8aca5; display: block; margin-bottom: 9px; }
.site-footer a:hover { color: #fff; }
.footer-about p { line-height: 1.85; margin-bottom: 12px; max-width: 330px; }

.footer-contact li {
  list-style: none;
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
}
.footer-contact .k { color: #7d726c; }

.footer-bottom {
  border-top: 1px solid #3a2f2a;
  padding: 20px 0;
  text-align: center;
  font-size: 12.5px;
  color: #8a7e77;
  line-height: 2;
}
.footer-bottom a { display: inline; color: #a89c95; }
.footer-bottom .beian {
  color: #a89c95;
  font-weight: 500;
}
.footer-bottom .beian:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .nav { gap: 16px; }
  .nav a { font-size: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 32px; }
  .trust-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .header-inner { gap: 12px; }
  .logo { font-size: 17px; }
  .logo small { display: none; }
  .section { padding: 46px 0; }
  .section-head h2 { font-size: 24px; }
  .hero { padding: 52px 0; }
  .hero h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
/* Real product reference photography. Keep the entire photographed object visible. */
.card-img { background: #f3efeb; }
.card-img img { display: block; width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.card-img .tag { z-index: 1; }
.photo-caption { padding: 5px 12px; text-align: right; font-size: 11px; color: var(--ink-3); background: #f3efeb; }
.cart-thumb { overflow: hidden; }
.cart-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-source-list { display: grid; gap: 20px; margin: 24px 0; }
.photo-source-item { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 16px; align-items: center; }
.photo-source-item img { width: 100px; height: 80px; object-fit: contain; background: #f3efeb; }
.photo-source-item a { text-decoration: underline; overflow-wrap: anywhere; }
.photo-source-item h2 { font-size: 16px; margin: 0 0 5px; }
.photo-source-item p { font-size: 13px; margin: 3px 0; }

.ui-icon{display:inline-block;font-family:Arial,sans-serif;line-height:1;vertical-align:baseline;font-style:normal;font-weight:700;min-width:1em;text-align:center}.ui-spin{animation:ui-spin 1s linear infinite}@keyframes ui-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.ui-spin{animation:none}}
