:root {
  --bg-deep: #060b16;
  --bg-card: rgba(13, 22, 40, 0.80);
  --bg-card-solid: #0f1a2e;
  --border-soft: rgba(148, 197, 255, 0.16);
  --border-glow: rgba(100, 223, 223, 0.55);
  --text-main: #edf4ff;
  --text-muted: #93a8c7;
  --accent-cyan: #64dfdf;
  --accent-teal: #48bfe3;
  --accent-gold: #ffd166;
  --accent-lavender: #a992fa;
  --accent-rose: #f29cb8;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #0f1e38 0%, #060b16 70%, #03060d 100%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#cosmos-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

/* 顶部栏 */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 10px;
  pointer-events: none;
  gap: 10px;
}

.brand,
.status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: wrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  color: var(--text-main);
  background: rgba(15, 26, 46, 0.76);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pill-subtle {
  color: var(--text-muted);
  font-size: 12px;
}

.pill-subtle.gamepad-ready {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
}

.voice-pill {
  border-color: rgba(100, 223, 223, 0.34);
  color: var(--accent-cyan);
}

.voice-pill.voice-off {
  border-color: var(--border-soft);
  color: var(--text-muted);
}

.pill-button {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.pill-button:hover {
  border-color: var(--border-glow);
  background: rgba(24, 42, 72, 0.88);
}

.pill-button:active {
  transform: scale(0.96);
}

/* 覆盖层屏幕（首页 & 结算页） */
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 16px 28px;
  overflow-y: auto;
}

#screen-complete.overlay-screen {
  justify-content: center;
}

.overlay-screen.active {
  display: flex;
}

.home-shell {
  width: 100%;
  max-width: 720px;
  margin: auto 0;
}

.hero-card,
.complete-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48);
  animation: fadeUp 0.32s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 顶部等级与陪伴天数条 */
.top-stats-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.focus-badge {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: rgba(100, 223, 223, 0.08);
  border: 1px solid rgba(100, 223, 223, 0.22);
  font-size: 12.5px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: rgba(255, 209, 102, 0.09);
  border: 1px solid rgba(255, 209, 102, 0.26);
  color: var(--accent-gold);
  font-size: 12.5px;
}

.sep-dot {
  opacity: 0.5;
}

.focus-bar-track {
  flex: 1;
  height: 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.focus-bar-track.large {
  height: 10px;
}

.focus-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan), var(--accent-gold));
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.focus-xp {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 系统每日温柔寄语 */
.whisper-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(169, 146, 250, 0.11), rgba(100, 223, 223, 0.07));
  border: 1px solid rgba(169, 146, 250, 0.24);
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #dce9ff;
}

.whisper-icon {
  color: var(--accent-gold);
  font-size: 14px;
  margin-top: 1px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* 四大游戏化模式 Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.07);
}

.mode-tab.selected {
  background: rgba(100, 223, 223, 0.14);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(100, 223, 223, 0.16);
}

.mode-emoji {
  font-size: 19px;
}

.mode-title {
  font-size: 13.5px;
  font-weight: 600;
}

.mode-tab small {
  font-size: 11px;
  color: var(--text-muted);
}

.mode-subpanel[hidden] {
  display: none;
}

.mode-info-box {
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 197, 255, 0.14);
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.mode-info-box strong {
  color: var(--text-main);
}

.rum-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.rum-stat-pill {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(169, 146, 250, 0.16);
  color: #d6ccff;
}

.eft-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.chip {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 197, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.chip.selected {
  background: rgba(255, 209, 102, 0.16);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 600;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.preset-card {
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.065);
}

.preset-card.selected {
  background: rgba(100, 223, 223, 0.12);
  border-color: var(--accent-cyan);
}

.preset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.preset-name {
  font-size: 14px;
  font-weight: 600;
}

.preset-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-gold);
  white-space: nowrap;
}

.preset-rhythm {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-bottom: 2px;
}

.preset-note {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.duration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.inline-label {
  margin-bottom: 0;
}

.duration-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.dur-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.dur-btn.selected {
  color: var(--bg-deep);
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 600;
}

.cta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.posture-preview-btn {
  padding: 0 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(100, 223, 223, 0.34);
  background: rgba(100, 223, 223, 0.09);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.posture-preview-btn:hover {
  background: rgba(100, 223, 223, 0.18);
}

.primary-cta {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #48bfe3 0%, #64dfdf 55%, #80ffdb 100%);
  color: #041322;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 26px rgba(100, 223, 223, 0.25);
  transition: transform 0.15s ease;
}

.primary-cta small {
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.78;
}

.primary-cta:active {
  transform: scale(0.985);
}

.secondary-cta {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

/* 今日温柔三小事模块 */
.daily-quests-box {
  background: rgba(8, 15, 29, 0.62);
  border: 1px solid rgba(148, 197, 255, 0.15);
  border-radius: 16px;
  padding: 14px 16px;
}

.quests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.quests-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-right: 8px;
}

.quests-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.quests-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 209, 102, 0.14);
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 700;
}

