/* 潮信 Tidelight demo — phone 360×760, design px */

.device-screen[data-demo="tidelight"] {
  --status: #2e3a4a;
  --home: rgba(46, 58, 74, 0.35);
}
.device-screen[data-demo="tidelight"]:has(> .dm-tidelight[data-tone="light"]) {
  --status: #fff;
  --home: rgba(255, 255, 255, 0.55);
}
.device-screen[data-demo="tidelight"] .demo-pointer.tl-hold i {
  transform: scale(0.74);
  background: rgba(255, 255, 255, 0.62);
  transition: transform 0.2s, background 0.2s;
}

.dm-tidelight {
  --paper: #f7f0e1;
  --paper-edge: #e4d6ba;
  --paper-shade: #ede3ce;
  --ink: #2e3a4a;
  --ink-soft: #64707f;
  --gold: #e9b949;
  --warm: #ffd98a;
  --sea-blue: #3f7cac;
  --rose: #c2566b;
  --leaf: #5e9c76;
  --sheet: #fffbf2;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #12294a;
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
}
.dm-tidelight p,
.dm-tidelight b,
.dm-tidelight em {
  margin: 0;
  font-style: normal;
}
.dm-tidelight img {
  display: block;
  max-width: none;
  user-select: none;
}
.dm-tidelight .tl-i {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dm-tidelight .tl-i.is-dots { stroke-width: 2.4; }

.dm-tidelight.tl-reset,
.dm-tidelight.tl-reset *,
.dm-tidelight.tl-reset *::before,
.dm-tidelight.tl-reset *::after {
  transition: none !important;
  animation: none !important;
}

/* ---------- screens ---------- */
.dm-tidelight .tl-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s, transform 0.45s ease;
}
.dm-tidelight[data-screen="title"] .tl-title,
.dm-tidelight[data-screen="beach"] .tl-beach,
.dm-tidelight[data-screen="room"] .tl-room,
.dm-tidelight[data-screen="letter"] .tl-letter,
.dm-tidelight[data-screen="compose"] .tl-compose,
.dm-tidelight[data-screen="draw"] .tl-draw {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.45s ease, visibility 0s, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dm-tidelight .tl-page {
  padding-top: 48px;
  background: var(--paper);
  transform: scale(0.965);
}
.dm-tidelight .tl-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- shared pieces ---------- */
.dm-tidelight .tl-paper {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.dm-tidelight .tl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  background: rgba(247, 240, 225, 0.88);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.dm-tidelight .tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border: 1.4px solid var(--ink);
  border-radius: 24px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.dm-tidelight .tl-btn .tl-i { width: 18px; height: 18px; }
.dm-tidelight .tl-btn--fill { background: var(--ink); color: var(--paper); }
.dm-tidelight .tl-btn--wide { display: flex; width: 100%; }
.dm-tidelight .tl-note { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.dm-tidelight .tl-center { text-align: center; }
.dm-tidelight .tl-appbar {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
}
.dm-tidelight .tl-appbar > b {
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}
.dm-tidelight .tl-appbar > em {
  margin-left: auto;
  color: var(--sea-blue);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- 1. onboarding over the title art ---------- */
.dm-tidelight .tl-title .tl-cover,
.dm-tidelight .tl-title-glow,
.dm-tidelight .tl-title-beam,
.dm-tidelight .tl-sparkles,
.dm-tidelight .tl-shimmer {
  transform-origin: 151px 330px;
  transition: transform 1.6s cubic-bezier(0.3, 0.1, 0.2, 1);
}
/* 這兩個是放在燈室上的 0×0 錨點，縮放中心要換算成同一個畫面座標 */
.dm-tidelight .tl-title-glow,
.dm-tidelight .tl-title-beam { transform-origin: 0 30px; }
.dm-tidelight .tl-title.is-zoom .tl-cover,
.dm-tidelight .tl-title.is-zoom .tl-title-glow,
.dm-tidelight .tl-title.is-zoom .tl-title-beam,
.dm-tidelight .tl-title.is-zoom .tl-sparkles,
.dm-tidelight .tl-title.is-zoom .tl-shimmer {
  transform: scale(1.12);
}
.dm-tidelight .tl-sparkles { position: absolute; inset: 0; }
.dm-tidelight .tl-sparkles i {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background:
    linear-gradient(90deg, transparent 40%, rgba(255, 247, 222, 0.95) 50%, transparent 60%),
    linear-gradient(0deg, transparent 40%, rgba(255, 247, 222, 0.95) 50%, transparent 60%);
  border-radius: 50%;
  opacity: 0.2;
  transform: scale(var(--z, 1));
  animation: tl-sparkle var(--d, 3s) ease-in-out var(--o, 0s) infinite;
}
@keyframes tl-sparkle {
  0%, 100% { opacity: 0.15; transform: scale(calc(var(--z, 1) * 0.6)); }
  50% { opacity: 1; transform: scale(var(--z, 1)); }
}
.dm-tidelight .tl-title-glow {
  position: absolute;
  left: 151px;
  top: 300px;
  width: 0;
  height: 0;
}
.dm-tidelight .tl-title-glow::before {
  content: "";
  position: absolute;
  left: -78px;
  top: -78px;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 238, 186, 0.75) 0%, rgba(255, 220, 140, 0.32) 28%, rgba(255, 210, 120, 0) 66%);
  mix-blend-mode: screen;
  animation: tl-glow 3.4s ease-in-out infinite;
}
@keyframes tl-glow {
  0%, 100% { opacity: 0.65; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}
.dm-tidelight .tl-title-beam {
  position: absolute;
  left: 151px;
  top: 300px;
  width: 0;
  height: 0;
}
.dm-tidelight .tl-title-beam i {
  position: absolute;
  left: -10px;
  top: -56px;
  width: 290px;
  height: 112px;
  background: no-repeat 0 0 / 100% 100%;
  mix-blend-mode: screen;
  transform-origin: 10px 50%;
  animation: tl-sway 7s ease-in-out infinite alternate;
}
@keyframes tl-sway {
  from { transform: rotate(-9deg); opacity: 0.55; }
  50% { opacity: 1; }
  to { transform: rotate(17deg); opacity: 0.6; }
}
.dm-tidelight .tl-shimmer { position: absolute; inset: 0; }
.dm-tidelight .tl-shimmer i {
  position: absolute;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 240, 200, 0.85);
  filter: blur(0.6px);
  opacity: 0;
  animation: tl-shimmer 3.2s ease-in-out infinite;
}
.dm-tidelight .tl-shimmer i:nth-child(1) { left: 150px; top: 470px; width: 34px; animation-delay: 0s; }
.dm-tidelight .tl-shimmer i:nth-child(2) { left: 166px; top: 486px; width: 24px; animation-delay: 0.8s; }
.dm-tidelight .tl-shimmer i:nth-child(3) { left: 146px; top: 503px; width: 40px; animation-delay: 1.6s; }
.dm-tidelight .tl-shimmer i:nth-child(4) { left: 170px; top: 522px; width: 20px; animation-delay: 2.3s; }
@keyframes tl-shimmer {
  0%, 100% { opacity: 0; transform: translateX(-4px); }
  45% { opacity: 0.9; }
  70% { opacity: 0.2; transform: translateX(6px); }
}
.dm-tidelight .tl-title-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 23, 48, 0.13) 0%, rgba(11, 23, 48, 0.8) 100%);
}
.dm-tidelight .tl-title-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 108px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--paper);
  text-shadow: 0 2px 12px rgba(11, 23, 48, 0.45);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.dm-tidelight .tl-title.is-in .tl-title-head { opacity: 1; transform: none; }
