@font-face {
  font-family: "ChenYuluoyan";
  src: url("assets/ChenYuluoyan-2.0-Thin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --cream: #faf7ef;
  --paper: #fffdf7;
  --ink: #28261f;
  --muted: #655e50;
  --accent: #a33e2a;
  --line: #ded4c1;
  --sans: "DM Sans", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font: 16px/1.7 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; }
p, figure { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.18; }
h1, h2 { font-family: var(--serif); font-weight: 900; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 88px, 1240px); margin-inline: auto; }
section[id] { scroll-margin-top: 24px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { width: 136px; height: auto; }
nav { display: flex; gap: 34px; font-size: 14px; font-weight: 700; }
nav a, .footer-inner a { text-decoration: none; }
nav a:hover, .footer-inner a:hover { color: var(--accent); }
.button {
  min-height: 46px; padding: 9px 21px; border: 1px solid transparent; border-radius: 99px;
  display: inline-flex; justify-content: center; align-items: center; gap: 11px;
  font-size: 14px; font-weight: 800; text-decoration: none; text-align: center;
  transition: background .18s, color .18s;
}
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover { background: #813021; }
.button.dark { color: #fff; background: var(--ink); }
.button.dark:hover { background: #494237; }
.button.outline { border-color: var(--ink); background: transparent; }
.button.outline:hover { color: #fff; background: var(--ink); }
.text-link { color: inherit; background: none; border: 0; padding: 0; font-size: 14px; font-weight: 750; text-decoration: underline; text-underline-offset: 5px; }
.text-link:disabled { color: var(--muted); opacity: .65; }
.hero { display: grid; grid-template-columns: .83fr 1.17fr; gap: clamp(28px, 5vw, 74px); align-items: center; padding-block: 58px 68px; }
.edition { display: flex; gap: 10px; align-items: center; color: var(--accent); letter-spacing: .13em; font-weight: 850; font-size: 13px; }
.edition > span:first-child { background: var(--accent); width: 8px; height: 8px; border-radius: 50%; }
.edition-rule { background: #bd8172; height: 1px; width: 24px; }
.hero h1 { font-size: clamp(56px, 6.5vw, 97px); letter-spacing: -.05em; margin-top: 18px; line-height: 1.08; }
.hero-dot { color: var(--accent); margin-left: .05em; }
.hero-tagline { font-size: clamp(21px, 2vw, 28px); font-weight: 850; margin-block: 14px 10px; }
.hero-intro { max-width: 350px; color: var(--muted); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 28px; }
.hero-figure { position: relative; background: #dbc7ac; border-radius: 4px; overflow: hidden; }
.hero-figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }
.hero-figure figcaption {
  position: absolute; right: 10px; bottom: 10px; max-width: calc(100% - 20px);
  background: var(--cream); padding: 4px 11px; border-radius: 3px; font-size: 12px;
}
.carousel-controls, .carousel-nav { display: flex; align-items: center; gap: 10px; }
.carousel-controls { justify-content: space-between; margin-top: 9px; }
.carousel-nav button {
  width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--paper); font-size: 17px; line-height: 1;
}
.carousel-nav button:hover { border-color: var(--accent); color: var(--accent); }
#carousel-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.section-pad { padding-block: 76px; }
.section-heading { margin-bottom: 28px; }
.eyebrow { color: var(--accent); font-weight: 850; font-size: 13px; letter-spacing: .12em; margin-bottom: 10px; }
.section-heading h2 { font-size: clamp(33px, 4.5vw, 59px); letter-spacing: -.035em; }
.section-heading > p:last-child { margin-top: 14px; color: var(--muted); max-width: 520px; }
.theme-section { background: #efe8d9; border-block: 1px solid var(--line); }
.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-card {
  position: relative; display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px;
  align-items: center; min-height: 105px; padding: 13px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
}
.theme-card img { width: 60px; height: 78px; object-fit: contain; }
.theme-card span { font-weight: 850; line-height: 1.3; }
.theme-card[aria-pressed="true"], .format-card[aria-pressed="true"] {
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #fff9ed;
}
.theme-card:hover, .format-card:hover { border-color: var(--accent); }
.tear-studio { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.book-stage {
  display: grid; grid-template-columns: minmax(0, 212px) auto; align-items: center; justify-content: center;
  gap: clamp(12px, 3vw, 32px); min-height: 360px; padding: 34px 20px;
  background: radial-gradient(ellipse at 44% 40%, #e7c7a3, #bd936e);
  overflow: hidden; isolation: isolate;
}
.book { position: relative; width: 100%; box-shadow: 0 17px 23px #59371a56; }
.book::before {
  content: ""; position: absolute; inset: -5px 0 auto; height: 10px;
  background: #fff; box-shadow: 0 1px 2px #49362a22; z-index: 2; border-radius: 3px 3px 0 0;
}
.book::after {
  content: ""; position: absolute; inset: auto 1px -7px; height: 7px; z-index: -1;
  background: repeating-linear-gradient(#fffaf0 0 1px, #d7cab4 2px 3px);
}
.book img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.book .peeled-page { position: absolute; inset: 0; z-index: 1; pointer-events: none; transform-origin: top right; }
.tear-controls { padding: 21px; }
.tear-controls h3 { font-size: 20px; margin-bottom: 6px; }
.tear-controls p { color: var(--muted); font-size: 14px; }
.tear-controls .page-status { color: var(--accent); font-weight: 750; margin-bottom: 4px; }
.tear-controls .page-title { color: var(--ink); font-weight: 800; }
.page-meta, .page-recipe { margin-top: 6px; }
.page-recipe summary { cursor: pointer; font-size: 14px; font-weight: 750; }
.page-recipe h4 { margin: 6px 0 0; font-size: 14px; }
.page-recipe ul, .page-recipe ol { margin: 4px 0 0; padding-inline-start: 22px; font-size: 14px; }
.tear-actions { display: grid; gap: 7px; justify-items: center; white-space: nowrap; }
.tear-actions .button { padding-inline: 14px; gap: 6px; }
.format-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.format-card { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; padding: 0; }
.format-card img { width: 100%; height: clamp(160px, 21vw, 287px); object-fit: cover; }
.format-card:first-child img { object-position: center 53%; }
.format-details { display: grid; gap: 4px; padding: 16px 20px 20px; }
.format-details small { color: var(--accent); font-weight: 850; }
.format-details strong { font-size: 22px; }
.format-details > span { color: var(--muted); font-size: 14px; }
.help { color: var(--muted); font-size: 13px; }
.format-options + .help { margin-top: 12px; }
.custom-section { border-block: 1px solid var(--line); background: #e9eadc; }
.custom-layout, .quote-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(30px, 7vw, 90px); align-items: start; }
.custom-fields { display: grid; max-width: 420px; gap: 8px; }
.custom-fields .button, .custom-fields .text-link { justify-self: start; }
.custom-fields .button { margin-top: 10px; }
label { display: block; font-weight: 800; font-size: 14px; }
label small { color: var(--muted); font-weight: 500; margin-left: 3px; }
input, textarea, select {
  display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid #afa48e;
  border-radius: 4px; padding: 8px 11px; background: var(--paper); color: var(--ink); font-size: 16px;
}
textarea { resize: vertical; }
input[type="file"] { font-size: 14px; }
input::file-selector-button { color: var(--ink); background: #f1e8d6; border: 0; margin-right: 9px; padding: 4px 8px; border-radius: 3px; cursor: pointer; }
.custom-figure {
  display: grid; justify-items: center; gap: 18px; padding: 35px 20px 19px;
  background: radial-gradient(ellipse at 40% 30%, #cdd0b4, #aeb195); border-radius: 4px;
}
.custom-paper { position: relative; width: min(100%, 250px); background: white; box-shadow: 0 17px 28px #3037244d; }
.custom-paper > img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; }
.imprint { position: absolute; inset: 4%; pointer-events: none; }
.imprint-item {
  position: absolute; left: var(--imprint-x); top: var(--imprint-y);
  transform: translate(calc(0% - var(--imprint-x)), calc(0% - var(--imprint-y)));
  display: grid; place-items: center; width: max-content; min-width: 28px; min-height: 28px; max-width: 85%; padding: 2px;
  cursor: grab; pointer-events: auto; touch-action: none; user-select: none; text-align: center;
}
.imprint-item:focus { z-index: 1; }
.imprint-item.is-dragging { cursor: grabbing; z-index: 2; }
.imprint-item > * { pointer-events: none; }
.imprint img { max-width: 65px; max-height: 29px; object-fit: contain; }
.imprint span { max-width: 100%; overflow-wrap: anywhere; font-size: 18px; line-height: 1.25; font-weight: 400; }
#custom-text, .imprint span { font-family: "ChenYuluoyan", "Microsoft JhengHei", sans-serif; }
.custom-figure figcaption { color: #2d3423; font-size: 12px; text-align: center; }
.imprint-controls { display: grid; justify-items: center; gap: 4px; margin-top: 5px; }
.imprint-controls button { min-height: 32px; }
.specs { margin: 0; max-width: 460px; }
.specs > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line); font-size: 14px; }
dt { font-weight: 800; }
dd { margin: 0; color: var(--muted); }
.quote-form { display: grid; gap: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: clamp(14px, 3vw, 28px); }
.quote-form label { margin-bottom: 4px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.summary-field textarea { background: #f5efe1; }
.summary-field .help { margin-top: 5px; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.message { font-size: 13px; color: #75301f; }
.message:empty { display: none; }
.gallery { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-bottom: 58px; }
.gallery img { width: 100%; height: clamp(110px, 25vw, 290px); object-fit: cover; border-radius: 4px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 6px; }
.footer-inner { flex-wrap: wrap; justify-content: space-between; }
.footer-inner > div { display: flex; flex-wrap: wrap; gap: 17px; font-size: 14px; font-weight: 700; }
.footer-inner .help:empty { display: none; }
@media (max-width: 900px) {
  .wrap { width: min(100% - 44px, 1240px); }
  .theme-card { grid-template-columns: 44px minmax(0, 1fr); padding-inline: 9px; gap: 8px; }
  .theme-card img { width: 44px; height: 62px; }
  .theme-card span { font-size: 14px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 63px; }
  .brand img { width: 104px; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-block: 36px 45px; gap: 24px; }
  .hero h1 { font-size: clamp(54px, 13vw, 72px); }
  .hero h1 br { display: none; }
  .hero-actions { margin-top: 20px; }
  .section-pad { padding-block: 50px; }
  .theme-layout, .custom-layout, .quote-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .theme-options { gap: 7px; }
  .theme-card { min-height: 74px; }
  .theme-card img { height: 52px; }
  .tear-controls { padding: 16px; }
  .book-stage { grid-template-columns: minmax(0, 182px) auto; min-height: 290px; padding: 26px 12px; }
  .tear-actions .button { padding-inline: 10px; }
  .format-options { grid-template-columns: 1fr; gap: 10px; }
  .format-card { display: grid; grid-template-columns: 40% minmax(0, 1fr); }
  .format-card img { height: 100%; min-height: 134px; }
  .format-details { padding: 12px; }
  .format-details strong { font-size: 18px; }
  .custom-fields { max-width: none; }
  .gallery { margin-bottom: 35px; }
  .footer-inner { padding-block: 13px; gap: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
.button:disabled { opacity: .55; }
