﻿

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #10131a;
  font-family:
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}

body {
  user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

:root {
  
  --clock-size: 467px;
  --clock-opacity: 0.08;
  --clock-stroke-opacity: 0.4;
  --clock-clone-opacity: 0.1;
  --clock-scale-x: 1;
  --clock-top: 4vh;
  --clock-letter-spacing: 0em;
}

.wallpaper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;

  
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.13), transparent 34%),
    linear-gradient(135deg, #151a22 0%, #273244 48%, #0f1218 100%);
}

.layer {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: cover;
  pointer-events: none;
  will-change: transform;
  transform-origin: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.layer > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.layer.is-missing {
  display: none;
}

.is-hidden {
  display: none;
}


.layer-background {
  z-index: 1;
}


.lock-screen-clock {
  position: absolute;
  top: var(--clock-top);
  left: 50%;
  z-index: 5;
  width: min(1180px, 96vw);
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.18),
    0 8px 28px rgba(0, 0, 0, 0.32);
}

.lock-screen-clock__date {
  margin-bottom: -6px;
  font-family:
    "SF Pro Display",
    "Segoe UI Variable Display",
    "Inter",
    sans-serif;
  font-size: clamp(17px, 1.45vw, 28px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.72);
}

.lock-screen-clock__time {
  display: inline-block;
  position: absolute;
  top: clamp(13px, 1.1vw, 25px);
  left: 50%;
  font-family:
    "SF Pro Display",
    "Segoe UI Variable Display",
    "Inter",
    sans-serif;
  font-size: clamp(130px, var(--clock-size), 1000px);
  font-weight: 680;
  line-height: 0.82;
  letter-spacing: var(--clock-letter-spacing);
  color: rgba(255, 255, 255, var(--clock-opacity));
  -webkit-text-stroke: 1.45px rgba(255, 255, 255, var(--clock-stroke-opacity));
  transform: translateX(-50%) scaleX(var(--clock-scale-x));
  transform-origin: center;
  text-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 6px rgba(255, 255, 255, 0.16),
    0 0 22px rgba(255, 255, 255, 0.12),
    0 14px 42px rgba(0, 0, 0, 0.34);
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.14)) blur(0.08px);
  mix-blend-mode: screen;
  font-variant-numeric: tabular-nums;
}

.lock-screen-clock__time::after {
  content: attr(data-time);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 0.7px rgba(255, 255, 255, 0.28);
  filter: blur(2.4px);
  opacity: 0.42;
}

.lock-screen-clock-clone {
  position: absolute;
  top: calc(var(--clock-top) + clamp(13px, 1.1vw, 25px));
  left: 50%;
  z-index: 9;
  display: inline-block;
  pointer-events: none;
  font-family:
    "SF Pro Display",
    "Segoe UI Variable Display",
    "Inter",
    sans-serif;
  font-size: clamp(130px, var(--clock-size), 1000px);
  font-weight: 680;
  line-height: 0.82;
  letter-spacing: var(--clock-letter-spacing);
  color: transparent;
  -webkit-text-stroke: 1.1px rgba(255, 255, 255, var(--clock-clone-opacity));
  transform: translateX(-50%) scaleX(var(--clock-scale-x));
  transform-origin: center;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.lock-screen-clock-clone.is-hidden {
  display: none;
}


.lock-screen-clock__time,
.lock-screen-clock-clone {
  font-family:
    "SF Pro Display",
    "Segoe UI Variable Display",
    "Inter",
    "Segoe UI",
    sans-serif;
}

.lock-screen-clock__time.is-hidden {
  display: none;
}


.layer-character {
  z-index: 10;
}


.layer-foreground {
  z-index: 12;
  background:
    radial-gradient(ellipse at 14% 105%, rgba(6, 28, 24, 0.25), transparent 30%),
    radial-gradient(ellipse at 86% 110%, rgba(9, 33, 27, 0.22), transparent 34%),
    linear-gradient(to top, rgba(6, 24, 22, 0.16), transparent 28%);
}

.snow-canvas,
.petal-canvas,
.leaf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.snow-canvas {
  z-index: 4;
}

.petal-canvas {
  z-index: 5;
}

.leaf-canvas {
  z-index: 6;
}

.control-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.control-panel__title {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.control-panel__copyright {
  margin-bottom: 12px;
  font-size: 10px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
}

.select-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.select-row select {
  min-width: 0;
  height: 30px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.button-row button {
  height: 30px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
}

.button-row button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.control-row {
  display: grid;
  grid-template-columns: 118px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}

.control-row span {
  min-width: 0;
  line-height: 1.2;
}

.control-row input[type="range"] {
  width: 100%;
  accent-color: #84c5ff;
}

.control-row output {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.toggle-row input {
  accent-color: #84c5ff;
}

.control-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.control-group summary {
  cursor: pointer;
  list-style-position: outside;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.82);
}

.clock {
  position: fixed;
  right: 28px;
  bottom: 52px;
  z-index: 20;
  width: 56px;
  height: 56px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.clock img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.42));
}

.clock__glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(12, 28, 29, 0.44);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 23px;
  line-height: 1;
}

.motion-permission {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #f5ffff;
  background: rgba(12, 31, 31, 0.72);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font: 600 14px/1 "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.motion-status {
  position: fixed;
  left: 50%;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 54px);
  z-index: 30;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .layer {
    transform: none !important;
  }

  .motion-permission,
  .motion-status {
    display: none !important;
  }
}