.dm-tidelight .tl-title.is-zoom .tl-title-head { opacity: 0; transform: translateY(-10px); transition-duration: 0.5s; }
.dm-tidelight .tl-title-head b {
  padding-left: 4px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 1.2;
}
.dm-tidelight .tl-title-head span { font-size: 15px; color: rgba(247, 240, 225, 0.85); }

.dm-tidelight .tl-story {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 52px;
  padding: 18px 18px 16px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dm-tidelight .tl-story.is-in { opacity: 1; transform: none; }
.dm-tidelight .tl-steps { position: relative; height: 116px; }
.dm-tidelight .tl-step {
  position: absolute;
  inset: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.dm-tidelight .tl-step.is-on { opacity: 1; }
.dm-tidelight .tl-story-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.dm-tidelight .tl-dots { display: flex; gap: 7px; }
.dm-tidelight .tl-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-edge);
  transition: background 0.3s;
}
.dm-tidelight .tl-dots i.is-on { background: var(--ink); }
.dm-tidelight .tl-story-btn { min-width: 96px; padding: 0 24px; }

/* ---------- 2. the beach ---------- */
.dm-tidelight .tl-beach { background: #9cc3d2; }
.dm-tidelight .tl-beach[data-sky="dawn"] {
  --sky-top: #a9cbe0;
  --sky-bottom: #f6e4d2;
  --sea-far: #bfdae0;
  --sea: #9cc3d2;
  --cloud: rgba(255, 255, 255, 0.45);
}
.dm-tidelight .tl-beach[data-sky="day"] {
  --sky-top: #7dbbe4;
  --sky-bottom: #dff1f4;
  --sea-far: #92c9da;
  --sea: #5ba6c4;
  --cloud: rgba(255, 255, 255, 0.5);
}
.dm-tidelight .tl-beach[data-sky="night"] {
  --sky-top: #0b1730;
  --sky-bottom: #213a62;
  --sea-far: #1c3a60;
  --sea: #12294a;
  --cloud: rgba(255, 255, 255, 0.075);
}
.dm-tidelight .tl-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 986px;
  height: 760px;
  transform: translateX(var(--cam, -476px));
}
.dm-tidelight .tl-world.is-pan { transition: transform 3.4s cubic-bezier(0.25, 0.1, 0.2, 1); }
.dm-tidelight .tl-sky {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 358px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}
.dm-tidelight .tl-sea {
  position: absolute;
  left: 0;
  top: 357px;
  width: 100%;
  height: 403px;
  background: linear-gradient(180deg, var(--sea-far) 0, var(--sea) 258px);
}
.dm-tidelight .tl-stars { position: absolute; inset: 0; display: none; }
.dm-tidelight .tl-beach[data-sky="night"] .tl-stars { display: block; }
.dm-tidelight .tl-stars i {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  animation: tl-twinkle 4s ease-in-out infinite alternate;
}
.dm-tidelight .tl-stars i:nth-child(2) { animation-duration: 6s; animation-delay: -2s; }
.dm-tidelight .tl-stars i:nth-child(3) { animation-duration: 3s; animation-delay: -1s; }
@keyframes tl-twinkle {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
.dm-tidelight .tl-moon {
  position: absolute;
  left: 459px;
  top: 184px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 68%);
  display: none;
}
.dm-tidelight .tl-moon::after {
  content: "";
  position: absolute;
  left: 38px;
  top: 38px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f4f1de;
  -webkit-mask: radial-gradient(circle at 74% 37%, transparent 15.5px, #000 16.5px);
  mask: radial-gradient(circle at 74% 37%, transparent 15.5px, #000 16.5px);
}
.dm-tidelight .tl-beach[data-sky="night"] .tl-moon { display: block; }

.dm-tidelight .tl-clouds i {
  position: absolute;
  width: 0;
  height: 0;
  animation: tl-drift 12s linear infinite;
}
.dm-tidelight .tl-clouds i::before,
.dm-tidelight .tl-clouds i::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--cloud);
  filter: blur(8px);
}
.dm-tidelight .tl-clouds i::before { left: -76px; top: -13px; width: 152px; height: 27px; }
.dm-tidelight .tl-clouds i::after { left: -7.5px; top: -24px; width: 91px; height: 27px; }
.dm-tidelight .tl-clouds i:nth-child(1) { left: 99px; top: 122px; }
.dm-tidelight .tl-clouds i:nth-child(2) { left: 473px; top: 76px; transform: scale(1.3); }
.dm-tidelight .tl-clouds i:nth-child(3) { left: 887px; top: 152px; transform: scale(0.9); }
.dm-tidelight .tl-clouds i:nth-child(4) { left: 651px; top: 205px; transform: scale(0.7); }
@keyframes tl-drift { to { translate: 20px 0; } }

