/* =========================================================
   木頭爸 Wood dad — 網站樣式
   想換顏色，改最上面這一區就好
   ========================================================= */
:root {
  --paper: #f7f1e6;      /* 主要底色（米白） */
  --paper-2: #efe5d4;    /* 第二底色 */
  --card: #fffaf1;       /* 卡片底色 */
  --ink: #2b1e14;        /* 主要文字（深咖啡） */
  --ink-2: #5d4a3a;      /* 次要文字 */
  --ink-3: #7a6553;      /* 小字 */
  --line: #e2d3bc;       /* 邊框線 */
  --amber: #c4822f;      /* 檜木金（深色底用） */
  --amber-d: #8a5519;    /* 檜木金（淺色底用） */
  --seal: #a8342a;       /* 印章紅 */
  --walnut: #231812;     /* 深色區塊 */
  --on-dark: #f3e7d3;    /* 深色底上的文字 */
  --on-dark-2: #bda88e;
  --green: #068442;      /* LINE 綠 */
  --green-d: #056b36;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(43, 30, 20, .05), 0 10px 30px -12px rgba(43, 30, 20, .18);
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --container: 1140px;
  --header-h: 68px;
}

/* ---------- 顏色主題（後台「外觀」可以切換） ---------- */
html[data-theme="forest"] {
  --paper: #f3f4ec; --paper-2: #e6eadb; --card: #fbfcf6;
  --ink: #1f2a1f; --ink-2: #4a5a48; --ink-3: #62705c; --line: #d6ddc8;
  --amber: #9cc27f; --amber-d: #45702f; --seal: #3d6b35;
  --walnut: #17221a; --on-dark: #eaf1e0; --on-dark-2: #a8b89c;
  --grain-opacity: .3;
}
html[data-theme="hinoki"] {
  --paper: #fbf6ec; --paper-2: #f3e8d3; --card: #fffdf8;
  --ink: #3a2a1a; --ink-2: #6a5541; --ink-3: #7d6853; --line: #eadcc2;
  --amber: #d9a441; --amber-d: #8f5f12; --seal: #b5562b;
  --walnut: #3b2a1c; --on-dark: #fbf1df; --on-dark-2: #d3bf9f;
  --grain-opacity: .5;
}
html[data-theme="indigo"] {
  --paper: #f2f4f7; --paper-2: #e3e8ef; --card: #fbfcfe;
  --ink: #172030; --ink-2: #44506a; --ink-3: #5c6880; --line: #d3dae6;
  --amber: #e0b25c; --amber-d: #2f5596; --seal: #9c2f2f;
  --walnut: #121a2b; --on-dark: #e8edf6; --on-dark-2: #a4b0c6;
  --grain-opacity: .18;
}
html[data-theme="wine"] {
  --paper: #f8f1f0; --paper-2: #efe1df; --card: #fffafa;
  --ink: #2a1618; --ink-2: #5c4043; --ink-3: #75585b; --line: #e5d0cd;
  --amber: #e3a36f; --amber-d: #8e2f3a; --seal: #8e2f3a;
  --walnut: #2a1215; --on-dark: #f6e7e4; --on-dark-2: #c7a8a4;
  --grain-opacity: .3;
}
html[data-theme="ink"] {
  --paper: #f6f5f2; --paper-2: #ebe9e4; --card: #ffffff;
  --ink: #1b1b1b; --ink-2: #4a4a4a; --ink-3: #676767; --line: #dcd9d2;
  --amber: #d8c3a0; --amber-d: #6b5a3e; --seal: #1b1b1b;
  --walnut: #151515; --on-dark: #f1efea; --on-dark-2: #b3afa7;
  --grain-opacity: .2;
}

