:root {
  color-scheme: dark;
  --bg: #050b1d;
  --panel: #0b1633;
  --panel-soft: #0e1d3d;
  --panel-raised: #11254a;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f8ff;
  --muted: #91a4c6;
  --blue: #2563eb;
  --blue-deep: #1746a2;
  --blue-bright: #38bdf8;
  --lime: var(--blue-bright);
  --lime-deep: var(--blue-deep);
  --cyan: var(--blue-bright);
  --violet: #9f78ff;
  --orange: #ff785a;
  --radius: 22px;
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.36);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 8%, rgba(37, 99, 235, 0.22), transparent 32rem),
    radial-gradient(circle at 47% 100%, rgba(56, 189, 248, 0.12), transparent 28rem),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.love-sparkles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.love-sparkles i {
  position: absolute;
  color: rgba(244, 114, 182, .13);
  font-size: clamp(14px, 2vw, 28px);
  font-style: normal;
  filter: drop-shadow(0 0 10px rgba(244, 114, 182, .2));
  animation: heart-float 7s ease-in-out infinite;
}

.love-sparkles i:nth-child(1) { top: 12%; left: 24%; }
.love-sparkles i:nth-child(2) { top: 31%; right: 5%; animation-delay: -2s; }
.love-sparkles i:nth-child(3) { bottom: 19%; left: 15%; animation-delay: -4s; }
.love-sparkles i:nth-child(4) { right: 24%; bottom: 8%; animation-delay: -6s; }

@keyframes heart-float {
  0%, 100% { opacity: .35; transform: translateY(0) rotate(-8deg) scale(.9); }
  50% { opacity: .85; transform: translateY(-14px) rotate(7deg) scale(1.08); }
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.9);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(5, 11, 29, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 4px 8px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #041126;
  font-size: 22px;
  font-weight: 900;
  border-radius: 14px;
  background: var(--lime);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.28);
  transform: rotate(-4deg);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.18;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.28em;
}

.app-nav {
  display: grid;
  gap: 8px;
  margin-top: 54px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  color: var(--muted);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item > span:first-child {
  color: #68707e;
  font-size: 21px;
  text-align: center;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.24);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.24), rgba(56, 189, 248, 0.04));
}

.nav-item.is-active::before {
  position: absolute;
  left: -19px;
  width: 3px;
  height: 25px;
  content: "";
  border-radius: 99px;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.72);
}

.nav-item.is-active > span:first-child {
  color: var(--lime);
}

.rail-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.status-dot {
  display: block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #747b88;
  box-shadow: 0 0 0 5px rgba(116, 123, 136, 0.11);
}

.simulation-dot {
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16), 0 0 14px rgba(56, 189, 248, 0.42);
}

.hardware-dot {
  background: #5eead4;
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.14), 0 0 18px rgba(45, 212, 191, 0.8);
}

.main-area {
  min-width: 0;
  padding: 26px clamp(26px, 4vw, 64px) 42px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1500px;
  min-height: 68px;
  margin: 0 auto 40px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.top-bar h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.04em;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 216px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.connection-status strong,
.connection-status small {
  display: block;
}

.connection-status strong {
  font-size: 12px;
}

.connection-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.app-view {
  max-width: 1500px;
  margin: 0 auto;
  animation: view-in 280ms ease both;
}

.app-view[hidden] {
  display: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-copy,
.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.hero-copy h2,
.section-intro h2,
.empty-state h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy p:last-child,
.section-intro p:last-child,
.empty-state p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.mode-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.chip {
  min-width: 68px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.chip.is-active {
  color: #041126;
  font-weight: 800;
  background: var(--lime);
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.32fr);
  gap: 18px;
}

.piano-card,
.control-card,
.now-playing,
.empty-state,
.settings-list,
.track-list,
.light-preset {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 37, 74, 0.94), rgba(6, 15, 38, 0.97));
  box-shadow: var(--shadow);
}

.piano-card,
.control-card,
.now-playing,
.empty-state,
.settings-list,
.track-list {
  border-radius: var(--radius);
}

.piano-card,
.control-card {
  padding: 22px;
}

.card-heading,
.card-heading > div {
  display: flex;
  align-items: center;
}

.card-heading {
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 22px;
}

