/* 看海 · Kan Hai — styles */

:root {
  --glass-bg: rgba(6, 12, 22, 0.46);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.66);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

/* 键盘可达性：深色玻璃上默认轮廓不可见，用与提示卡一致的蓝色光晕做焦点环 */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(140, 200, 255, 0.55), 0 0 12px rgba(140, 200, 255, 0.28);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #061224;
  font-family: var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: #061224;
}

#gl2 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  visibility: hidden;
}

#sea {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ---------- 标题 ---------- */

.brand {
  position: fixed;
  top: 30px;
  left: 34px;
  z-index: 5;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.5em;
  margin-right: -0.5em; /* 抵消末字间距，视觉居中 */
  color: var(--text);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}

.brand p {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.55);
}

/* ---------- 时钟 ---------- */

.clock {
  position: fixed;
  top: 30px;
  right: 34px;
  z-index: 5;
  text-align: right;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.clock-time {
  display: block;
  font-size: 22px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.clock-phase {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6), 0 0 6px rgba(0, 0, 0, 0.3);
}

/* ---------- 声音提示 ---------- */

.hint {
  position: fixed;
  left: 50%;
  bottom: 138px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0.9s;
  animation: hint-pulse 3.2s ease-in-out infinite;
}

.hint.show {
  opacity: 1;
  visibility: visible;
}

@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.12); }
  50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

/* ---------- 控制栏 ---------- */

.bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 10;
  max-width: min(880px, calc(100vw - 28px));
  padding: 13px 22px 15px;
  border-radius: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* UI 呼出要快（定位感），淡出仍从容 */
body:not(.idle) .bar { transition-duration: 0.22s; }

.bar.hidden {
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-bottom: 12px;
}

.presets button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.presets button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.presets button.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* 底栏空间不足时禁止「实时」逐字竖排折行（CJK 可在任意字符间断行，挤压时滑杆让位） */
.controls .switch span { white-space: nowrap; }

.time-icon {
  display: inline-flex;
  color: var(--text-dim);
}

.time-icon .icon-moon { display: none; }
body.night .time-icon .icon-sun { display: none; }
body.night .time-icon .icon-moon { display: inline; }

/* 滑杆 */

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: min(240px, 38vw);
  height: 18px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.65), 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.18); }

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
}

.readout {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--text);
  min-width: 42px;
  text-align: center;
}

/* 开关 */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.switch input { display: none; }

.switch i {
  position: relative;
  width: 32px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.3s ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.switch input:checked + i { background: rgba(120, 200, 255, 0.55); }
.switch input:checked + i::after { transform: translateX(15px); }

.switch span {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.16);
}

/* 音频按钮 */

.audio { position: relative; display: flex; gap: 6px; }