.quest-list {
  display: grid;
  gap: 9px;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.quest-item.done {
  border-color: rgba(100, 223, 223, 0.32);
  background: rgba(100, 223, 223, 0.06);
}

.quest-item-col {
  flex-direction: column;
  align-items: stretch;
}

.quest-top-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quest-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  flex: none;
}

.quest-item.done .quest-check {
  background: var(--accent-cyan);
  color: #041322;
}

.quest-body {
  flex: 1;
  min-width: 0;
}

.quest-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.quest-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 11.5px;
  cursor: pointer;
}

.affirm-quote-line {
  font-size: 12.5px;
  color: #dce9ff;
  margin-top: 3px;
  line-height: 1.45;
}

.hold-charge-btn {
  position: relative;
  overflow: hidden;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.08);
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  touch-action: none;
}

.charge-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 209, 102, 0.32);
  pointer-events: none;
}

.charge-label {
  position: relative;
  z-index: 1;
}

.glimmer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-left: 32px;
}

.glimmer-chip {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 197, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.glimmer-chip:hover {
  border-color: var(--accent-cyan);
  background: rgba(100, 223, 223, 0.12);
}

.glimmer-open-modal {
  color: var(--accent-gold);
  border-color: rgba(255, 209, 102, 0.28);
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.disclaimer {
  margin-top: 12px;
  font-size: 11.5px;
  color: rgba(147, 168, 199, 0.66);
  text-align: center;
}

/* 练习中 HUD */
.session-hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(60px + env(safe-area-inset-top, 0px)) 22px calc(18px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.session-hud.active {
  display: flex;
}

.session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}

.phase-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.step-pill {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: rgba(15, 26, 46, 0.55);
  border: 1px solid transparent;
}

.step-pill.active {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
  background: rgba(100, 223, 223, 0.12);
}

.step-pill.done {
  color: var(--accent-gold);
}

.step-sep {
  color: rgba(147, 168, 199, 0.4);
  font-size: 12px;
}

.btn-ghost {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: rgba(15, 26, 46, 0.65);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  pointer-events: auto;
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
}

.center-prompts {
  position: fixed;
  top: calc(102px + env(safe-area-inset-top, 0px));
  left: 16px;
  right: 16px;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
}

.prompt-main {
  font-size: clamp(21px, 3.6vw, 28px);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.prompt-sub {
  font-size: 13.5px;
  color: var(--text-muted);
}

.session-bottom {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  pointer-events: auto;
}

.Dual-pads {
  display: grid;
  grid-template-columns: 164px 1fr 164px;
  align-items: center;
  gap: 18px;
}

.touch-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  touch-action: none;
  cursor: pointer;
}

.pad-ring {
  --hold: 0;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(100, 223, 223, calc(0.08 + var(--hold) * 0.32)) 0%, rgba(13, 22, 40, 0.76) 72%),
    conic-gradient(from 180deg, rgba(100, 223, 223, 0.88) calc(var(--hold) * 360deg), rgba(148, 197, 255, 0.16) 0deg);
  border: 1.5px solid rgba(148, 197, 255, calc(0.22 + var(--hold) * 0.65));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 calc(var(--hold) * 26px) rgba(100, 223, 223, calc(var(--hold) * 0.4));
}

.pad-knob {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, var(--accent-cyan));
  box-shadow: 0 0 16px rgba(100, 223, 223, 0.6);
  opacity: 0.8;
  will-change: transform;
}

.touch-pad.active .pad-knob {
  opacity: 1;
}

.pad-caption {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.session-progress-box {
  background: rgba(13, 22, 40, 0.68);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
}

.session-track {
  height: 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 7px;
}

.session-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan), var(--accent-gold));
  transition: width 0.2s linear;
}

