:root {
  --bg: #fbf8f5;
  --card: #ffffff;
  --ink: #2e2a28;
  --muted: #76706b;
  --accent: #b9797f;
  --accent-soft: #f3e6e5;
  --line: #e9e2dc;
  --line-green: #06c755;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif; line-height: 1.35; font-weight: 600; }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
main { max-width: 960px; margin: 0 auto; padding: 0 20px 96px; }

/* 頁首 */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: rgba(251, 248, 245, .95);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Noto Serif TC", serif; font-size: 1.38rem; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand img { display: block; width: 44px; height: 44px; flex: none; }
.brand span { color: var(--muted); font-size: .98rem; font-weight: 400; margin-left: -4px; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 16px; top: 70px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; min-width: 160px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.menu nav a, .desktop-nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.menu nav a:hover, .desktop-nav a:hover, [aria-current="page"] { background: var(--accent-soft); }
.desktop-nav { display: none; }
@media (min-width: 860px) {
  .menu { display: none; }
  .desktop-nav { display: flex; gap: 4px; font-size: .95rem; }
}

/* 首頁主視覺 */
.hero { padding: 48px 0 16px; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.tags li { background: var(--accent-soft); color: var(--ink); padding: 4px 12px; border-radius: 999px; font-size: .9rem; }
.btn { display: inline-block; background: var(--line-green); color: #fff; text-decoration: none; padding: 12px 24px; border-radius: 999px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-left: 8px; }

/* 卡片 */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-top: 0; }
.card a.more { font-size: .95rem; }
.grid.reviews { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); align-items: start; }
.review-shot { margin: 0; padding: 12px; background: #fff; }
.review-shot img { display: block; width: 100%; height: auto; }
.review-shot figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; padding: 0 8px; }
.card .ph { margin: -20px -20px 16px; border-radius: var(--radius) var(--radius) 0 0; aspect-ratio: 1 / 1; }

/* 作品照 */
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); background: #efe9e4; }
.shot figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.card > img.cover { display: block; width: calc(100% + 40px); height: auto; margin: -20px -20px 16px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }

/* 首頁主視覺：手機上下排，桌機左右排 */
.hero { display: grid; gap: 28px; align-items: center; }
.hero-collage { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }
.hero-collage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); aspect-ratio: 1 / 1; }
.hero-collage img:first-child { grid-row: span 2; aspect-ratio: auto; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr 1fr; padding-top: 56px; }
}

/* 刺青師列表卡片：整張可點，左邊一張大圖、右邊兩張小圖 */
.artist-card { display: block; color: var(--ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.artist-card:hover, .artist-card:focus-visible { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.artist-card h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.artist-card .more { display: inline-block; margin-top: .5rem; color: var(--accent); font-weight: 600; font-size: .95rem; }
.artist-works { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; margin: 0 0 14px; }
.artist-works img { display: block; width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: #efe9e4; }
.artist-works img:first-child { grid-row: span 2; }
.artist-meta { font-size: .9rem; color: var(--muted); margin: 0; }
@media (min-width: 700px) { .artist-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .artist-grid { grid-template-columns: repeat(3, 1fr); } }

/* 刺青師個人頁的作品集：手機 2 欄、平板以上 3 欄，點開看大圖 */
.works { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .works { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.hint { font-size: .85rem; color: var(--muted); }
a.zoom { display: block; cursor: zoom-in; }
.shot figcaption a { color: inherit; }

/* 大圖燈箱（zoom.js） */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #14110f; color: #fff; }
.lightbox::backdrop { background: #14110f; }
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 12px 24px; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 130px); object-fit: contain; border-radius: 6px; touch-action: pan-y; }
.lightbox figcaption { margin-top: 12px; font-size: .95rem; text-align: center; }
.lb-count { position: absolute; top: 12px; left: 16px; margin: 0; line-height: 44px; font-size: .9rem; color: rgba(255,255,255,.75); }
.lightbox button { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255,255,255,.28); }
.lb-close { top: 12px; right: 12px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }

/* 照片預留位 */
.ph {
  aspect-ratio: 4 / 5; background: repeating-linear-gradient(45deg, #efe9e4, #efe9e4 10px, #f6f1ed 10px, #f6f1ed 20px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: .85rem; padding: 12px; border-radius: var(--radius);
}
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(4, 1fr); } }

/* 首頁刺青師列 */
.artist-row { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 700px) { .artist-row { grid-template-columns: repeat(5, 1fr); } }
.artist-row a { text-decoration: none; color: var(--ink); text-align: center; font-size: .95rem; }
.artist-row.others { grid-template-columns: repeat(4, 1fr); }
.artist-row.others a { font-size: .85rem; }
@media (min-width: 700px) { .artist-row.others { grid-template-columns: repeat(4, 130px); gap: 24px; } }
.artist-row img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; margin-bottom: 6px; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); }

/* 預覽版提示條（只有 python build.py --preview 才會出現） */
.preview-banner { background: #3a3330; color: #fff; font-size: .8rem; line-height: 1.5; text-align: center; padding: 6px 12px; }
.preview-banner mark.todo { font-size: 1em; }

/* 待補資料標記：正式上線前要全部清掉 */
mark.todo { background: #fff1a8; color: #6b5300; padding: 0 4px; border-radius: 4px; font-size: .9em; }

/* 表格、問答 */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--accent-soft); font-weight: 600; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .75rem 0 0; }
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin-bottom: .6rem; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; font-size: .95rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-top: 24px; }
.breadcrumb a { color: var(--muted); }
.map { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius); }
.cta { text-align: center; margin: 3rem 0 1rem; }

/* 頁尾與浮動 LINE 按鈕 */
.site-footer { border-top: 1px solid var(--line); padding: 24px 20px 96px; text-align: center; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: .3rem 0; }
.line-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  background: var(--line-green); color: #fff; text-decoration: none; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; box-shadow: 0 6px 18px rgba(6, 199, 85, .35);
}