.round {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.round:hover { background: rgba(255, 255, 255, 0.16); }
.round:active { transform: scale(0.94); }

#audioBtn .icon-off { display: none; }
body.audio-on #audioBtn .icon-on { display: none; }
body.audio-on #audioBtn .icon-off { display: inline; }
body.audio-on #audioBtn { background: rgba(120, 200, 255, 0.28); border-color: rgba(160, 220, 255, 0.4); }

/* 元素开关（帆船/冲浪）：亮起 = 显示 */
.round.active { background: rgba(120, 200, 255, 0.28); border-color: rgba(160, 220, 255, 0.4); }
.round:not(.active) { opacity: 0.45; }

.audio-panel {
  position: absolute;
  right: 0;
  bottom: 46px;
  min-width: 178px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(6, 13, 24, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  gap: 11px;
}

.audio-panel.open { display: flex; }

.audio-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.audio-panel input[type="range"] { width: 96px; flex: 1; }

/* 纯环境音开关行 */
.audio-panel .pure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.audio-panel .pure-row button {
  appearance: none;
  flex: none;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  width: 30px;
  height: 17px;
  border-radius: 999px;
  padding: 2px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.audio-panel .pure-row button i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.25s ease, background 0.25s ease;
}

.audio-panel .pure-row button.on {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.45);
}
.audio-panel .pure-row button.on i { transform: translateX(13px); background: #fff; }

#volMusic:disabled { opacity: 0.3; }

/* ---------- 空闲淡出 ---------- */

body.idle .brand, body.idle .clock { opacity: 0.28; }

/* 指针：静止观看 4.6s 后才隐藏（body.idle），一旦移动立即恢复可见 */
#sea { cursor: default; }
body.idle #sea { cursor: none; }

/* 天气（云量）面板 */

.weather { position: relative; }

.weather-panel {
  position: absolute;
  right: 0;
  bottom: 46px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(6, 13, 24, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  display: none;
  white-space: nowrap;
}

.weather-panel.open { display: block; }

.weather-panel .w-row { display: flex; gap: 3px; }

.weather-panel button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.weather-panel button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.weather-panel button.active { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---------- 语言切换（底栏弹出菜单） ---------- */

.lang { position: relative; }

.lang-panel {
  position: absolute;
  right: 0;
  bottom: 46px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(6, 13, 24, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.lang-panel.open { display: flex; }

.lang-panel button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 6px 16px 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  transition: background 0.25s ease, color 0.25s ease;
}

.lang-panel button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.lang-panel button.active { background: rgba(140, 200, 255, 0.2); color: #fff; }

/* ---------- 场景坞 ---------- */

.scene-dock {
  position: fixed;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  transition: opacity 0.7s ease;
}

/* 场景坞同样：呼出快、淡出慢 */
body:not(.idle) .scene-dock { transition-duration: 0.22s; }

.scene-dock button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}

.scene-dock button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.scene-dock button.active { background: rgba(255, 255, 255, 0.18); color: #fff; }

body.idle .scene-dock { opacity: 0; pointer-events: none; }

/* 场景切换暗场过渡 */
#fade {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #04070d;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
#fade.on { opacity: 1; }

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .brand { top: 20px; left: 22px; }
  .brand h1 { font-size: 23px; }
  .brand p { font-size: 9px; }
  .clock { top: 20px; right: 22px; }
  .clock-time { font-size: 17px; }
  .clock-phase { font-size: 9px; }
  .bar { bottom: 14px; padding: 10px 12px 12px; border-radius: 20px; }
  .presets button { font-size: 11px; padding: 5px 7px; letter-spacing: 0.05em; }
  .controls { gap: 8px; flex-wrap: wrap; }
  .controls .divider { display: none; }   /* 换行布局下分隔线会悬在行尾，直接隐藏 */
  .input-range-wrap { flex: 1; }
  .hint { bottom: 150px; font-size: 11px; padding: 10px 18px; }
}

/* ---------- 关于与授权 / 账户（共用弹窗样式） ---------- */

.about-backdrop,
.account-backdrop,
.share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 7, 13, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}
.about-backdrop.open,
.account-backdrop.open,
.share-backdrop.open { display: flex; }

/* 弹窗内文字允许选中复制（协议条款 / 邮箱 / 分享链接） */
.about-modal,
.account-modal,
.share-modal { user-select: text; }

.about-modal,
.account-modal {
  position: relative;
  width: min(460px, calc(100vw - 40px));
  max-height: min(80vh, 720px);
  overflow-y: auto;
  padding: 28px 30px 24px;
  border-radius: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  color: var(--text);
}

.about-modal h2,
.account-modal h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.3em;
}

.about-tagline {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.about-modal h3,
.account-modal h3 {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

.about-modal p, .about-list,
.account-modal p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}

.about-list { list-style: none; padding: 0; }
.about-list li { margin-bottom: 8px; }
.about-list b { font-weight: 600; }
.about-dim { color: var(--text-dim); font-size: 12px; }

.about-modal a {
  color: rgba(140, 200, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(140, 200, 255, 0.3);
}
.about-modal a:hover { border-bottom-color: rgba(140, 200, 255, 0.7); }

.about-fineprint {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.about-close {
  position: absolute;
  top: 14px;
  right: 16px;
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease;
}
.about-close:hover { background: rgba(255, 255, 255, 0.18); }

/* 分享弹窗（桌面端自定义分享面板） */
.share-modal {
  position: relative;
  width: min(360px, calc(100vw - 40px));
  padding: 18px 20px 20px;
  border-radius: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  color: var(--text);
}
.share-og {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}
.share-name {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #fff;
}
.share-url {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
}
.share-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.share-btn i {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.share-btn i svg { width: 20px; height: 20px; }
.share-btn span {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.share-btn:hover i {
  background: rgba(140, 200, 255, 0.2);
  border-color: rgba(140, 200, 255, 0.45);
  transform: translateY(-2px);
}
.share-btn:hover span { color: rgba(255, 255, 255, 0.85); }

/* PWA 添加到主屏引导横幅 */
.pwa-banner {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  background: rgba(6, 13, 24, 0.82);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  animation: pwa-in 0.4s ease;
}
@keyframes pwa-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.pwa-banner span {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}
.pwa-install {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid rgba(140, 200, 255, 0.5);
  background: rgba(140, 200, 255, 0.22);
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.pwa-install:hover { background: rgba(140, 200, 255, 0.32); }
.pwa-banner button[aria-label] {
  appearance: none;
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.pwa-banner button[aria-label]:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

@media (max-width: 640px) {
  .about-modal, .account-modal { padding: 22px 20px 18px; }
}

/* ---------- 场景坞扩展（分类标签 + 场景行） ---------- */

.scene-dock {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 7px 9px 6px;
  max-width: min(92vw, 760px);
}

.dock-tabs { display: flex; align-items: center; gap: 2px; padding: 0 5px; }

.dock-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  opacity: 0.72;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.dock-tab:hover { color: #fff; opacity: 1; }
.dock-tab.active { background: rgba(255, 255, 255, 0.1); color: #fff; opacity: 1; }

.dock-scenes { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.scene-dock button[hidden] { display: none; }

@media (max-width: 1100px) {
  .scene-dock { top: 72px; max-height: 60vh; overflow-y: auto; scrollbar-width: none; }
  .scene-dock::-webkit-scrollbar { display: none; }
  .scene-dock button { padding: 5px 9px; font-size: 11px; }
  .dock-tab { font-size: 10px; padding: 3px 8px; }
}

/* ---------- 付费提示卡 ---------- */

.paywall {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(3, 7, 13, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}
.paywall.open { display: flex; }

.paywall-card {
  width: min(420px, calc(100vw - 40px));
  padding: 26px 30px 24px;
  border-radius: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  color: var(--text);
  text-align: center;
}

.paywall-card h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.paywall-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.7; }
.paywall-card .paywall-pro { color: rgba(160, 210, 255, 0.95); }

.paywall-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

.paywall-actions button {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: var(--sans);
  transition: filter 0.2s ease, background 0.25s ease;
}

.paywall-primary {
  background: linear-gradient(135deg, rgba(120, 190, 255, 0.92), rgba(90, 150, 255, 0.92));
  color: #06121f;
  font-weight: 600;
}
.paywall-primary:hover { filter: brightness(1.1); }

.paywall-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
}
.paywall-ghost:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* ---------- 全屏模式 ---------- */

#fsBtn .fs-off { display: none; }
body.fs #fsBtn .fs-on { display: none; }
body.fs #fsBtn .fs-off { display: block; }

/* ---------- 启动封面（遮蔽首帧前的兜底渲染） ---------- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #061224;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.7s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }

#boot .boot-mark {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  color: rgba(235, 242, 250, 0.92);
}

#boot .boot-sub {
  font-size: 11px;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  color: rgba(235, 242, 250, 0.4);
  animation: boot-pulse 1.6s ease-in-out infinite;
}
@keyframes boot-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.8; }
}

/* ---------- 专业场景徽标与额度 ---------- */

.pro-badge {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  background: linear-gradient(135deg, #f5d98a, #d9a94a);
  color: #3a2c10;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 1.2;
  pointer-events: none;
}

.quota-chip {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.pro .quota-chip { display: none; }

.about-pro-row { margin-top: 10px; }
.about-pro-row .paywall-primary { width: 100%; }

/* ---------- 三档订阅卡 ---------- */

.paywall-close {
  position: absolute;
  top: 12px;
  right: 14px;
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}
.paywall-close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.paywall-desc { margin: 4px 0 16px; font-size: 13px; color: var(--text-dim); }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.plan-card:hover {
  border-color: rgba(140, 200, 255, 0.45);
  background: rgba(140, 200, 255, 0.07);
  transform: translateY(-2px);
}

.plan-best {
  border-color: rgba(245, 217, 138, 0.45);
  background: rgba(245, 217, 138, 0.06);
}
.plan-best:hover { border-color: rgba(245, 217, 138, 0.7); }

.plan-flag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f5d98a, #d9a94a);
  color: #3a2c10;
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-name { font-size: 13px; letter-spacing: 0.15em; color: var(--text-dim); }
.plan-price {
  margin: 8px 0 4px;
  font-size: 26px;
  font-weight: 300;
  color: #fff;
  font-family: var(--sans);
}
.plan-price span { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.plan-note { font-size: 10.5px; color: var(--text-dim); min-height: 15px; margin-bottom: 10px; }

.plan-buy {
  appearance: none;
  border: none;
  width: 100%;
  margin-top: auto;   /* 三卡说明文字行数不同，把按钮统一钉在卡片底部 */
  padding: 8px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.25s ease, color 0.25s ease;
}
.plan-card:hover .plan-buy { background: rgba(140, 200, 255, 0.85); color: #06121f; }
.plan-best .plan-buy { background: linear-gradient(135deg, #f5d98a, #d9a94a); color: #3a2c10; font-weight: 600; }
.plan-best .plan-buy:hover { filter: brightness(1.08); }

.plan-equal {
  margin: 14px 0 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.06em;
}

.plan-equal a {
  color: rgba(180, 216, 240, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(140, 200, 255, 0.45);
  padding-bottom: 1px;
}

.plan-equal a:hover { border-bottom-color: rgba(140, 200, 255, 0.85); }

.paywall-later {
  display: block;
  margin: 0 auto;
  padding: 9px 22px;
}
.paywall-later:hover { color: #fff; }

@media (max-width: 520px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { display: flex; flex-direction: row; align-items: center; text-align: left; gap: 10px; padding: 10px 12px; }
  .plan-name { width: 34px; }
  .plan-price { margin: 0; font-size: 20px; }
  .plan-note { flex: 1; margin: 0 0 8px; }
  .plan-buy { width: 84px; margin-top: 0; }
}

/* ---------- 账户弹窗 · 会员状态 ---------- */

.about-plan {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.about-plan-state {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #fff;
}
body.pro .about-plan-state { color: #f5d98a; }
.about-plan-detail { font-size: 12px; color: var(--text-dim); }
.about-sub {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}
.about-sub .auth-btn { padding: 4px 12px; font-size: 11px; flex-shrink: 0; }

/* ---------- 账户弹窗 · 登录表单 ---------- */

.about-auth { margin-top: 2px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form input {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
}
.auth-form input:focus { outline: none; border-color: rgba(140, 200, 255, 0.5); }
.auth-actions { display: flex; gap: 8px; }
.auth-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.auth-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.auth-msg { font-size: 11px; color: #f0a0a0; min-height: 14px; line-height: 1.4; }
.auth-user { display: flex; align-items: center; gap: 10px; }
.auth-email { font-size: 13px; color: var(--text); }

/* ---------- 设置浮层（偏好开关） ---------- */

.settings { position: relative; }

.settings-panel {
  position: absolute;
  right: 0;
  bottom: 46px;
  width: 240px;
  display: none;
  padding: 12px 14px 13px;
  border-radius: 18px;
  background: rgba(6, 13, 24, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}
.settings-panel.open { display: block; }

.settings-panel .switch { align-items: flex-start; }
.settings-panel .switch span { font-size: 13px; letter-spacing: 0.06em; color: var(--text); line-height: 1.5; }

.settings-note {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- 场景禅语 ---------- */

#quote {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(86vw, 720px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.3s ease;
}
#quote.show { opacity: 1; }

#quote .q-text {
  font-family: var(--serif);
  font-size: clamp(17px, 2.6vw, 24px);
  line-height: 2;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.65), 0 0 8px rgba(0, 0, 0, 0.35);
}

#quote .q-author {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.75), 0 0 6px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
  #quote { top: 34%; width: 88vw; }
  #quote .q-text { line-height: 1.9; letter-spacing: 0.1em; }
}


/* ---------- 冥想（呼吸引导 + 计时器） ---------- */

.meditate { position: relative; }

.med-panel {
  position: absolute;
  right: 0;
  bottom: 46px;
  width: 250px;
  display: none;
  padding: 13px 14px 15px;
  border-radius: 18px;
  background: rgba(6, 13, 24, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}
.med-panel.open { display: block; }

.med-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.med-tabs button {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.med-tabs button.active { background: rgba(255, 255, 255, 0.16); color: #fff; }

.med-patterns { display: flex; gap: 4px; margin-bottom: 6px; }
.med-patterns button {
  flex: 1;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.med-patterns button.active { background: rgba(140, 200, 255, 0.18); border-color: rgba(140, 200, 255, 0.4); color: #fff; }

.med-circle-wrap {
  position: relative;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.med-circle {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 190, 230, 0.4), rgba(150, 190, 230, 0.1) 70%);
  border: 1.5px solid rgba(185, 212, 240, 0.55);
  transform: scale(1);
  transition: transform 4s cubic-bezier(0.4, 0, 0.4, 1);
  box-shadow: 0 0 40px rgba(140, 180, 230, 0.25);
}
.med-phase {
  position: absolute;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}
.med-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.med-start {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 7px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.med-start:hover { background: rgba(255, 255, 255, 0.2); }
.med-start.on { background: rgba(140, 200, 255, 0.25); border-color: rgba(140, 200, 255, 0.45); }
.med-cue { flex-shrink: 0; }

.med-mins { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.med-mins button {
  flex: 1;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12px;
  padding: 5px 0;
  border-radius: 999px;
  cursor: pointer;
}
.med-mins button.active { background: rgba(140, 200, 255, 0.18); border-color: rgba(140, 200, 255, 0.4); color: #fff; }
.med-min-unit { font-size: 11px; color: var(--text-dim); margin-left: 2px; white-space: nowrap; }
.med-count {
  text-align: center;
  font-size: 30px;
  font-family: var(--serif);
  letter-spacing: 0.08em;
  color: #fff;
  padding: 14px 0 10px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.med-done { font-size: 11px; color: #f5d98a; letter-spacing: 0.1em; text-align: right; min-height: 14px; flex: 1; }

/* 冥想统计 */
.med-streak { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 4px 0 0; }
.med-streak b {
  font-family: var(--serif);
  font-size: 26px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.med-streak span { font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em; }
.med-week {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 5px; height: 48px; padding: 8px 2px 0;
}
.med-week i {
  width: 14px; height: 3px; min-height: 3px;
  border-radius: 3px 3px 1px 1px;
  background: rgba(255, 255, 255, 0.14);
}
.med-week i.has { background: rgba(140, 200, 255, 0.55); }
.med-week i.today { background: rgba(140, 200, 255, 0.9); box-shadow: 0 0 10px rgba(140, 200, 255, 0.35); }
.med-statlines { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.med-statlines > div {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--text-dim); letter-spacing: 0.05em;
}
.med-statlines b { color: rgba(255, 255, 255, 0.92); font-weight: 500; }
.med-stat-empty {
  margin-top: 8px; font-size: 11px; color: var(--text-dim);
  text-align: center; letter-spacing: 0.04em; line-height: 1.6;
}

/* 分享复制成功的 toast 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(6, 13, 24, 0.78);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 70;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .med-panel { width: 226px; }
  .med-circle-wrap { height: 124px; }
}

/* ---------- 浮层入场动画（弹出面板与弹窗；关闭仍为瞬时，避免拖沓感） ---------- */

@keyframes nagi-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes nagi-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nagi-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.audio-panel.open,
.weather-panel.open,
.lang-panel.open,
.med-panel.open,
.settings-panel.open {
  animation: nagi-panel-in 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.about-backdrop.open,
.account-backdrop.open,
.share-backdrop.open,
.paywall.open {
  animation: nagi-backdrop-in 0.22s ease;
}

.about-backdrop.open .about-modal,
.account-backdrop.open .account-modal,
.share-backdrop.open .share-modal,
.paywall.open .paywall-card {
  animation: nagi-modal-in 0.26s cubic-bezier(0.33, 1, 0.68, 1);
}

@media (prefers-reduced-motion: reduce) {
  .audio-panel.open, .weather-panel.open, .lang-panel.open,
  .med-panel.open, .settings-panel.open,
  .about-backdrop.open, .account-backdrop.open,
  .share-backdrop.open, .paywall.open,
  .about-backdrop.open .about-modal, .account-backdrop.open .account-modal,
  .share-backdrop.open .share-modal, .paywall.open .paywall-card {
    animation: none;
  }
}
