/* ============================================================
   Pakyan · 手作织物与佛像挂幅
   风格：新中式 · 素雅禅意（宣纸底 / 墨字 / 朱砂点缀）
   ============================================================ */

:root {
  --paper: #f6f1e7;
  --panel: #fdfaf3;
  --ink: #2a2420;
  --ink-soft: #6b6157;
  --line: #e4d9c4;
  --red: #9e2b25;
  --red-deep: #7c1f1a;
  --gold: #a8842c;
  --shadow: 0 18px 40px -22px rgba(42, 36, 32, 0.35);
  --max: 1080px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong,
    SimSun, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* hidden 属性必须永远生效，防止 display:flex 之类的规则把遮罩层变成长期隐形挡板 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 40px);
  background: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  letter-spacing: 0.16em;
  font-weight: 700;
  padding-left: 14px;
  border-left: 3px solid var(--red);
}

.nav { display: flex; gap: clamp(16px, 3vw, 34px); }

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.2em;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.nav a:hover { color: var(--red); border-color: var(--red); }

/* ---------- 流动字条 ---------- */

.tape {
  overflow: hidden;
  background: #f0e8d7;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.tape-track {
  display: flex;
  width: max-content;
  padding: 8px 0;
  white-space: nowrap;
  animation: tape-scroll 46s linear infinite;
}

.tape:hover .tape-track { animation-play-state: paused; }

.tape-set {
  display: flex;
  align-items: center;
  gap: 30px;
  padding-right: 30px;
  flex: none;
  white-space: nowrap;
  color: rgba(158, 43, 37, 0.82);
  font-size: 12.5px;
  letter-spacing: 0.3em;
}

.tape-set i {
  width: 4px;
  height: 4px;
  flex: none;
  background: var(--gold);
  opacity: 0.7;
  transform: rotate(45deg);
}

@keyframes tape-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 首屏 ---------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) clamp(18px, 4vw, 40px) clamp(28px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 14px;
  letter-spacing: 0.32em;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.04em;
}

.lead {
  margin: 0 0 30px;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.6vw, 17px);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary {
  background: var(--red);
  color: var(--paper);
  box-shadow: 0 12px 24px -12px rgba(158, 43, 37, 0.7);
}

.btn-primary:hover { background: var(--red-deep); transform: translateY(-2px); }

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--panel);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

.hero-tag {
  margin: 26px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.1em;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: breathe 2.4s ease-in-out infinite;
}

#statusText { color: var(--red); font-weight: 700; }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

.hero-figure { margin: 0; }

.hero-caption {
  margin: 12px 4px 0;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-align: center;
}

/* ---------- 图片画框 ---------- */

.frame {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.frame:hover img { transform: scale(1.03); }

.works-grid .frame { cursor: zoom-in; }

/* ---------- 轮播 ---------- */

.frame { position: relative; }

.frame .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.frame .slide.on { opacity: 1; }

.works-grid .frame figcaption { z-index: 2; }

.dots {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(30, 24, 20, 0.35);
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(248, 244, 234, 0.4);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.dots i.on { background: #f8f4ea; transform: scale(1.25); }

.hero-frame .dots { right: 50%; transform: translateX(50%); }

.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(248, 244, 234, 0.4);
  border-radius: 50%;
  background: rgba(30, 24, 20, 0.4);
  color: #f8f4ea;
  font-size: 20px;
  line-height: 1;
  font-family: var(--serif);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
  padding: 0;
}

.frame:hover .car-arrow { opacity: 1; }
.car-arrow:hover { background: var(--red); }
.car-prev { left: 12px; }
.car-next { right: 12px; }

@media (hover: none) {
  .car-arrow { display: none; }
}

.hero-frame { aspect-ratio: 3 / 4; }

/* ---------- 分隔纹样 ---------- */

.ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}

.ornament i {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line) 30%, var(--line) 70%, transparent);
}

.ornament span {
  color: var(--gold);
  font-size: 12px;
  opacity: 0.85;
}

/* ---------- 通用段落 ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) clamp(18px, 4vw, 40px);
}

.section-head { margin-bottom: clamp(24px, 4vw, 40px); }

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.32em;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 0.05em;
}

.section-sub {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* ---------- 经营分类 ---------- */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.shop-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 26px 26px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.shop-num {
  position: absolute;
  top: 14px;
  right: 18px;
  color: var(--gold);
  opacity: 0.55;
  font-size: 15px;
  letter-spacing: 0.2em;
}

.shop-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  letter-spacing: 0.14em;
}

.shop-card h3::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-top: 10px;
  background: var(--red);
  border-radius: 2px;
}

.shop-card p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- 作品 ---------- */

.works-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
}

.works-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}

.work-large { aspect-ratio: 3 / 4; }
.work-small { aspect-ratio: 3 / 2.1; }

.works-grid figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 18px 14px;
  color: #f8f4ea;
  background: linear-gradient(to top, rgba(30, 24, 20, 0.78), transparent);
}

.works-grid figcaption span {
  font-size: 12.5px;
  letter-spacing: 0.28em;
  color: #e8c98a;
}

.works-grid figcaption p {
  margin: 4px 0 0;
  font-size: 14px;
  letter-spacing: 0.06em;
}

/* ---------- 手艺 ---------- */