.dm-tidelight .tl-hlamps { display: none; }
.dm-tidelight .tl-beach[data-sky="night"] .tl-hlamps { display: block; }
.dm-tidelight .tl-hlamps i {
  position: absolute;
  top: 354px;
  width: 0;
  height: 0;
}
.dm-tidelight .tl-hlamps i::before {
  content: "";
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 138, 0.6), rgba(255, 217, 138, 0) 70%);
  animation: tl-pulse 3s ease-in-out infinite alternate;
  animation-delay: inherit;
}
.dm-tidelight .tl-hlamps i::after {
  content: "";
  position: absolute;
  left: -2px;
  top: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe3a3;
}
.dm-tidelight .tl-hlamps i:nth-child(1) { left: 488px; animation-delay: -0.4s; }
.dm-tidelight .tl-hlamps i:nth-child(2) { left: 527px; animation-delay: -1.9s; }
.dm-tidelight .tl-hlamps i:nth-child(3) { left: 571px; animation-delay: -0.9s; }
.dm-tidelight .tl-hlamps i:nth-child(4) { left: 608px; animation-delay: -2.6s; }
.dm-tidelight .tl-hlamps i:nth-child(5) { left: 724px; animation-delay: -1.3s; }
.dm-tidelight .tl-hlamps i:nth-child(6) { left: 776px; animation-delay: -0.1s; }
.dm-tidelight .tl-hlamps i:nth-child(7) { left: 812px; animation-delay: -2.2s; }
@keyframes tl-pulse {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.15); }
}