.sync-feedback {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 结算页与鼓励卡片 */
.complete-card {
  text-align: center;
  max-width: 540px;
}

.complete-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.4);
  color: var(--accent-gold);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.complete-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.constellation-meaning {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.encouragement-box {
  text-align: left;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(169, 146, 250, 0.13), rgba(100, 223, 223, 0.08));
  border: 1px solid rgba(169, 146, 250, 0.3);
  margin-bottom: 14px;
}

.enc-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 5px;
}

.enc-message {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
}

.milestone-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 209, 102, 0.16);
  border: 1px solid rgba(255, 209, 102, 0.48);
  color: var(--accent-gold);
  font-size: 13px;
  margin-bottom: 14px;
}

.milestone-banner[hidden] {
  display: none;
}

.reward-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.stat-item {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.stat-val {
  font-size: 16px;
  color: var(--accent-cyan);
}

.focus-upgrade-box {
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: rgba(100, 223, 223, 0.07);
  border: 1px solid rgba(100, 223, 223, 0.2);
  margin-bottom: 16px;
}

.focus-upgrade-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 7px;
}

.complete-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

/* 弹窗通用与手札/自我档案列表 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(3, 7, 15, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: 100%;
  max-width: 700px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head-actions {
  display: flex;
  gap: 8px;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.gallery-grid,
.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 11px;
}

.letters-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.gallery-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-item.unlocked {
  border-color: rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.06);
}

.gallery-item-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
}

.gallery-count {
  font-size: 11px;
  color: var(--accent-gold);
  white-space: nowrap;
}

.gallery-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 自我档案输入与展示 */
.archive-add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.archive-select {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 12.5px;
}

.archive-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 13px;
  user-select: text;
  -webkit-user-select: text;
}

.archive-submit-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent-cyan);
  color: #041322;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.archive-list-wrap {
  display: grid;
  gap: 8px;
}

.archive-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.archive-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  margin-right: 8px;
  background: rgba(100, 223, 223, 0.14);
  color: var(--accent-cyan);
}

.archive-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

.archive-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}

/* 实时人体坐姿与动作伴练视频窗 */
.posture-panel {
  position: fixed;
  right: 22px;
  top: calc(108px + env(safe-area-inset-top, 0px));
  width: 236px;
  z-index: 24;
  background: rgba(10, 19, 36, 0.84);
  border: 1px solid rgba(100, 223, 223, 0.28);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: width 0.24s ease, top 0.24s ease, right 0.24s ease, transform 0.24s ease;
}

.posture-panel[hidden] {
  display: none;
}

.posture-panel.expanded {
  top: 50%;
  right: 50%;
  transform: translate(50%, -50%);
  width: min(92vw, 530px);
  border-color: rgba(255, 209, 102, 0.48);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78), 0 0 0 100vmax rgba(3, 7, 15, 0.62);
}

.posture-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(148, 197, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.posture-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.live-rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.posture-controls {
  display: flex;
  gap: 5px;
}

.posture-ctrl-btn {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 197, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.posture-stage {
  position: relative;
  width: 100%;
  height: 196px;
  background: radial-gradient(circle at 50% 45%, rgba(19, 36, 66, 0.65), rgba(6, 11, 22, 0.92));
}

.posture-panel.expanded .posture-stage {
  height: 330px;
}

#posture-canvas,
#posture-real-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.posture-caption {
  padding: 8px 11px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  border-top: 1px solid rgba(148, 197, 255, 0.1);
}

.posture-panel.expanded .posture-caption {
  font-size: 13px;
  color: var(--text-main);
  padding: 11px 15px 13px;
}

.posture-panel.minimized .posture-stage,
.posture-panel.minimized .posture-caption,
.posture-panel.minimized #btn-posture-expand {
  display: none;
}

.posture-panel.minimized {
  width: auto;
}

.toast-msg {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(10px);
  z-index: 45;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: rgba(18, 34, 62, 0.94);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 920px) {
  .posture-panel:not(.expanded) {
    top: auto;
    bottom: calc(168px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 184px;
  }
  .posture-panel:not(.expanded) .posture-stage {
    height: 148px;
  }
}

@media (max-width: 680px) {
  .brand-sub,
  #input-indicator {
    display: none;
  }
  .mode-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .preset-grid,
  .cta-row {
    grid-template-columns: 1fr;
  }
  .posture-preview-btn {
    padding: 11px 14px;
  }
  .quest-item {
    flex-wrap: wrap;
  }
  .glimmer-chips {
    padding-left: 0;
  }
  .Dual-pads {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .session-progress-box {
    grid-column: 1 / -1;
    order: -1;
  }
}