.craft-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.craft-item {
  border-left: 3px solid var(--red);
  padding: 4px 0 4px 18px;
}

.craft-item h3 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0.22em;
}

.craft-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- 联系 ---------- */

.contact-box {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(28px, 5vw, 52px);
  box-shadow: var(--shadow);
}

.contact-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.05em;
}

.contact-copy p {
  margin: 0;
  color: var(--ink-soft);
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 20px;
  border: 1px dashed var(--gold);
  border-radius: 14px;
  background: rgba(168, 132, 44, 0.06);
  text-align: center;
}

.contact-label {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}

.contact-id {
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--red);
  letter-spacing: 0.08em;
  user-select: all;
}

.contact-hint { font-size: 13px; color: var(--ink-soft); }

/* ---------- 常见问题 ---------- */

.faq-list { max-width: 760px; }

.faq-list details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.faq-list details[open] { border-color: var(--gold); }

.faq-list summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-size: 16.5px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  color: var(--red);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.faq-list details[open] summary::after { transform: rotate(45deg); }

.faq-list details p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- 看大图灯箱 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(26, 20, 16, 0.93);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.show { opacity: 1; }

.lightbox img {
  max-width: min(92vw, 760px);
  max-height: 84vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}

.lightbox p {
  margin: 0;
  color: #e9dcc4;
  font-size: 14px;
  letter-spacing: 0.2em;
}

/* ---------- 返回顶部 ---------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--red);
  font-size: 18px;
  font-family: var(--serif);
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

.to-top:hover { background: var(--red); color: var(--paper); }

/* ---------- 选货篮 ---------- */

.want-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 18px;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: transparent;
  color: var(--red);
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.want-btn:hover { background: var(--red); color: var(--paper); }
.want-btn:active { transform: scale(0.94); }
.want-btn.is-added { background: var(--red); color: var(--paper); }

.want-btn-cap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  margin: 0;
  padding: 5px 14px;
  font-size: 12.5px;
  background: rgba(248, 244, 234, 0.16);
  border-color: rgba(248, 244, 234, 0.55);
  color: #f8f4ea;
  backdrop-filter: blur(4px);
}

.want-btn-cap:hover, .want-btn-cap.is-added { background: var(--red); border-color: var(--red); }

.basket-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border: none;
  border-radius: 999px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 14px 30px -10px rgba(124, 31, 26, 0.65);
  animation: basket-in 0.35s ease;
}

.basket-bar b {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--red);
  font-size: 13px;
}

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

.basket-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(26, 20, 16, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.basket-sheet.show { opacity: 1; }

.basket-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 480px);
  max-height: 78vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 20px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.4);
}

.basket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  letter-spacing: 0.16em;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.basket-close {
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0 4px;
}

.basket-list { list-style: none; margin: 0; padding: 0; }

.basket-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(228, 217, 196, 0.5);
  font-size: 15px;
}

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

.b-qty button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.b-qty button:hover { border-color: var(--red); color: var(--red); }

.b-qty b { min-width: 34px; text-align: center; color: var(--red); }

.basket-empty { color: var(--ink-soft); text-align: center; padding: 22px 0 6px; font-size: 14.5px; }

.basket-actions { display: flex; gap: 10px; margin-top: 16px; }

.basket-copy { flex: 1; text-align: center; border: none; cursor: pointer; }

.basket-clear {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  cursor: pointer;
}

.basket-wechat {
  margin-top: 16px;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--gold);
  border-radius: 14px;
  background: rgba(168, 132, 44, 0.06);
}

.bw-tip { margin: 0 0 8px; font-size: 14.5px; }

.bw-id {
  display: block;
  font-size: 26px;
  color: var(--red);
  letter-spacing: 0.1em;
  user-select: all;
  padding: 4px 0;
}

.bw-sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 13.5px; }

.basket-keep {
  display: block;
  margin: 10px auto 0;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13.5px;
  text-decoration: underline;
  cursor: pointer;
}

.bw-fallback {
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  user-select: all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(42, 36, 32, 0.92);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- 页脚 ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13.5px;
  letter-spacing: 0.1em;
}

/* ---------- 滚动淡入 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 手机端 ---------- */

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 420px; margin: 0 auto; }
  .works-grid { grid-template-columns: 1fr; }
  .contact-box { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .shop-grid { grid-template-columns: 1fr; }
  .craft-strip { grid-template-columns: 1fr; gap: 22px; }
  .nav { gap: 16px; }
  .nav a { font-size: 14px; letter-spacing: 0.12em; }
  .brand { font-size: 18px; letter-spacing: 0.12em; padding-left: 10px; }
  .hero-actions .btn { flex: 1; text-align: center; padding: 13px 10px; }
  .contact-card { width: 100%; }
  .tape-track { font-size: 12px; letter-spacing: 0.22em; }
  .tape-set { gap: 22px; padding-right: 22px; }
  .dots { right: 50%; transform: translateX(50%); bottom: 12px; }
  .works-grid .frame .dots { right: 50%; transform: translateX(50%); }
  .to-top { right: 14px; bottom: 18px; }
}

/* ---------- 尊重系统减动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
  .frame img { transition: none; }
  .tape-track { animation: none; }
  .lightbox { transition: none; }
  .to-top { transition: none; }
  .basket-bar { animation: none; }
}