.dm-tidelight .tl-swell { position: absolute; inset: 0; overflow: hidden; }
.dm-tidelight .tl-swell i {
  position: absolute;
  background-repeat: repeat-x;
  animation: tl-swell var(--dur, 14s) linear infinite;
}
.dm-tidelight .tl-swell i.is-rev { animation-name: tl-swell-rev; }
@keyframes tl-swell { from { transform: translateX(0); } to { transform: translateX(var(--lam)); } }
@keyframes tl-swell-rev { from { transform: translateX(var(--lam)); } to { transform: translateX(0); } }
.dm-tidelight .tl-beach[data-sky="night"] .tl-swell { opacity: 0.4; }

.dm-tidelight .tl-spill {
  position: absolute;
  left: 416px;
  top: 406px;
  width: 256px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 217, 138, 0.22), rgba(255, 217, 138, 0) 70%);
  display: none;
}

.dm-tidelight .tl-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dm-tidelight .tl-island { position: absolute; inset: 0; }
.dm-tidelight .tl-island img { width: 100%; height: 100%; }
.dm-tidelight .tl-beach[data-sky="dawn"] .tl-island img { filter: url(#tl-tint-dawn); }
.dm-tidelight .tl-beach[data-sky="night"] .tl-island img { filter: url(#tl-tint-night); }

.dm-tidelight .tl-windows i {
  position: absolute;
  display: none;
  border-radius: 5px 5px 1px 1px;
  background: rgba(255, 217, 138, 0.88);
  box-shadow: 0 0 12px 5px rgba(255, 217, 138, 0.3);
}
.dm-tidelight .tl-windows i:nth-child(1) { left: 652px; top: 231px; width: 9.4px; height: 13.7px; }
.dm-tidelight .tl-windows i:nth-child(2) { left: 652px; top: 305px; width: 9.4px; height: 14.4px; }
.dm-tidelight .tl-windows i:nth-child(3) { left: 649px; top: 386px; width: 9.4px; height: 14.5px; }

.dm-tidelight .tl-halo,
.dm-tidelight .tl-core,
.dm-tidelight .tl-beam {
  position: absolute;
  display: none;
}
.dm-tidelight .tl-halo {
  left: 541px;
  top: -12px;
  width: 243px;
  height: 243px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 138, 0.75), rgba(255, 217, 138, 0.18) 45%, rgba(255, 217, 138, 0) 70%);
  animation: tl-halo 4s ease-in-out infinite;
}
@keyframes tl-halo { 0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: 0.78; } }
.dm-tidelight .tl-core {
  left: 651px;
  top: 98px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff3cf;
  box-shadow: 0 0 14px 6px rgba(255, 236, 190, 0.7);
}
.dm-tidelight .tl-beam {
  left: 663px;
  top: 109px;
  width: 0;
  height: 0;
  animation: tl-beam-x 4s linear infinite;
}
.dm-tidelight .tl-beam > i {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform: rotate(2.4deg);
}
.dm-tidelight .tl-beam > i > b {
  position: absolute;
  left: -6px;
  top: -33px;
  width: 554px;
  height: 66px;
  background: no-repeat 0 0 / 100% 100%;
  transform-origin: 6px 50%;
  animation: tl-beam-y 4s linear infinite;
}
@keyframes tl-beam-x {
  0% { transform: scaleX(1); animation-timing-function: ease-in; }
  25% { transform: scaleX(0); animation-timing-function: ease-out; }
  50% { transform: scaleX(-1); animation-timing-function: ease-in; }
  75% { transform: scaleX(0); animation-timing-function: ease-out; }
  100% { transform: scaleX(1); }
}
@keyframes tl-beam-y {
  0%, 50%, 100% { transform: scaleY(1); }
  25%, 75% { transform: scaleY(2.4); }
}
.dm-tidelight .tl-beach[data-sky="night"] :is(.tl-windows i, .tl-halo, .tl-core, .tl-beam, .tl-spill) { display: block; }

.dm-tidelight .tl-wash {
  position: absolute;
  left: 0;
  top: 520px;
  width: 100%;
  height: 150px;
  background: no-repeat 0 0 / 100% 100%;
  opacity: 0;
}
.dm-tidelight .tl-wash.is-on { animation: tl-wash 2.6s cubic-bezier(0.3, 0.2, 0.3, 1) forwards; }
@keyframes tl-wash {
  0% { opacity: 0; transform: translateY(-46px); }
  30% { opacity: 1; transform: translateY(34px); }
  100% { opacity: 0; transform: translateY(-36px); }
}

.dm-tidelight .tl-item {
  position: absolute;
  opacity: 0;
  transform: translateY(-74px) scale(0.72) rotate(-16deg);
  transition: transform 1.35s cubic-bezier(0.2, 0.7, 0.25, 1), opacity 0.6s ease;
  filter: drop-shadow(0 3px 2px rgba(80, 60, 30, 0.18));
}
.dm-tidelight .tl-item.is-landed { opacity: 1; transform: none; }
.dm-tidelight .tl-item.is-landed.is-picked {
  transform: translateY(-10px) scale(1.12) rotate(-6deg);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.4);
}
.dm-tidelight .tl-item[data-k="wood"] { left: 474px; top: 673px; width: 52px; }
.dm-tidelight .tl-item[data-k="b1"] { left: 583px; top: 586px; width: 58px; }
.dm-tidelight .tl-item[data-k="b0"] { left: 517px; top: 609px; width: 63px; }
.dm-tidelight .tl-item[data-k="shell"] { left: 707px; top: 616px; width: 47px; }
.dm-tidelight .tl-item[data-k="b2"] { left: 659px; top: 645px; width: 70px; }
.dm-tidelight .tl-item[data-k="wait"] { left: 466px; top: 543px; width: 53px; transform: none; }
.dm-tidelight .tl-item[data-k="wait"].is-landed.is-sailing { animation: tl-sail 3.4s cubic-bezier(0.45, 0.05, 0.4, 1) forwards; }
@keyframes tl-sail {
  0% { transform: none; opacity: 1; }
  12% { transform: translate(3px, -14px) rotate(-8deg); }
  70% { opacity: 0.85; }
  100% { transform: translate(70px, -172px) scale(0.26) rotate(10deg); opacity: 0; }
}
.dm-tidelight .tl-beach[data-sky="night"] .tl-item { filter: url(#tl-tint-night-item) drop-shadow(0 0 6px rgba(255, 217, 138, 0.3)); }

.dm-tidelight .tl-fab {
  position: absolute;
  right: 16px;
  bottom: 54px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

/* HUD, shared by the beach and the lamp room */
.dm-tidelight .tl-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 58px;
  display: grid;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s, visibility 0s 0.45s;
}
.dm-tidelight[data-screen="beach"] .tl-hud,
.dm-tidelight[data-screen="room"] .tl-hud { opacity: 1; visibility: visible; transition: opacity 0.45s; }
.dm-tidelight .tl-row { display: flex; align-items: center; gap: 8px; }
.dm-tidelight .tl-phase { margin-right: auto; }
.dm-tidelight .tl-phase-i { display: flex; }
.dm-tidelight .tl-phase .tl-i { width: 17px; height: 17px; }
.dm-tidelight .tl-no { font-size: 13px; }
.dm-tidelight .tl-gear { padding: 7px 10px; }
.dm-tidelight .tl-gear .tl-i { width: 19px; height: 19px; stroke-width: 1.6; }
.dm-tidelight .tl-mats { gap: 0; padding: 6px 4px 6px 10px; }
.dm-tidelight .tl-mats .tl-mat { width: 20px; height: 20px; }
.dm-tidelight .tl-mats b { padding: 0 9px 0 2px; font-size: 13.5px; font-weight: 700; }
.dm-tidelight .tl-floor-pill { margin-left: auto; font-weight: 700; display: none; }
.dm-tidelight[data-floor="lamp"] .tl-floor-pill { display: inline-flex; }

.dm-tidelight .tl-floors {
  position: absolute;
  right: 14px;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s, visibility 0s 0.45s;
}
.dm-tidelight[data-screen="beach"] .tl-floors,
.dm-tidelight[data-screen="room"] .tl-floors { opacity: 1; visibility: visible; transition: opacity 0.45s; }
.dm-tidelight .tl-floors i {
  width: 9px;
  height: 9px;
  border-radius: 5px;
  background: rgba(247, 240, 225, 0.9);
  border: 1px solid rgba(46, 58, 74, 0.4);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.27);
  transition: height 0.25s, background 0.25s;
}
.dm-tidelight .tl-floors i.is-dim { background: rgba(247, 240, 225, 0.4); }
.dm-tidelight .tl-floors i.is-on { height: 24px; background: var(--gold); }

/* ---------- letter ---------- */
.dm-tidelight .tl-letter-body { padding: 4px 20px 0; }
.dm-tidelight .tl-sheet-paper { padding: 22px 20px 20px; background: var(--sheet); }
.dm-tidelight .tl-lines p {
  font-size: 18px;
  line-height: 1.75;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.dm-tidelight .tl-lines p.is-on { opacity: 1; transform: none; }
.dm-tidelight .tl-drawing {
  width: 172px;
  height: 172px;
  margin: 16px auto 0;
  border: 1px solid var(--paper-edge);
  border-radius: 6px;
  background: var(--sheet);
}
.dm-tidelight .tl-doodle { display: block; width: 100%; height: 100%; }
.dm-tidelight .tl-doodle path {
  fill: none;
  stroke: var(--c);
  stroke-width: var(--w);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.dm-tidelight .tl-doodle.is-drawn path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.42s cubic-bezier(0.4, 0.1, 0.4, 1);
}
.dm-tidelight .tl-doodle.is-drawn path:nth-child(2) { transition-delay: 0.27s; }
.dm-tidelight .tl-doodle.is-drawn path:nth-child(3) { transition-delay: 0.54s; }
.dm-tidelight .tl-doodle.is-drawn path:nth-child(4) { transition-delay: 0.81s; }
.dm-tidelight .tl-doodle.is-drawn path:nth-child(5) { transition-delay: 1.08s; }
/* 畫板上是一筆一筆畫：和手指移動的時間對齊 */
.dm-tidelight .tl-pad .tl-doodle.is-drawn path:nth-child(1) { transition-duration: 0.4s; transition-delay: 0s; }
.dm-tidelight .tl-pad .tl-doodle.is-drawn path:nth-child(2) { transition-duration: 0.3s; transition-delay: 0.55s; }
.dm-tidelight .tl-pad .tl-doodle.is-drawn path:nth-child(3) { transition-duration: 0.25s; transition-delay: 0.85s; }
.dm-tidelight .tl-pad .tl-doodle.is-drawn path:nth-child(4) { transition-duration: 0.25s; transition-delay: 1.1s; }
.dm-tidelight .tl-pad .tl-doodle.is-drawn path:nth-child(5) { transition-duration: 0.25s; transition-delay: 1.35s; }
.dm-tidelight .tl-sign {
  margin-top: 12px;
  text-align: right;
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.6s;
}
.dm-tidelight .tl-sign.is-on { opacity: 1; }
.dm-tidelight .tl-reply { margin-top: 16px; }
.dm-tidelight .tl-letter .tl-note { margin-top: 6px; }
.dm-tidelight .tl-btnrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.dm-tidelight .tl-btnrow .tl-btn { padding: 0 10px; }
.dm-tidelight .tl-textbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  color: var(--rose);
  font-size: 14px;
  font-weight: 500;
}
.dm-tidelight .tl-textbtn .tl-i { width: 18px; height: 18px; }

/* ---------- compose ---------- */
.dm-tidelight .tl-preview {
  margin: 0 16px 8px;
  padding: 10px 16px 12px;
  background: var(--sheet);
}
.dm-tidelight .tl-prev-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.dm-tidelight .tl-prev-head .tl-i { width: 15px; height: 15px; }
.dm-tidelight .tl-prev-head em {
  margin-left: 8px;
  color: var(--sea-blue);
  font-size: 13.5px;
  font-weight: 600;
}
.dm-tidelight .tl-prev-body {
  display: flex;
  align-items: flex-start;
  min-height: 96px;
  margin-top: 4px;
}
.dm-tidelight .tl-prev-main { flex: 1; min-width: 0; }
.dm-tidelight .tl-empty { font-size: 18px; line-height: 1.75; color: var(--ink-soft); }
.dm-tidelight .tl-preview.has-parts .tl-prev-empty { display: none; }
.dm-tidelight .tl-part {
  display: none;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
}
.dm-tidelight .tl-part.is-on { display: flex; animation: tl-rise 0.45s ease both; }
.dm-tidelight .tl-part span { flex: 1; font-size: 16.5px; line-height: 1.5; }
.dm-tidelight .tl-part .tl-i { width: 16px; height: 16px; margin-top: 4px; color: var(--ink-soft); }
.dm-tidelight .tl-own {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  margin-left: -6px;
  color: var(--sea-blue);
  font-size: 15px;
  font-weight: 600;
}
.dm-tidelight .tl-own .tl-i { width: 20px; height: 20px; }
.dm-tidelight .tl-thumb {
  display: none;
  width: 76px;
  height: 76px;
  margin-left: 10px;
  border: 1px solid var(--paper-edge);
  border-radius: 6px;
  background: var(--sheet);
}
.dm-tidelight .tl-preview.has-thumb .tl-thumb { display: block; animation: tl-pop 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.3) both; }
.dm-tidelight .tl-thumb .tl-doodle path { stroke-dashoffset: 0; }
.dm-tidelight .tl-prev-hint { margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.dm-tidelight .tl-tabs {
  display: flex;
  gap: 8px;
  height: 46px;
  padding: 4px 16px;
  overflow: hidden;
}
.dm-tidelight .tl-tabs span {
  flex: none;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  background: var(--paper-shade);
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.dm-tidelight .tl-tabs span.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dm-tidelight .tl-cards { padding: 8px 16px; }
.dm-tidelight .tl-cardset { display: none; }
.dm-tidelight .tl-cards[data-cat="greet"] [data-set="greet"],
.dm-tidelight .tl-cards[data-cat="today"] [data-set="today"],
.dm-tidelight .tl-cards[data-cat="feel"] [data-set="feel"] { display: block; animation: tl-fade 0.25s ease both; }
.dm-tidelight .tl-card {
  display: flex;
  align-items: center;
  margin: 4px 0;
  padding: 12px 14px;
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  background: var(--paper-shade);
  font-size: 15.5px;
  line-height: 1.4;
  transition: opacity 0.3s;
}
.dm-tidelight .tl-card .tl-i { width: 18px; height: 18px; margin-left: auto; color: var(--ink-soft); }
.dm-tidelight .tl-card.is-used { opacity: 0.35; }
.dm-tidelight .tl-compose-foot {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dm-tidelight .tl-compose-foot .tl-btn { padding: 0 10px; }

/* ---------- drawing pad ---------- */
.dm-tidelight .tl-pad {
  height: 328px;
  margin: 8px 16px 0;
  border: 1.5px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--sheet);
}
.dm-tidelight .tl-swatches {
  display: flex;
  justify-content: space-between;
  margin: 20px 22px 0;
}
.dm-tidelight .tl-swatches i {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c);
}
.dm-tidelight .tl-swatches i:first-child { box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 6px var(--gold); }
.dm-tidelight .tl-pens {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}
.dm-tidelight .tl-pens i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-shade);
}
.dm-tidelight .tl-pens i:nth-child(2) { background: var(--paper-edge); }
.dm-tidelight .tl-pens i::after {
  content: "";
  border-radius: 50%;
  background: var(--ink);
  width: 5px;
  height: 5px;
}
.dm-tidelight .tl-pens i:nth-child(2)::after { width: 9px; height: 9px; }
.dm-tidelight .tl-pens i:nth-child(3)::after { width: 14px; height: 14px; }
.dm-tidelight .tl-draw-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 16px 0;
}