/* ---------- 基本設定 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
section[id] { scroll-margin-top: var(--header-h); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1.2em; height: 1.2em; flex: none; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--walnut); color: var(--on-dark); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: 48px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-size: 16px; font-weight: 700; letter-spacing: .04em; text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-lg { height: 56px; padding: 0 28px; font-size: 17px; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-d); }
.btn-ghost { border-color: rgba(243, 231, 211, .5); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--on-dark); background: rgba(243, 231, 211, .1); }
.btn-yt { background: #cc0a1e; color: #fff; }
.btn-yt:hover { background: #a90818; }
.btn-light { background: var(--on-dark); color: #111; }
.btn-light:hover { background: #fff; }
.btn-white { background: #fff; color: var(--green-d); }
.btn-white:hover { background: #eafbf1; }

/* ---------- 公告列 ---------- */
.announce { background: var(--seal); color: #fff; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.announce .container { padding: 9px 0; }
.announce a { color: inherit; text-decoration: none; }
.announce a[href] { text-decoration: underline; text-underline-offset: 3px; }

/* 自己上傳的標誌照片：裁成圓形 */
.logo-img.is-photo { border-radius: 50%; object-fit: cover; }

/* 後台設定成隱藏的區塊 */
.is-off { display: none !important; }

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 241, 230, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -12px rgba(43, 30, 20, .25); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--serif); font-weight: 900; font-size: 22px; line-height: 1.15; letter-spacing: .1em; }
.brand-sub { font-size: 10.5px; font-weight: 700; line-height: 1.3; letter-spacing: .34em; color: var(--amber-d); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 8px;
  font-size: 15.5px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: background-color .2s, color .2s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* 「直播搶購」：選單裡紅色、有閃爍的小紅點；手機版另外在上面放一顆紅色按鈕 */
.nav a.nav-live { display: inline-flex; align-items: center; gap: 7px; color: #c2402c; font-weight: 700; }
.nav a.nav-live:hover { background: #fbe9e4; color: #a8321f; }
.nav-live::before, .live-pill::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; animation: live-blink 1.2s infinite;
}
.live-pill {
  display: none; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: #c2402c; color: #fff; font-size: 14.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
@keyframes live-blink { 50% { opacity: .3; } }
.nav-toggle {
  display: none; position: relative;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px;
  border-radius: 2px; background: currentColor;
  transition: transform .25s, opacity .2s;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 首頁大圖 ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--walnut); color: var(--on-dark); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url(images/grain-dark.svg) center / cover no-repeat;
  opacity: var(--grain-opacity, .55);
}
/* 首頁大圖：照片當背景 */
.hero--bg::before { background: var(--hero-img) center / cover no-repeat; opacity: 1; }
.hero.hero--bg::after { background: linear-gradient(90deg, rgba(15, 10, 7, .82), rgba(15, 10, 7, .45) 65%, rgba(15, 10, 7, .25)); }
.hero--bg .hero-art { display: none; }
.hero--bg .hero-inner { grid-template-columns: minmax(0, 720px); min-height: 520px; }
/* 首頁大圖：照片放右邊 */
.hero--photo .hero-art img {
  aspect-ratio: 4 / 5; object-fit: cover; border-radius: 24px;
  width: min(100%, 440px); animation: none;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); filter: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 78% 50%, rgba(196, 130, 47, .22), transparent 70%),
    linear-gradient(90deg, rgba(20, 13, 9, .75), rgba(20, 13, 9, .2) 60%, rgba(20, 13, 9, 0));
}
.hero-inner {
  display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 40px;
  padding: 88px 0 96px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 700; letter-spacing: .22em; color: var(--amber);
}
.eyebrow::before { content: ""; width: 32px; height: 2px; background: currentColor; }
.hero h1 {
  margin: 20px 0 24px;
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(40px, 6.2vw, 72px); line-height: 1.22; letter-spacing: .06em;
  color: #fbf3e6;
}
.hero .lead { max-width: 30em; font-size: 18px; line-height: 1.95; color: #e0cfb6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-social {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  margin-top: 28px; font-size: 15px; color: var(--on-dark-2);
}
.hero-social a {
  display: inline-flex; align-items: center; gap: 6px;
  padding-bottom: 1px; border-bottom: 1px solid rgba(243, 231, 211, .3);
  color: var(--on-dark); text-decoration: none;
}
.hero-social a:hover { border-bottom-color: var(--on-dark); }
.hero-art img {
  width: min(100%, 480px); margin-inline: auto;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, .5));
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* ---------- 數字 ---------- */
.stats { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.stats-inner { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.stat { padding: 26px 12px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b {
  display: block;
  font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.2; letter-spacing: .02em; color: var(--amber-d);
}
.stat span { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); word-break: keep-all; }

/* ---------- 區塊共用 ---------- */
.section { padding: 104px 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--walnut); color: var(--on-dark); }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 700; letter-spacing: .22em; color: var(--amber-d);
}
.kicker::before, .center .kicker::after { content: ""; width: 28px; height: 2px; background: currentColor; }
.section-dark .kicker { color: var(--amber); }
.section h2 {
  margin: 12px 0 16px;
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(30px, 4vw, 42px); line-height: 1.35; letter-spacing: .05em;
}
.section-head p:not(.kicker) { font-size: 17.5px; color: var(--ink-2); }
.section-dark .section-head p:not(.kicker) { color: var(--on-dark-2); }

