* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  color: #f3f5fb;
  background: #05060a;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

button:disabled {
  cursor: default;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid #eef1ff;
  outline-offset: 2px;
}

p,
h1 {
  margin: 0;
}

h1 {
  font-size: inherit;
  font-weight: inherit;
}

.sr-only {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060a;
}

.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #070b16;
  touch-action: manipulation;
}

.wallpaper,
.scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wallpaper {
  background:
    radial-gradient(ellipse 95% 48% at 50% -8%, rgba(132, 152, 214, 0.2), transparent 58%),
    radial-gradient(ellipse 80% 42% at 78% 108%, rgba(64, 78, 140, 0.16), transparent 62%),
    linear-gradient(180deg, #151b32 0%, #0c1224 46%, #080c18 100%);
}

.scrim {
  background: linear-gradient(180deg, rgba(5, 7, 14, 0.18) 0%, rgba(5, 7, 14, 0.48) 52%, rgba(5, 7, 14, 0.66) 100%);
  opacity: 0;
  transition: opacity 480ms ease;
}

.phone.is-opening .scrim,
.phone.is-ending .scrim {
  opacity: 1;
}

.phone.is-morning .wallpaper {
  background:
    radial-gradient(ellipse 90% 46% at 50% -8%, rgba(255, 246, 236, 0.85), transparent 62%),
    radial-gradient(ellipse 48% 32% at 84% 16%, rgba(242, 176, 138, 0.28), transparent 68%),
    linear-gradient(180deg, #a9c3dc 0%, #d4e0ec 40%, #f3e6da 76%, #f8f1ea 100%);
}

.phone.is-morning .scrim {
  opacity: 0;
}

.bezel {
  position: relative;
  z-index: 1;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-right: max(18px, env(safe-area-inset-right));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
}

.status {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  height: 16px;
  margin: 2px 2px 0;
  color: rgba(236, 239, 248, 0.82);
}

.signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.signal span {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: currentColor;
}

.signal span:nth-child(1) { height: 3px; }
.signal span:nth-child(2) { height: 5px; }
.signal span:nth-child(3) { height: 8px; }
.signal span:nth-child(4) { height: 11px; }

.battery {
  position: relative;
  width: 22px;
  height: 11px;
  padding: 1px;
  border: 1px solid currentColor;
  border-radius: 2.5px;
}

.battery::after {
  content: "";
  position: absolute;
  top: 3px;
  right: -3px;
  width: 2px;
  height: 4px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
}

.battery-fill {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
}

.clock-block {
  padding-top: 10px;
  text-align: center;
  user-select: none;
  transition: opacity 480ms ease;
}

.phone.is-opening .clock-block {
  opacity: 0.86;
}

.phone.is-ending .clock-block {
  opacity: 0.74;
}

.phone.is-morning .status {
  color: rgba(28, 38, 54, 0.78);
}

.phone.is-morning .clock {
  color: #1c2636;
}

.phone.is-morning .date {
  color: #3a4860;
}

.clock {
  margin: 0;
  font-weight: 200;
  font-size: clamp(4.75rem, 24vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #f7f8fc;
}

.date {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #d5d9e8;
}

#app {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.screen-opening {
  overflow-x: hidden;
  overflow-y: auto;
}

.opening-spacer {
  flex: 1 1 auto;
  min-height: 1.25rem;
}

.opening-copy {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 0 4px;
}

.opening-line {
  text-align: center;
  text-wrap: balance;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.9;
  color: #e7e9f2;
  animation: fade-only 640ms ease-out both;
}

.opening-line + .opening-line {
  animation-delay: 140ms;
}

.tap-hint {
  align-self: center;
  min-height: 44px;
  margin-top: 1.35rem;
  margin-bottom: 6px;
  padding: 0.5rem 1rem;
  border: 0;
  background: transparent;
  color: #d5d9e6;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.tap-hint:hover {
  color: #f4f6fb;
}

.screen-play,
.screen-morning,
.screen-ending {
  overflow-x: hidden;
  overflow-y: auto;
}

.screen-play {
  padding-top: 18px;
  padding-bottom: 4px;
}

.screen-ending {
  justify-content: center;
  justify-content: safe center;
  gap: 1rem;
  padding: 1.5rem 12px 0.75rem;
}

.screen-ending.is-in {
  animation: fade-only 720ms ease-out both;
}

.screen-morning {
  gap: 0;
  padding-top: 12px;
  overflow: hidden;
}

.glass {
  background-color: rgba(32, 38, 58, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .glass {
    background-color: rgba(48, 56, 82, 0.58);
  }
}

.notice {
  min-width: 0;
  border-radius: 20px;
  color: #f4f6fb;
}

.notice.is-in {
  animation: notice-in 400ms ease-out both;
}

.notice.is-leaving-show {
  animation: leave-show 480ms ease-in forwards;
}

.notice.is-leaving-mute {
  animation: leave-mute 480ms ease-in forwards;
}

.notice.is-leaving-delete {
  animation: leave-delete 460ms ease-in forwards;
}

.notice-face,
.notice-open {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 12px;
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.notice-face {
  align-items: center;
  min-height: 64px;
}

.notice-face:focus-visible {
  outline-offset: -6px;
}

.notice-open {
  align-items: start;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  color: #f4f6fb;
  font-size: 1rem;
  font-weight: 500;
}

.notice-open .notice-icon {
  margin-top: 1px;
}

.notice-main {
  min-width: 0;
}

.notice-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.notice-sender {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f7f8fc;
}

.notice-time {
  flex: none;
  font-size: 0.8rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: #d5d9e8;
}

.notice-preview,
.notice-full,
.line {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.55;
  color: #e7eaf4;
  overflow-wrap: anywhere;
}

.notice-full,
.line-in {
  animation: fade-only 280ms ease-out both;
}

.line + .line {
  margin-top: 0.5rem;
}

.notice-lines {
  padding: 0 14px 14px 64px;
}

.notice-open:has(+ .notice-lines) {
  padding-bottom: 2px;
}

.expand-hint {
  display: block;
  margin-top: 0.32rem;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.4;
  color: #9aa3b8;
}

.choices {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  animation: fade-only 280ms ease-out both;
}

.choice {
  min-width: 0;
  min-height: 44px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(48, 54, 74, 0.92);
  color: #f3f5fb;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
}

.choice:hover,
.continue:hover {
  background: rgba(62, 70, 94, 0.96);
}

.choice:active,
.continue:active {
  background: rgba(74, 82, 108, 0.98);
}

.narration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.6rem;
  text-align: center;
  animation: fade-only 360ms ease-out both;
}

.narration.is-out {
  animation: fade-out 280ms ease-in forwards;
}

.narration-text,
.ending-text {
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.9;
  color: #e6e9f4;
}

.ending-title {
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #f7f8fc;
}

.ending-text,
.ending-note {
  text-align: center;
}

.ending-note {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.7;
  color: #b7c0d4;
}

.screen-ending .continue {
  margin-top: 0.85rem;
}

.continue {
  align-self: center;
  min-width: 44px;
  min-height: 44px;
  margin-top: 0.35rem;
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(48, 54, 74, 0.92);
  color: #f3f5fb;
  font-size: 0.95rem;
  font-weight: 500;
}

.morning-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 48, 68, 0.28) transparent;
}

.morning-actions {
  flex: none;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
}

.morning-actions .continue {
  min-width: 0;
  margin: 0;
  padding: 8px 4px;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: normal;
}

.morning-card {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 20px;
}

.morning-app {
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #4c5870;
}

.morning-line,
.morning-preview,
.morning-empty {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.65;
  color: #1c2433;
}

.morning-line + .morning-line {
  margin-top: 0.4rem;
}

.morning-meta {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 0.28rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #3e4c64;
}

.morning-time {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.morning-sender {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  color: #1c2433;
}

.morning-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.morning-empty {
  margin: 1.6rem 0 0.4rem;
  text-align: center;
  color: #4a5670;
}

.morning-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-bottom: 0.2rem;
}

.morning-ending {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #243044;
}

.morning-progress {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #4a5670;
}

.collect-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.collect-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(36, 48, 68, 0.24);
}