.clock__time {
  display: none;
}

.contact-toggle {
  position: fixed;
  left: 28px;
  bottom: 56px;
  z-index: 21;
  min-height: 44px;
  padding: 7px 16px 7px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(12, 28, 29, 0.5);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font: 700 14px/1 "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.contact-toggle__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #dffaff;
  background: rgba(102, 211, 232, 0.16);
  font: 800 18px/1 "Segoe UI", sans-serif;
}

.contact-toggle__copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.contact-toggle__copy strong {
  font-size: 13px;
  line-height: 1.05;
}

.contact-toggle__copy small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.05;
  text-transform: uppercase;
}

.contact-toggle:hover,
.contact-toggle:focus-visible {
  background: rgba(18, 45, 47, 0.72);
  border-color: rgba(255, 255, 255, 0.5);
}

.contact-card {
  position: fixed;
  left: 28px;
  bottom: 112px;
  z-index: 32;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  color: rgba(255, 255, 255, 0.96);
  background: linear-gradient(145deg, rgba(25, 58, 62, 0.86), rgba(11, 24, 29, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
}

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

.contact-card__header > div {
  display: grid;
  gap: 2px;
}

.contact-card__header strong {
  font-size: 17px;
}

.contact-card__header span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-card__close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.08);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.contact-card__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-link {
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.96);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.34);
}

.contact-link__badge {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.contact-link--bilibili .contact-link__badge {
  background: linear-gradient(135deg, #fb7299, #e95483);
}

.contact-link--qq .contact-link__badge {
  background: linear-gradient(135deg, #55c8ff, #3e8df5);
}

.contact-link--steam {
  grid-column: 1 / -1;
}

.contact-link--steam .contact-link__badge {
  background: linear-gradient(135deg, #66c0f4, #1b6ca8 58%, #171a21);
}

.contact-link > span:last-child,
.contact-email > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.contact-link strong,
.contact-email strong {
  font-size: 13px;
}

.contact-link small,
.contact-email small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.contact-email {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.contact-email:hover,
.contact-email:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.contact-email code {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font: 600 11px/1.3 "Cascadia Code", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) and (orientation: portrait) {
  .contact-toggle {
    left: max(14px, env(safe-area-inset-left, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    min-height: 42px;
    padding: 6px 14px 6px 7px;
  }

  .contact-card {
    left: max(14px, env(safe-area-inset-left, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    width: calc(100vw - max(28px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px) + 28px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 100px);
    overflow-y: auto;
  }

  .contact-card__links {
    grid-template-columns: 1fr;
  }

  .contact-email {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .contact-email code {
    width: 100%;
    font-size: 12px;
  }
}

@media (max-height: 500px) and (pointer: coarse) {
  .contact-toggle {
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  }

  .contact-card {
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
    width: min(520px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px));
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }
}

@media (max-width: 700px) {
  .control-panel {
    top: 12px;
    right: 12px;
    padding: 12px;
  }

  .clock {
    right: 16px;
    bottom: 42px;
    width: 52px;
    height: 52px;
  }

  .clock__glyph {
    width: 44px;
    height: 44px;
  }
}

/*
 * Phone layout: keep the desktop composition untouched while giving portrait
 * phones their own full-bleed crop, safe-area spacing, clock scale and
 * character scale. Dynamic viewport units follow Safari's moving toolbars.
 */
@media (max-width: 820px) and (orientation: portrait) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #142a2a;
  }

  body {
    position: fixed;
    inset: 0;
    min-height: 100svh;
    height: 100dvh;
  }

  .wallpaper {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100svh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .layer-background {
    inset: -5%;
    width: 110%;
    height: 110%;
  }

  .layer-background > img {
    object-position: 50% 50%;
  }

  .layer-character {
    inset: 18% -4% auto;
    width: 108%;
    height: 76%;
  }

  .layer-character > img {
    object-fit: cover;
    object-position: 50% 50%;
  }

  .lock-screen-clock {
    top: calc(env(safe-area-inset-top, 0px) + 18px);
    width: calc(100vw - 28px);
  }

  .lock-screen-clock__date {
    margin-bottom: 2px;
    font-size: clamp(14px, 4vw, 18px);
    line-height: 1.2;
  }

  .lock-screen-clock__time,
  .lock-screen-clock-clone {
    font-size: clamp(88px, 29vw, 126px);
    line-height: 0.9;
    letter-spacing: -0.055em;
    white-space: nowrap;
  }

  .lock-screen-clock__time {
    top: clamp(20px, 5.6vw, 26px);
  }

  .lock-screen-clock-clone {
    top: calc(env(safe-area-inset-top, 0px) + 18px + clamp(20px, 5.6vw, 26px));
  }

  .control-panel {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: max(12px, env(safe-area-inset-right, 0px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .clock {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  }

  .motion-permission {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  }

  .motion-status {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  }
}

/* Phone landscape mode has very little vertical room. */
@media (max-height: 500px) and (pointer: coarse) {
  .wallpaper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
  }

  .lock-screen-clock {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
  }

  .lock-screen-clock__date {
    font-size: 13px;
  }

  .lock-screen-clock__time,
  .lock-screen-clock-clone {
    font-size: clamp(72px, 16vh, 96px);
    letter-spacing: -0.04em;
  }

  .layer-character {
    inset: 8% -3% auto;
    width: 106%;
    height: 90%;
  }
}