/* ---------- 關於我 ---------- */
.about { display: grid; grid-template-columns: 1.25fr .75fr; gap: 64px; align-items: start; }
.about-body p { margin-top: 16px; font-size: 17.5px; color: var(--ink-2); }
.about-photo { margin: -34px -28px 22px; }
.about-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.profile dd { white-space: pre-line; }
.profile {
  position: relative; overflow: hidden;
  padding: 34px 28px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.profile::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 10px;
  background: url(images/grain.svg) 0 0 / 100% 100%, linear-gradient(90deg, #d7a867, #b8773d);
}
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-head img { width: 52px; height: 52px; }
.profile h3 { font-family: var(--serif); font-size: 21px; letter-spacing: .06em; }
.profile dl { margin: 0; }
.profile dl div { display: grid; grid-template-columns: 3em 1fr; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); }
.profile dt { font-size: 15px; font-weight: 700; color: var(--amber-d); }
.profile dd { margin: 0; font-size: 15.5px; line-height: 1.7; }

/* ---------- 木材 ---------- */
.wood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.wood-card {
  overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s;
}
.wood-card:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(43, 30, 20, .05), 0 18px 40px -16px rgba(43, 30, 20, .3); }
.swatch {
  height: 116px;
  background: url(images/grain.svg) 0 0 / 100% 100%, var(--wood, #c9955a);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08);
}
.swatch-burl { background: url(images/burl.svg) 0 0 / 100% 100%, var(--wood); }
.swatch-photo { height: 180px; background: var(--paper-2); }
.swatch-photo img { width: 100%; height: 100%; object-fit: cover; }
.wood-body { padding: 22px 24px 26px; }
.wood-body h3 { font-family: var(--serif); font-weight: 900; font-size: 23px; letter-spacing: .06em; }
.wood-body p { margin-top: 12px; font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }
.wood-body .wood-tag { margin-top: 2px; font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--amber-d); }
.wood-more { margin-top: 32px; text-align: center; color: var(--ink-2); }