.card-heading > div {
  gap: 11px;
}

.card-heading h3 {
  margin: 0;
  font-size: 15px;
}

.card-index {
  color: var(--lime);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 10px;
}

.keyboard-hint {
  color: var(--muted);
  font-size: 10px;
}

.piano-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.audio-status::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: #79808d;
}

.audio-status[data-status="loading"]::before {
  border: 2px solid rgba(56, 189, 248, 0.24);
  border-top-color: var(--lime);
  background: transparent;
  animation: audio-spin 800ms linear infinite;
}

.audio-status[data-status="ready"] {
  color: var(--lime);
}

.audio-status[data-status="ready"]::before {
  background: var(--lime);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.audio-status[data-status="error"] {
  color: var(--orange);
}

.audio-status[data-status="error"]::before {
  background: var(--orange);
}

.preview-scale {
  min-height: 40px;
  padding: 0 13px;
  color: #041126;
  font-size: 11px;
  font-weight: 800;
  border: 0;
  border-radius: 10px;
  background: var(--lime);
}

.preview-scale:disabled {
  color: #69707a;
  background: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

@keyframes audio-spin {
  to { transform: rotate(360deg); }
}

.piano-keys {
  display: grid;
  grid-template-columns: repeat(12, minmax(30px, 1fr));
  gap: 5px;
  min-height: clamp(190px, 26vw, 330px);
  padding: 8px;
  border-radius: 14px;
  background: #030817;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
}

.piano-key {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  padding: 0 0 16px;
  overflow: hidden;
  color: #565b65;
  border: 0;
  border-radius: 8px 8px 11px 11px;
  background: linear-gradient(180deg, #f5f9ff, #c9dcf6);
  box-shadow: inset 0 -10px 18px rgba(15, 42, 82, 0.14), 0 5px 0 #5d7ba7;
  transition: transform 80ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.piano-key::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  transition: opacity 100ms ease;
}

.piano-key span {
  position: relative;
  z-index: 1;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 9px;
}

.piano-key:hover {
  filter: brightness(1.08);
}

.piano-key.is-pressed,
.piano-key:active {
  color: #0b0d0e;
  box-shadow: inset 0 -4px 16px rgba(4, 17, 38, 0.22), 0 1px 0 var(--blue-deep), 0 0 28px rgba(56, 189, 248, 0.42);
  transform: translateY(4px);
}

.piano-key.is-pressed::before,
.piano-key:active::before {
  opacity: 1;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
}

/* 灯光效果：极光流动（青紫渐变） */
[data-led-effect="aurora"] .piano-key.is-pressed,
[data-led-effect="aurora"] .piano-key:active {
  box-shadow: inset 0 -4px 16px rgba(4, 17, 38, 0.22), 0 1px 0 #7c3aed, 0 0 28px rgba(180, 255, 50, 0.42);
}
[data-led-effect="aurora"] .piano-key.is-pressed::before,
[data-led-effect="aurora"] .piano-key:active::before {
  background: linear-gradient(180deg, #b4ff32, #7c3aed);
}

/* 灯光效果：日落余晖（橙红渐变） */
[data-led-effect="sunset"] .piano-key.is-pressed,
[data-led-effect="sunset"] .piano-key:active {
  box-shadow: inset 0 -4px 16px rgba(4, 17, 38, 0.22), 0 1px 0 #c2410c, 0 0 28px rgba(255, 122, 58, 0.42);
}
[data-led-effect="sunset"] .piano-key.is-pressed::before,
[data-led-effect="sunset"] .piano-key:active::before {
  background: linear-gradient(180deg, #ff7a3a, #ff495c);
}

/* 灯光效果：纯白舞台（白色） */
[data-led-effect="mono"] .piano-key.is-pressed,
[data-led-effect="mono"] .piano-key:active {
  box-shadow: inset 0 -4px 16px rgba(4, 17, 38, 0.22), 0 1px 0 #9ca3af, 0 0 28px rgba(255, 255, 255, 0.38);
}
[data-led-effect="mono"] .piano-key.is-pressed::before,
[data-led-effect="mono"] .piano-key:active::before {
  background: linear-gradient(180deg, #ffffff, #9ca3af);
}

.note-strip {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  margin: 14px 8px 0;
  color: #747b87;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 9px;
  text-align: center;
}

.control-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.range-control {
  display: grid;
  gap: 10px;
}

.range-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-control b {
  font-size: 12px;
}

.range-control output {
  color: var(--lime);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 8px 0;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--lime) var(--range-fill, 30%), rgba(255, 255, 255, 0.11) var(--range-fill, 30%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  border: 4px solid #101218;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 1px var(--lime), 0 0 14px rgba(202, 255, 50, 0.28);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 4px solid #101218;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
}

.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.secondary-button:hover {
  border-color: rgba(56, 189, 248, 0.55);
}

.library-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-search-wrap input {
  width: min(300px, 34vw);
  min-height: 44px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(5, 11, 29, 0.66);
}

.music-search-wrap input::placeholder {
  color: var(--muted);
}

.library-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 37, 74, 0.94), rgba(6, 15, 38, 0.97));
  box-shadow: var(--shadow);
}

.music-status {
  min-height: 52px;
  padding: 17px 22px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.music-status[data-status="ready"] {
  color: var(--blue-bright);
}

.music-status[data-status="error"] {
  color: #ff8f9f;
}

.music-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.38fr);
  gap: 18px;
}

.track-list {
  min-height: 480px;
  padding: 12px;
}

.library-panel .track-list {
  max-height: min(66vh, 680px);
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 75px;
  padding: 9px 15px;
  color: var(--text);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
}

.track-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  border: 0;
  background: transparent;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.track-teach {
  min-height: 34px;
  padding: 0 12px;
  color: #dff6ff;
  font-size: 11px;
  font-weight: 750;
  border: 1px solid rgba(56, 189, 248, .42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .52), rgba(56, 189, 248, .12));
}

.track-teach:hover {
  border-color: var(--blue-bright);
  background: linear-gradient(135deg, rgba(37, 99, 235, .78), rgba(56, 189, 248, .2));
}

.track-row + .track-row {
  margin-top: 4px;
}

.track-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.track-row.is-active {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), transparent);
}