.collect-dots .dot.is-on {
  background: rgba(28, 38, 54, 0.92);
}

.phone.is-morning .morning-card.glass {
  background-color: rgba(255, 252, 248, 0.5);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(48, 62, 88, 0.08);
}

@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .phone.is-morning .morning-card.glass {
    background-color: rgba(255, 252, 248, 0.42);
  }
}

.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  overflow: auto;
  background: rgba(5, 6, 10, 0.72);
}

.share-overlay img {
  width: auto;
  height: auto;
  max-width: min(100%, 420px);
  max-height: calc(100dvh - 132px);
  max-height: calc(100svh - 132px);
  min-height: 0;
  flex: 0 1 auto;
  object-fit: contain;
  border-radius: 18px;
  background: #d5e0ec;
}

.share-overlay .continue {
  flex: none;
}

.copy-field {
  width: min(100%, 420px);
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(32, 38, 58, 0.94);
  color: #f3f5fb;
  font: inherit;
  resize: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 30;
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(32, 38, 58, 0.94);
  color: #f3f5fb;
  font-size: 0.9rem;
  transform: translateX(-50%);
  animation: fade-only 200ms ease-out both;
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-120%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes leave-show {
  to {
    opacity: 0;
    transform: translateY(-42px);
  }
}

@keyframes leave-mute {
  to {
    opacity: 0;
    transform: translateY(52px) scale(0.9);
  }
}

@keyframes leave-delete {
  to {
    opacity: 0;
    transform: translateX(-120%);
  }
}

@keyframes fade-only {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (min-width: 480px) {
  .stage {
    padding: 16px 0;
  }

  .phone {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: 900px;
    border-radius: 40px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 24px 80px rgba(0, 0, 0, 0.55);
  }
}

@media (max-width: 390px) {
  .bezel {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .choice,
  .morning-actions .continue {
    padding-left: 2px;
    padding-right: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scrim,
  .clock-block {
    transition: none;
  }

  .opening-line,
  .notice-full,
  .line-in,
  .choices,
  .narration,
  .narration.is-out,
  .screen-ending.is-in,
  .toast {
    animation: none;
    transform: none;
  }

  .notice.is-in {
    animation: fade-only 150ms ease-out both;
  }

  .notice.is-leaving-show,
  .notice.is-leaving-mute,
  .notice.is-leaving-delete {
    animation: fade-out 150ms ease-out both;
  }
}