/* ---------- 作品 ---------- */
.craft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.craft {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 26px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.seal {
  flex: none; display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 10px;
  background: var(--seal); color: #fff4ea;
  font-family: var(--serif); font-weight: 900; font-size: 30px; line-height: 1;
  box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 4.5px rgba(255, 244, 234, .7);
  transform: rotate(-4deg);
}
.craft:nth-child(even) .seal { transform: rotate(3deg); }
.craft h3 { font-size: 19px; font-weight: 700; letter-spacing: .04em; }
.craft p { margin-top: 6px; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }

/* ---------- 商品 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -24px 0 28px; }
.chip {
  height: 40px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-2);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: #cdb89a; }
.chip.is-active { background: var(--walnut); border-color: var(--walnut); color: var(--on-dark); }
.filters + .cat-filters { margin-top: -18px; }
.cat-filters .chip { height: 36px; padding: 0 14px; font-weight: 500; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.product-grid[data-filter="available"] .is-sold,
.product-grid[data-filter="sold"] .product:not(.is-sold) { display: none; }
.product {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s;
}
.product:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(43, 30, 20, .05), 0 18px 40px -16px rgba(43, 30, 20, .3); }
.product-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.product-photo {
  position: relative; overflow: hidden; aspect-ratio: 1;
  background: url(images/grain.svg) 0 0 / 100% 100%, linear-gradient(120deg, #e3c28c, #c89456);
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product-link:hover .product-photo img { transform: scale(1.04); }
.product-photo-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 64px; color: rgba(255, 250, 241, .85);
}
.product-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 2px 12px; border-radius: 999px;
  background: var(--seal); color: #fff; font-size: 13.5px; font-weight: 700;
}
.product-count {
  position: absolute; right: 10px; bottom: 10px;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(20, 13, 9, .72); color: #fff; font-size: 12.5px;
}
.product-info { flex: 1; padding: 16px 20px 12px; }
.product-cat { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--amber-d); }
.product-info h3 { font-size: 17.5px; line-height: 1.55; }
.product-price { margin-top: 6px; font-size: 14.5px; font-weight: 700; letter-spacing: .06em; color: var(--amber-d); }
.product-foot { padding: 0 20px 20px; }
.product-ask {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px;
  border: 1.5px solid var(--green); border-radius: 999px;
  color: var(--green); font-weight: 700; text-decoration: none;
  transition: background-color .2s, color .2s;
}
.product-ask:hover { background: var(--green); color: #fff; }
.product.is-sold .product-photo img { opacity: .75; filter: grayscale(.5); }
.product.is-sold .product-price { color: var(--ink-3); }
.product.is-sold .product-ask { border-color: var(--line); color: var(--ink-2); }
.product.is-sold .product-ask:hover { background: var(--paper-2); color: var(--ink); }
.product-empty {
  display: grid; justify-items: center; gap: 10px;
  padding: 48px 24px; text-align: center;
  background: var(--card); border: 1.5px dashed #cdb89a; border-radius: var(--radius);
}
.product-empty h3 { margin-top: 6px; font-family: var(--serif); font-size: 24px; }
.product-empty p { max-width: 30em; color: var(--ink-2); }
.product-empty .btn { margin-top: 10px; }

.buy { margin-top: 64px; }
.buy-title { margin-bottom: 24px; font-family: var(--serif); font-weight: 900; font-size: 24px; letter-spacing: .06em; }
.steps { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 20px; }
.step { padding: 22px 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.step-no {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--walnut); color: var(--amber);
  font-family: var(--serif); font-weight: 900; font-size: 18px;
}
.step h4 { margin: 14px 0 4px; font-size: 18px; }
.step p { font-size: 15px; line-height: 1.75; color: var(--ink-2); }

/* ---------- 影片 ---------- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
.yt {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: #000; cursor: pointer;
}
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .5s, opacity .3s; }
.yt:hover img { transform: scale(1.045); opacity: 1; }
.yt-play {
  position: absolute; left: 50%; top: 50%;
  display: grid; place-items: center;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(20, 13, 9, .62); color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background-color .2s, transform .2s;
}
.yt-play svg { width: 26px; height: 26px; margin-left: 4px; }
.yt:hover .yt-play { background: #cc0a1e; transform: scale(1.06); }
.yt-time {
  position: absolute; right: 10px; bottom: 10px;
  padding: 1px 7px; border-radius: 5px;
  background: rgba(0, 0, 0, .78); color: #fff; font-size: 12.5px; line-height: 1.6;
}
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt[data-drive] { background: url(images/grain-dark.svg) center / cover, var(--walnut); }

/* TikTok：直的影片。封面完整顯示，後面墊一張模糊的；播放時改成直的框 */
.yt[data-tt] {
  background:
    radial-gradient(55% 90% at 32% 42%, rgba(37, 244, 238, .2), transparent 70%),
    radial-gradient(55% 90% at 68% 58%, rgba(254, 44, 85, .22), transparent 70%),
    #111;
}
.yt .yt-blur, .yt:hover .yt-blur {
  position: absolute; inset: 0;
  filter: blur(16px) brightness(.5); transform: scale(1.2); opacity: 1;
}
.yt .yt-tall { position: absolute; inset: 0; object-fit: contain; }
.yt:hover .yt-tall { transform: scale(1.02); }
.yt-tag {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: rgba(12, 12, 12, .8); color: #fff;
  font-size: 12.5px; font-weight: 700; line-height: 1.5; letter-spacing: .02em;
}
.yt-tag svg { width: 13px; height: 13px; }
.yt[data-tt]:hover .yt-play { background: #fe2c55; }
.yt.is-tall { aspect-ratio: 9 / 16; width: min(100%, 80vh * 9 / 16); margin-inline: auto; }
.video h3 { margin-top: 14px; font-size: 16.5px; font-weight: 500; line-height: 1.65; color: var(--on-dark); }
.video-more { display: flex; justify-content: center; margin-top: 36px; }
.video-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 52px; }

/* ---------- 商品詳細視窗 ---------- */
body:has(.pd[open]) { overflow: hidden; }
.pd {
  width: min(100% - 32px, 1040px); max-width: none; max-height: calc(100% - 32px);
  padding: 0; border: 0; border-radius: 20px; overflow: auto;
  background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.pd::backdrop { background: rgba(20, 13, 9, .75); }
.pd-inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; }
.pd-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 250, 241, .94); color: var(--ink);
  font-size: 28px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.pd-media { display: flex; flex-direction: column; background: #1a120d; }
.pd-main { position: relative; aspect-ratio: 1; background: url(images/grain-dark.svg) center / cover, var(--walnut); }
.pd-main img { width: 100%; height: 100%; object-fit: contain; }
.pd-nav {
  position: absolute; top: 50%; z-index: 2;
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-top: -22px;
  border: 0; border-radius: 50%;
  background: rgba(20, 13, 9, .55); color: #fff; cursor: pointer;
}
.pd-nav svg { width: 22px; height: 22px; }
.pd-prev { left: 12px; }
.pd-next { right: 12px; }
.one-photo .pd-nav { display: none; }
.pd-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.pd-thumbs button {
  flex: none; width: 64px; height: 64px; padding: 0;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: none; opacity: .55; cursor: pointer;
}
.pd-thumbs button.is-active { border-color: var(--amber); opacity: 1; }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; gap: 12px; padding: 36px 32px 32px; }
.pd-cat { font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--amber-d); }
.pd-info h3:focus { outline: none; }
.pd-info h3 { padding-right: 44px; font-family: var(--serif); font-weight: 900; font-size: 28px; line-height: 1.35; letter-spacing: .04em; }
.pd-price { font-size: 18px; font-weight: 700; letter-spacing: .06em; color: var(--amber-d); }
.pd-state { align-self: flex-start; padding: 2px 12px; border-radius: 999px; background: #e3f4ea; color: #05622f; font-size: 14px; font-weight: 700; }
.pd-state.is-sold { background: #f6e1de; color: #8d2a21; }
.pd-desc { white-space: pre-line; font-size: 16px; line-height: 1.9; color: var(--ink-2); }
.pd-video:empty { display: none; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.no-photo .pd-media { display: none; }
.no-photo .pd-inner { grid-template-columns: 1fr; }
.btn-outline { border-color: var(--line); background: transparent; color: var(--ink); }
.btn-outline:hover { border-color: #cdb89a; background: var(--paper-2); }

/* ---------- 聯絡我 ---------- */
.contact-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: start; }
.line-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px;
  padding: 36px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #07924a 0%, var(--green) 45%, #04592d 100%);
  box-shadow: 0 24px 50px -24px rgba(6, 132, 66, .6);
}
.line-card-label { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.line-card p { font-size: 16px; line-height: 1.8; }
.line-card .line-card-id { margin: 4px 0 12px; font-size: 40px; font-weight: 900; line-height: 1.2; letter-spacing: .03em; }
.line-card .btn { margin-top: 22px; }
.line-qr { width: 160px; height: 160px; padding: 10px; border-radius: 16px; background: #fff; }
.channels { display: grid; gap: 12px; }
.channel {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
a.channel:hover { border-color: #cdb89a; box-shadow: var(--shadow); transform: translateX(3px); }
.ch-ico {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  color: #fff; font-size: 18px; font-weight: 900;
}
.ch-ico svg { width: 24px; height: 24px; }
.ch-mail { background: var(--amber-d); }
.ch-tt { background: #111; }
.ch-yt { background: #cc0a1e; }
.ch-rt { background: #d9441f; }
.ch-yh { background: #6001d2; }
.ch-wc { background: #078a45; }
.ch-text { display: flex; flex-direction: column; min-width: 0; }
.ch-text strong { font-size: 17px; }
.ch-text span { font-size: 14.5px; line-height: 1.5; color: var(--ink-3); overflow-wrap: anywhere; }
.ch-arrow { margin-left: auto; color: var(--ink-3); }
.ch-arrow svg { width: 20px; height: 20px; }

/* ---------- 頁尾 ---------- */
.site-footer { padding: 56px 0 28px; background: #1a120d; color: var(--on-dark-2); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  padding-bottom: 28px; border-bottom: 1px solid rgba(243, 231, 211, .12);
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-name { font-family: var(--serif); font-weight: 900; font-size: 20px; letter-spacing: .06em; color: var(--on-dark); }
.footer-brand p:not(.footer-name) { font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { font-size: 15px; color: var(--on-dark); text-decoration: none; opacity: .85; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.copyright { padding-top: 22px; font-size: 13.5px; }

/* 手機版右下角的 LINE 按鈕 */
.float-line {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  display: none; align-items: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 999px;
  background: var(--green); color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 12px 28px -8px rgba(6, 132, 66, .6);
}

/* ---------- 後台「外觀」直接編輯模式（只有在後台裡才看得到） ---------- */
.editing [contenteditable] {
  cursor: text; border-radius: 4px;
  outline: 1.5px dashed transparent; outline-offset: 3px;
  transition: outline-color .15s, background-color .15s;
}
.editing [contenteditable]:hover { outline-color: rgba(6, 132, 66, .65); }
.editing [contenteditable]:focus { outline: 2px solid #068442; background: rgba(6, 132, 66, .08); }
.editing [contenteditable].is-empty:empty::before,
.editing [contenteditable]:empty::before { content: attr(data-ph); opacity: .5; }
.editing .reveal { opacity: 1 !important; transform: none !important; }
.editing .float-line { display: none !important; }
.editing .ed-clickable { cursor: pointer; }
.editing .brand, .editing .about-photo { position: relative; }
.editing .wood-card, .editing .profile { overflow: visible; }
.editing .wood-card .swatch { border-radius: var(--radius) var(--radius) 0 0; }
.editing .ed-item { position: relative; border-radius: 12px; }
.editing .ed-item:hover, .editing .ed-item.is-sel { box-shadow: 0 0 0 2px rgba(6, 132, 66, .5); }
.ed-tools {
  position: absolute; top: 6px; right: 6px; z-index: 20;
  display: none; gap: 2px; padding: 3px; border-radius: 999px;
  background: #068442; box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}
.editing .ed-item:hover > .ed-tools,
.editing .ed-item.is-sel > .ed-tools,
.editing .ed-item:focus-within > .ed-tools { display: flex; }
.ed-btn {
  padding: 7px 10px; border: 0; border-radius: 999px;
  background: transparent; color: #fff;
  font: 700 13px/1.2 var(--sans); letter-spacing: .02em; white-space: nowrap; cursor: pointer;
}
.ed-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.ed-btn:disabled { opacity: .35; cursor: default; }
.ed-btn.on { background: #fff; color: #068442; }
.ed-btn.ed-del { color: #ffd6cf; }
.ed-btn.ed-add {
  display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px;
  border: 2px dashed rgba(6, 132, 66, .6); border-radius: 14px;
  background: rgba(6, 132, 66, .07); color: #068442; font-size: 15px;
}
.ed-btn.ed-add:hover { background: rgba(6, 132, 66, .14); }
.editing main > [data-sec] { position: relative; }
.ed-secbar, .ed-herobar {
  position: absolute; left: 50%; z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; max-width: calc(100% - 16px); overflow-x: auto;
  padding: 4px; border-radius: 999px;
  background: rgba(20, 20, 20, .9); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.ed-secbar { top: 12px; }
.ed-herobar { bottom: 14px; }
.ed-secname { padding: 0 8px 0 12px; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.editing .is-off { display: block !important; }
.editing .is-off > .container { opacity: .3; }
.editing .ed-empty-new #new-grid::before {
  content: "這一區只有在 90 天內有新上架的商品時才會出現，現在網站上看不到。";
  grid-column: 1 / -1; padding: 24px; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-3); text-align: center;
}
.editing .announce.is-empty { background: #8c9491; }
.editing .announce .ed-annlink { margin-left: 10px; background: rgba(255, 255, 255, .2); }
.editing [data-contact].is-empty, .editing a.is-empty { opacity: .55; }
.editing .about-photo.is-empty {
  display: grid; place-items: center; height: 140px;
  background: var(--paper-2); border-bottom: 2px dashed var(--line);
}
.editing .about-photo.is-empty img { display: none; }
.editing .about-photo.is-empty::after { content: "＋ 加一張照片（可以不放）"; color: var(--ink-3); font-weight: 700; }
.ed-menu {
  position: absolute; top: 100%; left: 0; z-index: 40;
  display: grid; gap: 2px; min-width: 160px; margin-top: 6px; padding: 6px;
  border-radius: 12px; background: #1b1b1b; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
.ed-menu .ed-btn { text-align: left; border-radius: 8px; }
.ed-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 100; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; background: #068442; color: #fff; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.ed-toast.show { opacity: 1; }

/* ---------- 捲動淡入 ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.wood-grid > :nth-child(3n+2), .craft-grid > :nth-child(3n+2), .video-grid > :nth-child(3n+2) { transition-delay: .08s; }
.wood-grid > :nth-child(3n), .craft-grid > :nth-child(3n), .video-grid > :nth-child(3n) { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-art img { animation: none; }
  .nav-live::before, .live-pill::before { animation: none; }
}

/* ---------- 平板 ---------- */
@media (max-width: 1000px) {
  .wood-grid, .craft-grid, .video-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about, .contact-grid { grid-template-columns: 1fr; }
  .about { gap: 40px; }
}

/* ---------- 手機 ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { display: none; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; gap: 0; margin: 0;
    padding: 4px 16px 12px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -18px rgba(43, 30, 20, .35);
  }
  .nav-open .nav { display: flex; }
  .nav a { padding: 14px 6px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .live-pill { display: inline-flex; }
  .nav a:last-child { border-bottom: 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding: 56px 0 64px; }
  .hero-art img { width: min(64%, 300px); }
  .float-line { display: inline-flex; }
  .site-footer { padding-bottom: 100px; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .wood-grid, .craft-grid, .video-grid, .steps { grid-template-columns: 1fr; }
  .hero .lead { font-size: 17px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .btn-lg { height: 52px; padding: 0 22px; font-size: 16.5px; }
  .stats-inner { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
  .stat { padding: 20px 6px; }
  .stat span { font-size: 13px; }
  .line-card { grid-template-columns: 1fr; padding: 28px 24px; }
  .line-card .line-card-id { font-size: 34px; }
  .line-qr { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-info { padding: 12px 12px 8px; }
  .product-info h3 { font-size: 15.5px; }
  .product-price { font-size: 13.5px; }
  .product-foot { padding: 0 12px 12px; }
  .product-ask { height: 40px; font-size: 14.5px; }
  .product-count { display: none; }

  /* 首頁大圖精簡一點，讓客人早點看到商品 */
  .hero-inner { gap: 4px; padding: 44px 0 36px; }
  .hero:not(.hero--photo) .hero-art img { width: 150px; }
  /* 手機上看不到 QR Code，就不要提它 */
  .qr-hint { display: none; }
  /* 怎麼買：號碼放左邊，比較省空間 */
  .step { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; padding: 16px 18px; }
  .step-no { grid-row: span 2; }
  .step h4 { margin: 4px 0 2px; }
  /* 木材、作品：卡片矮一點 */
  .swatch { height: 64px; }
  .swatch-photo { height: 160px; }
  .wood-body { padding: 16px 20px 20px; }
  .wood-body h3 { font-size: 21px; }
  .wood-body p { margin-top: 8px; }
  .craft { gap: 14px; padding: 18px; }
  .seal { width: 48px; height: 48px; font-size: 25px; }
  /* 右下角 LINE 按鈕小一點，少擋一點畫面 */
  .float-line { height: 46px; padding: 0 16px; font-size: 15px; }
}

@media (max-width: 760px) {
  .pd { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .pd-inner { grid-template-columns: 1fr; }
  .pd-info { padding: 24px 20px 0; }
  .pd-info h3 { font-size: 24px; }
  /* 往下捲也一直看得到「關閉」和「LINE 詢問」 */
  .pd-close { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; }
  .pd-actions {
    position: sticky; bottom: 0; z-index: 2;
    margin: 8px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px -16px rgba(43, 30, 20, .35);
  }
  .pd-actions .btn { flex: 1 1 auto; }
}