/* ---------- word sheet ---------- */
.dm-tidelight .tl-overlay { position: absolute; inset: 0; visibility: hidden; transition: visibility 0s linear 0.35s; }
.dm-tidelight .tl-overlay.is-on { visibility: visible; transition: visibility 0s; }
.dm-tidelight .tl-scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 32, 0.38);
  opacity: 0;
  transition: opacity 0.3s;
}
.dm-tidelight .tl-overlay.is-on .tl-scrim { opacity: 1; }
.dm-tidelight .tl-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 24px 52px;
  border-radius: 28px 28px 0 0;
  background: var(--paper);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dm-tidelight .tl-sheet-wrap.is-on .tl-sheet { transform: none; }
.dm-tidelight .tl-handle {
  display: block;
  width: 32px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 2px;
  background: rgba(100, 112, 127, 0.4);
}
.dm-tidelight .tl-sheet-card { font-size: 16px; font-weight: 600; }
.dm-tidelight .tl-sheet .tl-note { margin-top: 4px; }
.dm-tidelight .tl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.dm-tidelight .tl-chips span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--paper-shade);
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s;
}
.dm-tidelight .tl-chips span[hidden] { display: none; }
.dm-tidelight .tl-chips span.is-on { background: #e2d3b2; border-color: #cdb98f; }

/* ---------- lamp room ---------- */
.dm-tidelight .tl-room-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e3a993 0%, #efc2a8 30%, #f6d9c2 55%, #efd8c8 100%);
  mix-blend-mode: multiply;
}
.dm-tidelight .tl-lens {
  position: absolute;
  left: -100px;
  top: 30px;
  width: 560px;
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 240, 190, 0.95) 0%, rgba(255, 214, 140, 0.55) 30%, rgba(255, 190, 110, 0.16) 62%, rgba(255, 190, 110, 0) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 1.1s ease, transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dm-tidelight .tl-room.is-lit .tl-lens { opacity: 1; transform: none; animation: tl-flicker 2.6s ease-in-out 1.4s infinite; }
@keyframes tl-flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.86; } }
.dm-tidelight .tl-lamp::after {
  content: "";
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 228, 160, 0.9);
  opacity: 0;
  pointer-events: none;
}
.dm-tidelight .tl-lamp.is-lit::after { animation: tl-ring-out 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes tl-ring-out {
  0% { opacity: 0.95; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(2.6); border-width: 1px; }
}
.dm-tidelight .tl-lamp {
  --p: 0;
  position: absolute;
  left: 75px;
  top: 195px;
  width: 210px;
  height: 210px;
}
.dm-tidelight .tl-lamp-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 138, 0.85), rgba(255, 217, 138, 0) 70%);
  opacity: var(--p);
}
.dm-tidelight .tl-lamp.is-lit .tl-lamp-glow { opacity: 1; }
.dm-tidelight .tl-ring,
.dm-tidelight .tl-flame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.dm-tidelight .tl-ring circle { fill: none; stroke-width: 4.7; stroke-linecap: round; }
.dm-tidelight .tl-ring-base { stroke: rgba(247, 240, 225, 0.75); }
.dm-tidelight .tl-ring-arc {
  stroke: var(--gold);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--p));
  transform: rotate(-90deg);
  transform-origin: 105px 105px;
}
.dm-tidelight .tl-lamp.is-lit .tl-ring-arc { opacity: 0; transition: opacity 0.3s; }
.dm-tidelight .tl-flame-g {
  transform: scale(calc(0.25 + 0.75 * var(--p)));
  transform-origin: 105px 105px;
}
.dm-tidelight .tl-lamp.is-lit .tl-flame-g { transform: none; animation: tl-flame 1.6s ease-in-out infinite; }
@keyframes tl-flame {
  0%, 100% { transform: scale(1, 1); }
  40% { transform: scale(0.97, 1.05); }
  70% { transform: scale(1.03, 0.98); }
}
.dm-tidelight .tl-flame-pale { fill: rgba(247, 240, 225, 0.5); }
.dm-tidelight .tl-flame-body { fill: #ffb347; opacity: var(--p); }
.dm-tidelight .tl-flame-heart { fill: #ffe9a8; opacity: var(--p); }
.dm-tidelight .tl-lamp.is-lit :is(.tl-flame-body, .tl-flame-heart) { opacity: 1; }
.dm-tidelight .tl-lamp-pills {
  position: absolute;
  left: 0;
  right: 0;
  top: 419px;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.dm-tidelight .tl-lamp-pill { font-size: 14.5px; }
.dm-tidelight .tl-horizon-pill { font-weight: 400; opacity: 0; transform: translateY(-4px); transition: opacity 0.5s 0.2s, transform 0.5s 0.2s; }
.dm-tidelight .tl-room.is-lit .tl-horizon-pill { opacity: 1; transform: none; }

/* lamp-lit dialog */
.dm-tidelight .tl-dialog-wrap .tl-scrim { background: rgba(0, 0, 0, 0.54); }
.dm-tidelight .tl-dialog {
  position: absolute;
  left: 40px;
  right: 40px;
  top: 50%;
  display: grid;
  justify-items: center;
  padding: 24px 22px 18px;
  text-align: center;
  opacity: 0;
  transform: translateY(-50%) scale(0.92);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.dm-tidelight .tl-dialog-wrap.is-on .tl-dialog { opacity: 1; transform: translateY(-50%); }
.dm-tidelight .tl-sun {
  width: 44px;
  height: 44px;
  fill: var(--gold);
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
}
.dm-tidelight .tl-dialog-title { margin-top: 10px; font-size: 21px; font-weight: 700; }
.dm-tidelight .tl-dialog-text { margin-top: 12px; font-size: 15px; line-height: 1.5; }
.dm-tidelight .tl-dialog .tl-note { margin-top: 6px; font-size: 14px; }
.dm-tidelight .tl-ok { margin-top: 16px; min-width: 112px; }

/* toast */
.dm-tidelight .tl-toast {
  position: absolute;
  left: 50%;
  top: 152px;
  max-width: 312px;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.dm-tidelight .tl-toast.is-on { opacity: 1; transform: translate(-50%, 0); transition: opacity 0.35s ease, transform 0.35s ease; }

@keyframes tl-fade { from { opacity: 0; } }
@keyframes tl-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes tl-pop { from { opacity: 0; transform: scale(0.6); } }
