:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  color: #483745;
  background: #fffcfe;
  --muted: #735e6e;
  --line: #eedde7;
  --rose: #f8e6f0;
  --accent: #80496c;
  --accent-hover: #6d3b5b;
  --shadow: 0 10px 34px #6a3a5810;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body { min-width: 280px; margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 3px solid #865878; outline-offset: 4px; }

.site-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid #f2e4ec;
  background: #fffdfefa;
}

.site-bar {
  display: flex;
  max-width: 1248px;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-inline: auto;
  padding: 10px clamp(18px, 5vw, 60px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #614b60;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
}

.wordmark img {
  width: 40px;
  height: 40px;
  padding: 5px;
  border-radius: 50%;
  background: #f8e8f0;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: transparent;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button-outline {
  border-color: #e9d4e1;
  background: #ffffffc7;
  color: #72506a;
}

.button-outline:hover { background: #faedf5; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }

.gallery-view {
  position: relative;
  min-height: calc(100vh - 73px);
  isolation: isolate;
  overflow: clip;
}

.gallery-view::before {
  position: absolute;
  z-index: -2;
  inset: 0 0 auto;
  height: 645px;
  background:
    radial-gradient(ellipse 26% 33% at 49% 25%, #f7c9de7d, transparent 100%),
    radial-gradient(ellipse 27% 20% at 20% 15%, #f4d6e6a1, transparent 100%),
    radial-gradient(ellipse 21% 30% at 86% 28%, #f7d6e5aa, transparent 100%),
    radial-gradient(ellipse 22% 22% at 23% 61%, #e2edf386, transparent 100%),
    radial-gradient(ellipse 23% 23% at 81% 61%, #eee2f3a0, transparent 100%),
    #fffbfd;
  mask-image: linear-gradient(#000 60%, transparent);
  content: "";
}

.hero {
  position: relative;
  display: grid;
  min-height: 304px;
  place-items: center;
  padding: 52px 24px 51px;
  text-align: center;
}

.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  max-width: 1220px;
  margin-inline: auto;
  pointer-events: none;
}

.hero-art::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #9ec9d6 1px, transparent 1.6px) 0 0 / 14px 14px;
  mask-image: radial-gradient(ellipse 20% 42% at 10% 34%, #000 3%, transparent),
    radial-gradient(ellipse 19% 43% at 90% 65%, #000 3%, transparent);
  opacity: .48;
  content: "";
}

.hero-art::after {
  position: absolute;
  inset: 31px 29% 25px;
  border-radius: 48% 52% 45% 55%;
  background: radial-gradient(ellipse at 50% 50%, transparent 34%, #f6c2d668 50%, transparent 69%);
  filter: blur(12px);
  opacity: .7;
  content: "";
}

.doodle {
  position: absolute;
  z-index: 1;
  display: block;
  aspect-ratio: 1;
  background: center / contain no-repeat;
}

.bow { background-image: url("assets/bow.webp"); }
.star { background-image: url("assets/sparkle.webp"); }
.flower { background-image: url("assets/flower.webp"); }
.bow-left { top: 17%; left: 13%; width: 71px; opacity: .77; transform: rotate(-15deg); }
.bow-right { right: 12%; bottom: 12%; width: 62px; opacity: .7; transform: rotate(17deg); }
.star-left { bottom: 18%; left: 23%; width: 34px; opacity: .8; transform: rotate(-9deg); }
.star-right { top: 13%; right: 27%; width: 22px; opacity: .71; transform: rotate(12deg); }
.flower-left { bottom: 10%; left: 5%; width: 44px; opacity: .52; transform: rotate(-15deg); }
.flower-right { top: 11%; right: 7%; width: 53px; opacity: .66; transform: rotate(14deg); }

.hero-copy { position: relative; }
.hero h1 {
  color: #67465e;
  font-size: clamp(2.15rem, 5.6vw, 4.25rem);
  font-weight: 750;
  letter-spacing: .11em;
  line-height: 1.25;
  padding-inline-start: .11em;
}

.hero p {
  margin-top: 19px;
  color: #755e6e;
  font-size: clamp(.86rem, 2.4vw, 1rem);
  letter-spacing: .1em;
  line-height: 1.65;
}

.gallery-content {
  max-width: 1160px;
  margin-inline: auto;
  padding: 3px clamp(18px, 4.2vw, 48px) 76px;
}

.gallery-grid, .work-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(11px, 2.1vw, 24px);
}

.gallery-grid > li { min-width: 0; }

.work-card {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  margin: 0;
  padding: clamp(6px, 1vw, 10px);
  border: 1px solid var(--line);
  border-radius: clamp(16px, 2vw, 24px);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .17s ease, box-shadow .17s ease, transform .17s ease;
}

.work-card:active { border-color: #dab7cb; background: #fff7fb; }

@media (hover: hover) {
  .work-card:hover {
    transform: translateY(-4px);
    border-color: #dab7cb;
    box-shadow: 0 16px 36px #7b456920;
  }
}

.work-image {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: clamp(11px, 1.5vw, 17px);
  background: #fbf7fa;
}

.work-image img { width: 100%; height: 100%; object-fit: contain; }

.price {
  color: #694960;
  font-family: "Quicksand", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.work-card > .price {
  width: 100%;
  padding: 13px 4px 9px;
  font-size: clamp(.92rem, 2vw, 1.15rem);
  letter-spacing: .035em;
  overflow-wrap: anywhere;
}

.page-message { padding: 20px; color: var(--muted); text-align: center; }

.management {
  max-width: 890px;
  min-height: calc(100vh - 73px);
  margin-inline: auto;
  padding: 46px clamp(18px, 4vw, 38px) 64px;
}

.management-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.management h1 { font-size: clamp(1.65rem, 4vw, 2.1rem); }
.management-heading p { margin-top: 8px; color: var(--muted); font-size: .94rem; }
.management-feedback { margin-bottom: 13px; color: var(--muted); font-size: .92rem; }
.management-feedback:empty { display: none; }
.line-settings {
  margin-bottom: 13px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}
.line-settings summary { cursor: pointer; font-size: .93rem; font-weight: 700; }
.line-settings form { margin-top: 13px; }
.line-feedback { margin-top: 9px; color: var(--muted); font-size: .9rem; }
.line-feedback:empty { display: none; }
.publish-choices { min-width: 0; padding: 0; margin: 9px 0 12px; border: 0; }
.publish-list { display: grid; gap: 3px; }
.publish-choice { display: flex; align-items: baseline; gap: 7px; padding: 4px 0; overflow-wrap: anywhere; }
.publish-choice input { flex: none; accent-color: var(--accent); }
.work-list { display: grid; gap: 10px; }

.work-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.work-thumbnail {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 11px;
  background: #fbf7fa;
  object-fit: contain;
}

.work-summary { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.work-summary h2 { margin-bottom: 4px; font-size: 1rem; }
.work-summary .price { font-size: .88rem; }
.row-actions { display: flex; gap: 4px; }
.delete-work { color: #994b68; }
.delete-work:hover { background: #fbeef3; }

.dialog {
  position: fixed;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  color: #483745;
  box-shadow: 0 24px 80px #4f334b2c;
}

.dialog::backdrop { background: #49334863; }

.close-button {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #72506a;
  font-size: 1.55rem;
  line-height: 1;
}

.close-button:hover { background: #fcf0f6; }
.details-dialog { width: min(480px, calc(100% - 32px)); }

.detail-image {
  display: grid;
  min-width: 0;
  place-items: center;
  background: #fbf7fa;
}

.detail-image img { width: 100%; max-height: min(53dvh, 580px); object-fit: contain; }
.detail-copy { padding: 23px 25px 27px; min-width: 0; overflow-wrap: anywhere; }
.detail-copy h2 { font-size: clamp(1.32rem, 4vw, 1.7rem); }
.detail-copy .price { margin-top: 9px; font-size: 1.1rem; }
.description { margin-top: 14px; color: var(--muted); line-height: 1.75; white-space: pre-wrap; }
.description:empty { display: none; }
.order-button { margin-top: 18px; min-width: 105px; }

.order-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 24px clamp(17px, 4vw, 25px);
}

.order-dialog h2 { margin-bottom: 13px; font-size: 1.4rem; }
.order-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffbfd;
}
.order-preview img { flex: none; border-radius: 8px; object-fit: contain; }
.order-preview > div { min-width: 0; overflow-wrap: anywhere; }
.order-name { margin-bottom: 4px; font-weight: 700; }
.order-note { margin: 0 0 8px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.order-handoff { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.order-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-dialog { width: min(550px, calc(100% - 32px)); }
.edit-dialog form { padding: 24px clamp(18px, 4vw, 29px); }
.edit-dialog h2 { margin: 1px 44px 19px 0; font-size: 1.4rem; }
.form-field { display: grid; gap: 6px; margin-bottom: 13px; }
.form-field label { font-size: .92rem; font-weight: 700; }

.form-field input:not([type="file"]), .form-field textarea, .file-panel {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffbfd;
  color: inherit;
}

.form-field textarea { resize: vertical; }
.file-panel { display: grid; gap: 8px; }
.file-panel input { max-width: 100%; font-size: .88rem; }

.file-panel input::file-selector-button {
  margin-right: 8px;
  padding: 6px 12px;
  border: 0;
  border-radius: 20px;
  background: var(--rose);
  color: #67465e;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.image-preview { width: 100%; max-height: 158px; border-radius: 6px; object-fit: contain; }
.field-note { color: var(--muted); font-size: .8rem; }
.form-error { margin: 10px 0; color: #923b58; font-size: .92rem; }
.form-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }

@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .details-dialog { width: min(790px, calc(100% - 48px)); }
  .details-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .detail-copy { align-self: center; padding: 50px 28px 32px; }
  .detail-image img { max-height: min(76dvh, 640px); }
}

@media (min-width: 1050px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery-grid:has(> :nth-child(3):last-child) {
    max-width: 906px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-inline: auto;
  }
}

@media (max-width: 540px) {
  .site-bar { min-height: 65px; }
  .wordmark { gap: 7px; font-size: .97rem; }
  .wordmark img { width: 34px; height: 34px; }
  .site-bar .button { min-height: 40px; padding-inline: 13px; }
  .gallery-view { min-height: calc(100vh - 66px); }
  .hero { min-height: 229px; padding-block: 39px; }
  .hero p { margin-top: 13px; }
  .hero-art::after { inset: 17px 7% 20px; }
  .bow-left { top: 10%; left: 10%; width: 44px; }
  .bow-right { right: 8%; bottom: 9%; width: 40px; }
  .star-left { left: 14%; bottom: 10%; width: 24px; }
  .star-right { top: 18%; right: 24%; width: 17px; }
  .flower-left { display: none; }
  .flower-right { width: 33px; }
  .management { padding-top: 30px; }
  .work-row { flex-wrap: wrap; gap: 9px 12px; }
  .work-thumbnail { width: 58px; height: 58px; }
  .row-actions { margin-left: auto; }
  .row-actions .button { padding-inline: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