.track-number {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 11px;
}

.track-copy b,
.track-copy small {
  display: block;
}

.track-copy b {
  font-size: 14px;
}

.track-copy small,
.track-duration {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.now-playing {
  padding: 24px;
}

.song-volume-control {
  margin-top: 22px;
}

.album-art {
  display: grid;
  width: 100%;
  aspect-ratio: 1.6;
  margin-bottom: 22px;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  background:
    radial-gradient(circle at 24% 28%, rgba(56, 189, 248, 0.9), transparent 22%),
    radial-gradient(circle at 74% 65%, rgba(37, 99, 235, 0.75), transparent 28%),
    linear-gradient(135deg, #1746a2, #07132e 65%);
}

.album-art::before {
  position: absolute;
  content: "";
}

.album-art span {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(36px, 5vw, 70px);
  font-weight: 900;
  letter-spacing: -0.08em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.now-playing h3 {
  margin: 0;
  font-size: 22px;
}

.now-playing > p:not(.eyebrow) {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.time-row,
.player-controls,
.repeat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-row {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 10px;
}

.player-controls {
  justify-content: center;
  gap: 14px;
  margin: 20px 0;
}

.player-controls button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.player-controls .play-button {
  width: 58px;
  height: 58px;
  padding-left: 4px;
  color: #07090b;
  border: 0;
  background: var(--blue-bright);
}

.player-controls button:disabled,
.now-playing input:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.repeat-row {
  gap: 12px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
}

.repeat-row select {
  min-height: 40px;
  padding: 0 10px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.music-player-error {
  margin: 14px 0 0;
  color: #ff8f9f;
  font-size: 11px;
  line-height: 1.5;
}

#browser-audio {
  display: none;
}

.player-lyrics {
  display: grid;
  gap: 5px;
  margin: 4px 0 18px;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(255, 255, 255, .018));
}

.lyrics-line {
  min-width: 0;
  padding: 2px 0;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
}

.lyrics-line:not(:disabled):hover { color: #dff6ff; }
.lyrics-line:disabled { cursor: default; opacity: 1; }
.lyrics-current { color: #e0f2fe; font-size: 13px; font-weight: 800; }

.track-curated {
  padding: 4px 8px;
  color: #f9a8d4;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(244, 114, 182, .28);
  border-radius: 999px;
  background: rgba(244, 114, 182, .08);
}


.memory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.memory-clock-card,
.memory-days-card,
.memory-weather-card,
.memory-news-card,
.memory-photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 37, 74, 0.96), rgba(6, 15, 38, 0.98));
  box-shadow: var(--shadow);
}

.memory-weather-card,
.memory-news-card {
  min-height: 230px;
  padding: clamp(24px, 3vw, 38px);
}

.memory-weather-card {
  background:
    radial-gradient(circle at 82% 18%, rgba(125, 211, 252, .24), transparent 30%),
    linear-gradient(145deg, rgba(17, 50, 91, .96), rgba(6, 15, 38, .98));
}

.memory-weather-card h3,
.memory-news-card h3 { margin: 8px 0 0; font-size: 22px; }
.memory-weather-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.weather-locate-button {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: #dbeafe;
  font-size: 11px;
  border: 1px solid rgba(125, 211, 252, .28);
  border-radius: 999px;
  background: rgba(56, 189, 248, .09);
}
.weather-locate-button:hover { background: rgba(56, 189, 248, .18); }
.weather-locate-button:disabled { cursor: wait; opacity: .6; }
.memory-weather-card strong { display: block; margin-top: 24px; color: #e0f2fe; font-size: 56px; line-height: 1; }
.memory-weather-card > p { margin: 10px 0 5px; color: var(--blue-bright); font-size: 16px; }
.memory-weather-card > small,
.memory-news-card > small { color: var(--muted); font-size: 10px; }

.memory-news-card ol {
  display: grid;
  gap: 13px;
  margin: 22px 0 18px;
  padding-left: 22px;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
}

.memory-news-card li::marker { color: #f9a8d4; font-weight: 800; }

.memory-letter-card {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 190px;
  overflow: hidden;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid rgba(244, 114, 182, .3);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 50%, rgba(244, 114, 182, .18), transparent 30%),
    linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(6, 15, 38, .98));
  box-shadow: var(--shadow);
}

.memory-letter-card h3 { margin: 8px 0 10px; font-size: clamp(25px, 3vw, 40px); }
.memory-letter-card p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.memory-letter-card button { position: relative; z-index: 1; flex: 0 0 auto; }
.letter-heart {
  position: absolute;
  right: 14%;
  color: rgba(244, 114, 182, .12);
  font-size: 150px;
  line-height: 1;
  transform: rotate(-10deg);
}

.main-area::before {
  position: fixed;
  top: 15%;
  right: 3vw;
  z-index: -1;
  color: rgba(244, 114, 182, .08);
  font-size: clamp(70px, 10vw, 150px);
  content: "♥";
  pointer-events: none;
  transform: rotate(12deg);
}

.story-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 22px;
  place-items: center;
  background: rgba(1, 6, 19, .82);
  backdrop-filter: blur(14px);
}

.story-dialog[hidden] { display: none; }
.story-dialog-card {
  position: relative;
  width: min(540px, 100%);
  padding: clamp(28px, 5vw, 52px);
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, .25);
  border-radius: 28px;
  background: linear-gradient(150deg, #102750, #071126 70%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}

.story-dialog-card h2 { margin: 16px 0 12px; font-size: clamp(30px, 6vw, 48px); }
.story-dialog-card > p { color: #b7c9e8; line-height: 1.85; }
.story-step { color: var(--blue-bright); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.story-heart {
  position: absolute;
  top: -34px;
  right: -14px;
  color: rgba(244, 114, 182, .14);
  font-size: 150px;
  transform: rotate(14deg);
}
.story-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.story-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  color: #dbeafe;
  font-size: 24px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
}
.memory-letter-paper {
  color: #19304f;
  border-color: rgba(244, 114, 182, .35);
  background: linear-gradient(145deg, #fff9f1, #f8ecdf);
}
.memory-letter-paper .story-step { color: #b45378; }
.memory-letter-paper > p { color: #42526a; }
.memory-letter-paper .letter-signature { margin-top: 28px; color: #9d4668; text-align: right; }
body.story-open { overflow: hidden; }

.memory-clock-card,
.memory-days-card {
  min-height: 300px;
  padding: clamp(28px, 4vw, 52px);
}

.memory-clock-card::after,
.memory-days-card::after {
  position: absolute;
  width: 220px;
  height: 220px;
  content: "";
  border-radius: 50%;
  background: rgba(45, 126, 255, 0.18);
  filter: blur(44px);
  pointer-events: none;
}

.memory-clock-card::after { right: -70px; bottom: -100px; }
.memory-days-card::after { top: -110px; left: -90px; }

.memory-clock,
.memory-days-card strong {
  position: relative;
  z-index: 1;
  display: block;
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", monospace;
  letter-spacing: -0.06em;
}

.memory-clock {
  margin-top: 44px;
  font-size: clamp(46px, 7vw, 104px);
  line-height: 0.95;
}

.memory-date {
  position: relative;
  z-index: 1;
  margin: 24px 0 0;
  color: var(--blue-bright);
  font-size: 14px;
}

.memory-days-copy {
  position: relative;
  z-index: 1;
  margin: 42px 0 0;
  color: var(--muted);
}

.memory-days-card strong {
  margin-top: 4px;
  color: var(--blue-bright);
  font-size: clamp(68px, 9vw, 128px);
  line-height: 0.95;
}

.memory-days-card strong small {
  margin-left: 12px;
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 0;
}

.anniversary-control {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 11px;
}

.anniversary-control input {
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  color-scheme: dark;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-soft);
}

.memory-photo-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  align-items: center;
  min-height: 290px;
  gap: 40px;
  padding: clamp(28px, 4vw, 52px);
}

.memory-photo-card h3 {
  margin: 12px 0 16px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
}

.memory-photo-copy > p:last-child {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.8;
}

.photo-gallery,
.photo-stage {
  min-width: 0;
}

.photo-stage {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-radius: 18px;
}

.photo-stage > img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border: 1px solid rgba(110, 174, 255, 0.28);
  border-radius: 18px;
}

.photo-placeholder {
  position: relative;
  display: grid;
  min-height: 190px;
  overflow: hidden;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(110, 174, 255, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 30%, rgba(112, 182, 255, 0.48), transparent 24%),
    linear-gradient(140deg, #2458a5, #112755 58%, #08132e);
}

.photo-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.photo-thumbs button {
  flex: 0 0 54px;
  width: 54px;
  height: 44px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
}

.photo-thumbs button.is-active {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 2px rgba(63, 142, 255, 0.16);
}

.photo-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.photo-placeholder span {
  font-size: clamp(56px, 8vw, 108px);
  font-weight: 900;
  letter-spacing: -0.1em;
  opacity: 0.72;
}

.photo-placeholder i {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: #8fc7ff;
  font-size: 26px;
  font-style: normal;
}

.empty-state {
  position: relative;
  display: grid;
  min-height: 520px;
  padding: 70px;
  overflow: hidden;
  place-content: center;
  text-align: center;
}

.empty-state::before,
.empty-state::after {
  position: absolute;
  width: 330px;
  height: 330px;
  content: "";
  border-radius: 50%;
  filter: blur(1px);
}

.empty-state::before {
  top: -190px;
  right: -100px;
  border: 1px solid rgba(202, 255, 50, 0.22);
  box-shadow: 0 0 80px rgba(202, 255, 50, 0.06);
}

.empty-state::after {
  bottom: -240px;
  left: -80px;
  border: 1px solid rgba(159, 120, 255, 0.3);
}

.empty-number {
  position: absolute;
  top: 24px;
  left: 28px;
  color: rgba(255, 255, 255, 0.06);
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
}

.empty-state .outline-badge {
  margin: 24px auto 0;
}

.outline-badge {
  display: inline-grid;
  min-height: 30px;
  padding: 0 11px;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
}

.light-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.light-preset {
  display: grid;
  min-height: 330px;
  padding: 20px;
  color: var(--text);
  text-align: left;
  border-radius: var(--radius);
}

.light-preset.is-active {
  border-color: rgba(202, 255, 50, 0.58);
  box-shadow: var(--shadow), 0 0 0 3px rgba(202, 255, 50, 0.08);
}

.light-swatch {
  min-height: 200px;
  margin-bottom: 22px;
  border-radius: 14px;
  background-color: #151820;
}

.light-swatch.aurora {
  background:
    radial-gradient(circle at 25% 30%, rgba(202, 255, 50, 0.9), transparent 20%),
    radial-gradient(circle at 70% 60%, rgba(54, 231, 226, 0.8), transparent 26%),
    linear-gradient(135deg, #492f99, #0b1721);
}

.light-swatch.sunset {
  background:
    radial-gradient(circle at 60% 55%, #ffb35a, transparent 20%),
    radial-gradient(circle at 30% 70%, #ff495c, transparent 28%),
    linear-gradient(150deg, #34204a, #120d18);
}

.light-swatch.mono {
  background:
    linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.72) 21%, rgba(255, 255, 255, 0.08) 24%, transparent 35%),
    linear-gradient(145deg, #313743, #090b0f);
}

.light-preset b,
.light-preset small {
  display: block;
}

.light-preset b {
  font-size: 16px;
}

.light-preset small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.settings-list {
  overflow: hidden;
}

.settings-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 116px;
  padding: 24px 28px;
}

.settings-list article + article {
  border-top: 1px solid var(--line);
}

.settings-list b {
  font-size: 15px;
}

.settings-list p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.settings-list article > span:not(.outline-badge) {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 11px;
}

.wifi-settings-card {
  align-items: flex-start !important;
}

.wifi-settings-copy {
  flex: 1 1 260px;
}

.wifi-settings-controls {
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
}

.wifi-select-row,
.wifi-action-row {
  display: flex;
  gap: 10px;
}

.wifi-settings-controls select,
.wifi-settings-controls input {
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(5, 17, 43, 0.78);
}

.wifi-settings-controls select {
  flex: 1;
}

.wifi-settings-controls small {
  color: var(--accent);
  line-height: 1.5;
}

.storage-upload-card {
  gap: 24px;
}

.storage-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: 570px;
}

.storage-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.storage-picker:has(input:disabled) {
  cursor: not-allowed;
  opacity: .48;
}

.storage-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.storage-upload-controls small {
  flex-basis: 100%;
  color: var(--muted);
  text-align: right;
}

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid rgba(202, 255, 50, 0.22);
  border-radius: 12px;
  background: rgba(22, 25, 32, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 188px minmax(0, 1fr); }
  .main-area { padding-inline: 24px; }
  .side-rail { padding-inline: 13px; }
  .nav-item.is-active::before { left: -14px; }
  .hero-copy h2, .section-intro h2 { font-size: clamp(30px, 4.2vw, 48px); }
  .piano-card, .control-card { padding: 18px; }
  .piano-keys { min-height: 210px; gap: 3px; padding: 6px; }
  .stage-grid { grid-template-columns: minmax(0, 1fr) 250px; }
}

@media (max-width: 900px) {
  .brand > span:last-child { display: none; }
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .side-rail { align-items: center; padding-inline: 10px; }
  .app-nav { width: 100%; }
  .nav-item { grid-template-columns: 1fr; padding: 0; text-align: center; }
  .nav-item > span:last-child { display: none; }
  .nav-item.is-active::before { left: -11px; }
  .rail-footer { justify-content: center; width: 100%; padding-inline: 0; }
  .rail-footer span:last-child { display: none; }
  .main-area { padding: 20px 20px 32px; }
  .top-bar { margin-bottom: 28px; }
  .stage-grid { grid-template-columns: 1fr; }
  .control-card { display: grid; grid-template-columns: repeat(3, 1fr); }
  .control-card .card-heading { grid-column: 1 / -1; margin-bottom: 0; }
  .music-layout { grid-template-columns: 1fr; }
  .track-list { min-height: auto; }
  .now-playing { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 24px; }
  .album-art { grid-row: 1 / 9; aspect-ratio: 1; margin: 0; }
  .memory-grid { grid-template-columns: 1fr; }
  .memory-photo-card { grid-column: auto; }
  .light-grid { grid-template-columns: 1fr; }
  .light-preset { grid-template-columns: 180px 1fr; align-items: center; min-height: 150px; gap: 20px; }
  .light-swatch { grid-row: 1 / 3; min-height: 120px; margin: 0; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; min-height: auto; }
  .side-rail {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: block;
    width: auto;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    border-right: 0;
  }
  .brand, .rail-footer { display: none; }
  .app-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; height: 100%; margin: 0; }
  .nav-item { display: flex; flex-direction: column; gap: 3px; justify-content: center; min-height: 56px; font-size: 10px; }
  .nav-item > span:first-child { font-size: 17px; }
  .nav-item > span:last-child { display: block; }
  .nav-item.is-active::before { top: -7px; left: 50%; width: 22px; height: 3px; transform: translateX(-50%); }
  .top-bar { align-items: flex-start; }
  .connection-status { min-width: auto; }
  .connection-status small { display: none; }
  .hero-copy, .section-intro { align-items: flex-start; flex-direction: column; }
  .library-actions { width: 100%; }
  .music-search-wrap { flex: 1; }
  .music-search-wrap input { width: 100%; }
  .piano-keys { overflow: hidden; grid-template-columns: repeat(12, minmax(20px, 1fr)); }
  .piano-card-actions { align-items: flex-end; flex-direction: column; }
  .audio-status { white-space: normal; text-align: right; }
  .note-strip { display: none; }
  .control-card { grid-template-columns: 1fr; }
  .control-card .card-heading { grid-column: auto; }
  .now-playing { display: block; }
  .album-art { aspect-ratio: 1.7; margin-bottom: 22px; }
  .memory-photo-card { grid-template-columns: 1fr; }
  .empty-state { min-height: 430px; padding: 40px 24px; }
  .light-preset { display: grid; grid-template-columns: 120px 1fr; min-height: 124px; }
  .light-swatch { min-height: 90px; }
  .toast-region { right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .memory-letter-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .main-area { padding-inline: 14px; }
  .top-bar { display: grid; gap: 14px; }
  .connection-status { justify-self: start; }
  .mode-switch { width: 100%; }
  .chip { flex: 1; min-width: 0; }
  .hero-copy h2, .section-intro h2, .empty-state h2 { font-size: 34px; }
  .piano-card, .control-card, .now-playing { padding: 16px; }
  .memory-clock-card, .memory-days-card, .memory-weather-card, .memory-news-card, .memory-photo-card { padding: 24px 20px; }
  .memory-clock-card, .memory-days-card { min-height: 250px; }
  .memory-clock { margin-top: 36px; font-size: clamp(42px, 14vw, 68px); }
  .memory-days-card strong { font-size: clamp(64px, 23vw, 96px); }
  .anniversary-control { align-items: flex-start; flex-direction: column; }
  .anniversary-control input { width: 100%; }
  .photo-placeholder { min-height: 160px; }
  .photo-stage > img { height: 220px; }
  .audio-status { display: none; }
  .settings-list article { align-items: flex-start; flex-direction: column; }
  .light-preset { display: block; }
  .light-swatch { margin-bottom: 16px; }
  .story-actions { align-items: stretch; flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Persistent background music + expanded photo memories */
.memory-photo-card {
  display: block;
}

.memory-photo-copy {
  margin-bottom: 28px;
}

.photo-gallery {
  width: 100%;
}

.photo-placeholder[hidden] {
  display: none;
}

.photo-stage {
  display: grid;
  width: 100%;
  min-height: 300px;
  place-items: center;
  background: #020713;
}

.photo-stage > img {
  display: block;
  height: min(48vh, 520px);
  object-fit: contain;
  background: #020713;
  cursor: zoom-in;
}

.photo-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  font-size: 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(2, 7, 19, .68);
  backdrop-filter: blur(10px);
  transform: translateY(-50%);
}

.photo-nav:disabled {
  display: none;
}

.photo-nav-prev { left: 14px; }
.photo-nav-next { right: 14px; }

.photo-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 10px;
  color: rgba(255,255,255,.9);
  font: 11px/1 ui-monospace, "Cascadia Mono", monospace;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(2, 7, 19, .72);
  backdrop-filter: blur(10px);
}

.photo-thumbs {
  padding-bottom: 4px;
}

.photo-thumbs button {
  flex-basis: 68px;
  width: 68px;
  height: 54px;
}

.photo-wall {
  width: 100%;
  columns: 4 170px;
  column-gap: 10px;
  margin-top: 18px;
}

.photo-wall-item {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid rgba(110, 174, 255, 0.14);
  border-radius: 12px;
  background: #07132e;
}

.photo-wall-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 180ms ease, filter 180ms ease;
}

.photo-wall-item:hover img {
  filter: brightness(1.06);
  transform: scale(1.015);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px 80px;
  background: rgba(0, 0, 0, .93);
  backdrop-filter: blur(12px);
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 70px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 101;
  display: grid;
  place-items: center;
  color: white;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}

.lightbox-close {
  top: 22px;
  right: 22px;
  width: 48px;
  height: 48px;
  font-size: 30px;
}

.lightbox-nav {
  top: 50%;
  width: 54px;
  height: 54px;
  font-size: 36px;
  transform: translateY(-50%);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  padding: 8px 12px;
  color: rgba(255,255,255,.86);
  font: 12px/1 ui-monospace, "Cascadia Mono", monospace;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  transform: translateX(-50%);
}

body.lightbox-open {
  overflow: hidden;
}


.mini-player {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 44px 38px;
  align-items: center;
  gap: 8px;
  width: min(430px, calc(100vw - 48px));
  min-height: 84px;
  padding: 9px 11px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 18px;
  background: rgba(7, 19, 46, .92);
  box-shadow: 0 18px 52px rgba(0,0,0,.44);
  backdrop-filter: blur(18px);
  touch-action: none;
  user-select: none;
}

.mini-player.is-dragging {
  cursor: grabbing;
  box-shadow: 0 24px 70px rgba(0,0,0,.56), 0 0 0 1px rgba(56, 189, 248, .25);
}

.mini-player[hidden] {
  display: none;
}

.mini-player button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}

.mini-player .mini-player-play {
  width: 44px;
  height: 44px;
  color: #041126;
  border: 0;
  background: var(--blue-bright);
}

.mini-player-copy {
  min-width: 0;
  cursor: grab;
}

.mini-player-copy b,
.mini-player-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-player-progress {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 3px 2px;
}

.mini-player-progress input {
  min-width: 0;
  height: 18px;
  margin: 0;
  touch-action: pan-x;
}

.mini-player-progress output {
  min-width: 72px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 8px;
  text-align: right;
}

.mini-player-copy b {
  font-size: 13px;
}

.mini-player-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .photo-wall {
    columns: 2 130px;
  }

  .photo-lightbox {
    padding: 76px 14px 70px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 18px;
    width: 46px;
    height: 46px;
    transform: none;
  }

  .lightbox-prev { left: 18px; }
  .lightbox-next { right: 18px; }

  .mini-player {
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    min-height: 82px;
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .photo-stage {
    min-height: 220px;
  }

  .photo-stage > img {
    height: 300px;
  }

  .photo-wall {
    columns: 2 110px;
  }

  .photo-thumbs button {
    flex-basis: 58px;
    width: 58px;
    height: 46px;
  }
}

/* ===== 访问密码门（隐私遮罩）===== */

body.access-locked {
  overflow: hidden;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
  /* 完全不透明深色遮罩，密码输入前看不到任何内容 */
  background: var(--bg);
  backdrop-filter: none;
}

.access-card {
  width: 100%;
  max-width: 380px;
  padding: 48px 36px 40px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  text-align: center;
}

.access-heart {
  font-size: 40px;
  color: var(--blue-bright);
  animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.3); }
  30%      { transform: scale(1); }
  45%      { transform: scale(1.15); }
  60%      { transform: scale(1); }
}

.access-card .eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
  margin: 0;
}

.access-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.access-card > p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.access-card label[for="access-password"] {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.access-card input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-raised);
  color: var(--text);
  font-size: 16px;
  font-family: monospace;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.access-card input[type="password"]:focus {
  border-color: var(--blue-bright);
}

.access-card input[type="password"]::placeholder {
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.15);
}

.access-card button[type="submit"] {
  width: 100%;
  padding: 12px 24px;
  border-radius: 999px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.access-card button[type="submit"]:hover {
  background: var(--blue-bright);
}

.access-card button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.access-error {
  min-height: 18px;
  font-size: 12px;
  color: var(--orange);
}

@media (max-width: 520px) {
  .access-card {
    padding: 36px 24px 32px;
  }

  .access-card h1 {
    font-size: 21px;
  }
}
