:root {
  --accent: #b08d57;
  --accent-deep: #8a6432;
  --accent-soft: #ead8b6;
  --ink: #3a2e22;
  --muted: #7c6b58;
  --radius: 16px;
  --heart-w: 380px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* 後台預覽時不顯示捲軸，畫面更像手機 */
html.is-preview, html.is-preview body { scrollbar-width: none; }
html.is-preview ::-webkit-scrollbar { width: 0; height: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(120% 55% at 50% -6%, #fffaf1 0%, rgba(255, 250, 241, 0) 58%),
    radial-gradient(80% 45% at 102% 6%, #f9edd8 0%, rgba(249, 237, 216, 0) 62%),
    radial-gradient(85% 50% at -6% 46%, #fcf2e1 0%, rgba(252, 242, 225, 0) 68%),
    linear-gradient(180deg, #fbf4e8 0%, #f7eeda 46%, #f2e5d0 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(125% 85% at 50% 38%, rgba(255, 255, 255, 0) 52%, rgba(146, 110, 56, .12) 100%);
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(16px, 4.5vw, 32px) clamp(16px, 5vw, 30px)
           calc(38px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---------- 愛心主視覺 ---------- */
.hero {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.heart-card {
  position: relative;
  width: min(100%, var(--heart-w));
  aspect-ratio: 400 / 360;
  filter: drop-shadow(0 20px 34px rgba(138, 100, 50, .22));
  animation: heart-in .9s cubic-bezier(.22, .68, .35, 1) both;
}

.heart-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- 其他主視覺形狀（圓角／圓形／無框） ---------- */
.plain-hero { width: 100%; }

.plain-ring {
  position: relative;
  padding: 10px;
  border-radius: 26px;
  box-shadow: 0 20px 36px rgba(138, 100, 50, .22);
}

.plain-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 6px;
  background: linear-gradient(135deg, #f6e5b8 0%, #cfa761 28%, #8f6a2f 52%, #e0c088 76%, #a97f3d 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.plain-ring img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  position: relative;
  z-index: 1;
}

.heart-card.frame-circle,
.heart-card.frame-rounded,
.heart-card.frame-none {
  aspect-ratio: auto;
  filter: none;
}

.heart-card.frame-none { width: min(100%, 460px); }

.frame-circle .plain-ring,
.frame-circle .plain-ring img { border-radius: 50%; }

.frame-circle .plain-ring {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.frame-circle .plain-ring img { width: 100%; height: 100%; object-fit: contain; }

.frame-none .plain-ring { padding: 0; border-radius: 0; box-shadow: none; }

.frame-none .plain-ring::after { display: none; }

.frame-none .plain-ring img { border-radius: 0; }

.heart-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 15% 13% 20%;
  transform: translateY(3%);
  text-align: center;
}

.seal {
  width: clamp(44px, 12vw, 56px);
  height: clamp(44px, 12vw, 56px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(176, 141, 87, .55);
  background: radial-gradient(circle at 34% 28%, #fffdf8 0%, #f6ead3 62%, #e8d5b0 100%);
  box-shadow: 0 3px 10px rgba(138, 100, 50, .18), inset 0 1px 0 #fff;
  overflow: hidden;
  margin-bottom: 2px;
}

.seal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seal span {
  font-family: 'Cormorant Garamond', 'Noto Serif TC', 'Songti TC', Georgia, serif;
  font-size: clamp(22px, 6vw, 27px);
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(170deg, #e9cd92 0%, #a8803f 55%, #d9b878 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand {
  margin: 0;
  font-family: 'Cormorant Garamond', 'Playfair Display', 'Noto Serif TC', 'Songti TC', Georgia, serif;
  font-size: clamp(27px, 8.8vw, 37px);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.05;
  background: linear-gradient(178deg, #fbf0cf 0%, #ddba77 26%, #a67c37 54%, #e8cd94 74%, #b98f49 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .85)) drop-shadow(0 2px 2px rgba(110, 76, 24, .32));
  animation: sheen 7s ease-in-out infinite;
  background-size: 100% 220%;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  font-family: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  font-size: clamp(12.5px, 3.5vw, 15px);
  letter-spacing: .3em;
  color: #6f532a;
  text-indent: .3em;
}

.brand-sub .rule {
  width: clamp(22px, 7vw, 34px);
  height: 1px;
  background: linear-gradient(90deg, rgba(176, 141, 87, 0), rgba(176, 141, 87, .9));
}

.brand-sub .rule:last-child {
  background: linear-gradient(90deg, rgba(176, 141, 87, .9), rgba(176, 141, 87, 0));
}

.brand-cart {
  color: #9a7438;
  margin-top: 4px;
}

.brand-cart svg {
  width: clamp(20px, 6vw, 25px);
  height: clamp(20px, 6vw, 25px);
}

.heart-card.has-photo .heart-inner::before {
  content: '';
  position: absolute;
  inset: 10% 6% 12%;
  border-radius: 50%;
  background: radial-gradient(62% 54% at 50% 54%, rgba(36, 24, 10, .46) 0%, rgba(36, 24, 10, .24) 46%, rgba(36, 24, 10, 0) 76%);
  pointer-events: none;
  z-index: 0;
}

.heart-inner > * { position: relative; z-index: 1; }

.heart-card.has-photo .brand {
  background-image: linear-gradient(180deg, #fffaf0 0%, #f7e4bb 38%, #e0bd80 66%, #fdf3dc 100%);
  filter: drop-shadow(0 2px 10px rgba(35, 22, 8, .6)) drop-shadow(0 1px 0 rgba(255, 255, 255, .2));
}

.heart-card.has-photo .brand-sub,
.heart-card.has-photo .brand-cart,
.heart-card.has-photo .seal span {
  filter: drop-shadow(0 2px 8px rgba(35, 22, 8, .7));
}

.heart-card.has-photo .brand-sub { color: #fff7e6; }
.heart-card.has-photo .brand-cart { color: #fff3d9; }

.heart-card.has-photo .seal {
  background: #fffaf1;
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 6px 18px rgba(30, 18, 6, .45), inset 0 1px 0 #fff;
}

/* ---------- 文字 ---------- */
.tagline {
  margin: 22px 0 0;
  text-align: center;
  font-size: clamp(13.5px, 3.7vw, 15px);
  letter-spacing: .06em;
  color: #6b5844;
  animation: rise .7s .12s both;
}

.highlights {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: center;
  font-size: clamp(13px, 3.6vw, 14.5px);
  line-height: 1.6;
  letter-spacing: .02em;
  color: #75634e;
  animation: rise .7s .2s both;
}

.promo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(176, 141, 87, .32);
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 250, 240, .55));
  box-shadow: 0 6px 16px rgba(138, 100, 50, .07), inset 0 1px 0 rgba(255, 255, 255, .95);
  font-size: clamp(13px, 3.6vw, 14.5px);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: .01em;
  color: #7c571f;
  text-align: center;
  animation: rise .7s .26s both;
}

.promo-icon {
  font-size: 1.15em;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(120, 80, 20, .25));
}

/* ---------- 連結按鈕 ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(176, 141, 87, .42);
  background: linear-gradient(180deg, #fffefb 0%, #fdf6ea 100%);
  box-shadow: 0 8px 20px rgba(120, 85, 35, .12), inset 0 1px 0 #fff;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  animation: rise .55s both;
  animation-delay: calc(.32s + var(--i, 0) * .055s);
}

.link:hover {
  transform: translateY(-1px);
  border-color: rgba(176, 141, 87, .58);
  background: linear-gradient(180deg, #fffdf8 0%, #fdf7ec 100%);
  box-shadow: 0 10px 24px rgba(139, 104, 53, .16), inset 0 1px 0 #fff;
}

.link:active { transform: scale(.988); }

.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.link-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #6b5228;
  background: radial-gradient(circle at 34% 28%, #fffdf9 0%, #f5e9d4 62%, #eddfc4 100%);
  border: 1px solid rgba(176, 141, 87, .38);
  box-shadow: inset 0 1px 0 #fff;
}

.link-icon svg {
  width: 18px;
  height: 18px;
}

.link-label {
  font-size: clamp(13.8px, 3.8vw, 15px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .015em;
  text-align: center;
  overflow-wrap: anywhere;
}

.link-arrow {
  justify-self: end;
  display: grid;
  place-items: center;
  color: var(--accent);
  opacity: .5;
  transition: opacity .18s ease, transform .18s ease;
}

.link-arrow svg {
  width: 16px;
  height: 16px;
}

.link:hover .link-arrow {
  opacity: .95;
  transform: translateX(2px);
}

.empty {
  margin: 26px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.footer {
  margin: 30px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: .03em;
  color: #9c8b76;
}

/* ---------- 黑金主題（深棕底，不用純黑） ---------- */
body.theme-dark {
  color: #efe3cc;
  background:
    radial-gradient(60% 42% at 50% 0%, rgba(120, 86, 42, .55) 0%, rgba(120, 86, 42, 0) 62%),
    radial-gradient(45% 34% at 6% 16%, rgba(86, 60, 30, .38) 0%, rgba(86, 60, 30, 0) 64%),
    radial-gradient(50% 36% at 97% 10%, rgba(96, 66, 32, .32) 0%, rgba(96, 66, 32, 0) 62%),
    radial-gradient(75% 45% at 50% 104%, rgba(74, 52, 26, .45) 0%, rgba(74, 52, 26, 0) 70%),
    linear-gradient(180deg, #1a130c 0%, #150f09 42%, #100b07 100%);
}

body.theme-dark::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.theme-dark::after {
  background:
    radial-gradient(110% 72% at 50% 30%, rgba(201, 163, 95, .12) 0%, rgba(0, 0, 0, 0) 60%),
    radial-gradient(140% 90% at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .42) 100%);
}

.theme-dark .hero { position: relative; }

.theme-dark .hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 163, 95, .22) 0%, rgba(201, 163, 95, 0) 68%);
  filter: blur(14px);
  pointer-events: none;
}

.theme-dark .tagline { color: #d8c5a3; }
.theme-dark .highlights { color: #b3a080; }
.theme-dark .footer { color: #94805f; }

.theme-dark .promo {
  background: linear-gradient(180deg, rgba(201, 163, 95, .18) 0%, rgba(120, 86, 42, .12) 100%);
  border-color: rgba(201, 163, 95, .42);
  color: #f3dcaa;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.theme-dark .link {
  background: linear-gradient(180deg, rgba(96, 71, 40, .55) 0%, rgba(42, 30, 18, .82) 100%);
  border-color: rgba(214, 178, 112, .42);
  color: #f8f0e1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 235, 190, .13);
}

.theme-dark .link:hover {
  background: linear-gradient(180deg, rgba(120, 90, 50, .68) 0%, rgba(54, 39, 22, .86) 100%);
  border-color: rgba(236, 205, 145, .8);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .42), 0 0 26px rgba(201, 163, 95, .16), inset 0 1px 0 rgba(255, 240, 205, .16);
}

.theme-dark .link-icon {
  color: #e9cf95;
  background: radial-gradient(circle at 34% 28%, rgba(255, 240, 210, .2) 0%, rgba(96, 70, 32, .35) 100%);
  border-color: rgba(201, 163, 95, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.theme-dark .link-label { color: #f5ecda; }
.theme-dark .link-arrow { color: #d9b878; opacity: .7; }

.theme-dark .brand-sub { color: #d9bf92; }
.theme-dark .brand-cart { color: #c9a35f; }

.theme-dark .seal {
  background: radial-gradient(circle at 34% 28%, #2a2115 0%, #17110a 70%);
  border-color: rgba(201, 163, 95, .5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* ---------- 動畫 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heart-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@keyframes sheen {
  0%, 100% { background-position: 50% 0%; }
  50% { background-position: 50% 100%; }
}

@media (min-width: 720px) {
  :root { --heart-w: 400px; }
  .page { max-width: 600px; padding-top: 40px; }
  .link { min-height: 64px; padding: 12px 18px; }
}

@media (min-width: 900px) {
  .page {
    min-height: 100svh;
    justify-content: safe center;
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

@media (max-width: 360px) {
  .link { grid-template-columns: 32px minmax(0, 1fr) 20px; padding: 10px 12px; gap: 8px; }
  .link-icon { width: 32px; height: 32px; }
  .link-icon svg { width: 16px; height: 16px; }
  .link-label { font-size: 13px; }
}

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