:root {
  --paper: #f6f1e7;
  --paper-deep: #ece4d4;
  --ink: #1f1c18;
  --ink-soft: #5c554b;
  --line: #d8ceba;
  --seal: #a8322a;
  --seal-dark: #862720;
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

/* 頂部導覽 */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(246, 241, 231, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-decoration: none;
}
.top nav { display: flex; gap: clamp(12px, 2.5vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.top nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.95rem; letter-spacing: 0.08em; }
.top nav a:hover { color: var(--seal); }
.top nav a.nav-wa { color: #fff; background: var(--seal); padding: 0 12px; border-radius: 2px; }
.top nav a.nav-wa:hover { color: #fff; background: var(--seal-dark); }

/* 開場 */
.hero {
  text-align: center;
  padding: clamp(56px, 10vw, 112px) 16px clamp(40px, 7vw, 72px);
}
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: 0.3em;
  padding-left: 0.3em; /* 抵銷字距讓標題置中 */
  font-weight: 700;
}
.hero p { margin: 0 auto 32px; max-width: 32em; color: var(--ink-soft); font-size: 1.05rem; text-wrap: balance; }
.ph { display: inline-block; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--seal);
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.12em;
  border-radius: 2px;
}
.btn:hover { background: var(--seal-dark); }

/* 作品 */
h2 {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: 0.25em;
  margin: 0 0 24px;
}
h2::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--seal);
}

.works { padding: 40px clamp(16px, 4vw, 48px) 24px; border-top: 1px solid var(--line); }

.cat-nav { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-nav a {
  text-decoration: none;
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}
.cat-nav a:hover { border-color: var(--seal); color: var(--seal); }

.cat { max-width: 1200px; margin: 0 auto; padding-top: 32px; }
.cat h3 {
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* 瀑布流：作品比例差很多，用欄位排版保留原比例 */
.grid { columns: 3 280px; column-gap: 20px; }
.work {
  break-inside: avoid;
  margin: 0 0 24px;
  background: #fff;
  padding: 10px 10px 0;
  box-shadow: 0 1px 3px rgba(31, 28, 24, 0.08);
}
.work img { display: block; width: 100%; height: auto; margin: 0 auto; }
.work a { display: block; cursor: zoom-in; }
.work a:hover img { opacity: 0.9; }
.work figcaption { padding: 10px 2px 12px; font-size: 1rem; letter-spacing: 0.08em; }

/* 文字資訊區 */
.info {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.info p { margin: 0 0 12px; }
.info .btn { margin-top: 16px; }
.info ul { list-style: none; padding: 0; margin: 0; }
.info li { margin: 0 0 10px; }
#buy a:not(.btn) { color: var(--seal); }

.foot {
  text-align: center;
  padding: 32px 16px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  letter-spacing: 0.2em;
}
.foot p { margin: 0 0 6px; }
.foot p + p { letter-spacing: 0.05em; }
.foot a { color: var(--seal); letter-spacing: 0.05em; }

/* 點開看大圖（純 CSS，:target 控制開關） */
.viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 18, 15, 0.97);
  padding: 56px 16px 16px;
  overflow: auto;
}
.viewer:target { display: flex; align-items: center; justify-content: center; }
.viewer figure { margin: auto; text-align: center; }
.viewer img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  background: #fff;
}
.viewer figcaption { color: #eee; margin-top: 12px; letter-spacing: 0.1em; }
.viewer-close {
  position: fixed;
  top: 10px;
  right: 16px;
  font-size: 2.4rem;
  line-height: 1;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 560px) {
  .top { flex-direction: column; gap: 6px; padding-top: 10px; padding-bottom: 10px; }
  html { scroll-padding-top: 96px; }
}
