/* 全屏分层：粒子 → 太阳系 → 文本 */

html:has(body.home-standalone) {
  height: 100%;
  overflow: hidden;
}

body.home-standalone {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #070b14;
  color: #e2e8f0;
  --home-text-inset: clamp(8.5vw, 11vw, 12vw);
  --home-stage-top: clamp(2vh, 4vh, 6vh);
}

body.home-standalone .app-bg {
  display: none;
}

.home-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.home-page {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  pointer-events: none;
}

/* 第 0 层：粒子 */
.home-aurora {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.home-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 50%, transparent 0%, rgba(7, 11, 20, 0.35) 100%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(7, 11, 20, 0.85) 0%, transparent 55%);
}

.home-cursor-glow {
  position: absolute;
  width: 30rem;
  height: 30rem;
  margin: -15rem 0 0 -15rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(59, 130, 246, 0.06) 42%, transparent 70%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
}

body.home-standalone.is-active .home-cursor-glow {
  opacity: 1;
}

/* 第 2 层：太阳系（全屏、不拦截鼠标） */
.home-solar-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.home-solar-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* 第 3 层：主入口（文档流左上，避开右侧太阳系） */
.home-stage {
  position: relative;
  flex: 1;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--home-stage-top) 6vw 8vh var(--home-text-inset);
  pointer-events: none;
}

.home-enter {
  pointer-events: auto;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  padding: 8px 12px;
  margin: -8px -12px;
  transition: background 0.25s ease;
  cursor: pointer;
}

.home-enter:hover {
  background: rgba(15, 23, 42, 0.32);
}

.home-enter:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.65);
  outline-offset: 4px;
}

.home-copy {
  pointer-events: none;
  text-align: left;
  width: min(100%, 380px);
  padding: 0;
  background: none;
  border: none;
  backdrop-filter: none;
  box-shadow: none;
  animation: home-fade-in 0.9s 0.15s both;
}

.home-eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(199, 210, 254, 0.85);
  text-shadow: 0 0 24px rgba(99, 102, 241, 0.5);
}

.home-mega-title {
  margin: 0;
  font-size: clamp(36px, 6.5vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow:
    0 2px 24px rgba(7, 11, 20, 0.95),
    0 0 40px rgba(99, 102, 241, 0.3);
}

.home-title-word {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(20px);
  animation: home-title-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-title-word:nth-child(1) { animation-delay: 0.3s; }
.home-title-word:nth-child(2) { animation-delay: 0.45s; }

@keyframes home-title-in {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

.home-title-word--accent {
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #38bdf8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: home-title-in 0.9s 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    home-grad-flow 5s ease-in-out infinite;
}

@keyframes home-grad-flow {
  50% { background-position: 100% center; }
}

.home-tagline {
  margin: 6px 0 0;
  font-size: clamp(11px, 1.6vw, 13px);
  color: rgba(226, 232, 240, 0.72);
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-shadow: 0 2px 20px rgba(7, 11, 20, 0.95);
}

@keyframes home-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 顶栏 */
.home-float-nav {
  position: relative;
  flex-shrink: 0;
  z-index: 2;
  background: rgba(10, 15, 28, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  animation: home-nav-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes home-nav-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-float-nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.875rem 2rem 0.875rem var(--home-text-inset);
}

.home-float-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.home-float-brand--link {
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  padding: 4px 8px;
  margin: -4px -8px;
  transition: background 0.2s ease;
}

.home-float-brand--link:hover {
  background: rgba(99, 102, 241, 0.12);
}

.home-float-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.home-float-logo svg {
  width: 16px;
  height: 16px;
}

.home-float-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.9);
  letter-spacing: 0.04em;
}

.home-float-btn {
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: transparent;
  color: #64748b;
  font-size: 11px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s;
}

.home-float-btn:hover,
.home-float-btn.is-open {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}

.home-settings-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  padding: 14px 32px 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.home-settings-panel[hidden] {
  display: none !important;
}

.home-settings-panel-inner {
  display: grid;
  gap: 10px;
}

.home-settings-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
}

.home-settings-field input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(7, 11, 20, 0.9);
  color: #f1f5f9;
  font-size: 12px;
}

.home-settings-hint {
  margin: 0;
  font-size: 10px;
  color: #475569;
}

.home-settings-hint code {
  color: #818cf8;
  word-break: break-all;
}

.home-settings-actions {
  display: flex;
  gap: 8px;
}

body.home-standalone .toast {
  z-index: 200;
}

@media (min-width: 768px) {
  .home-copy {
    width: min(100%, 380px);
  }
}

@media (max-width: 767px) {
  body.home-standalone {
    --home-text-inset: clamp(24vw, 28vw, 31vw);
    --home-stage-top: 3vh;
  }

  .home-float-nav-inner {
    justify-content: flex-start;
    min-height: 0;
    padding: 0.75rem 1rem 0.75rem var(--home-text-inset);
  }

  .home-float-name {
    display: inline;
  }

  .home-stage {
    padding: var(--home-stage-top) 4vw 8vh var(--home-text-inset);
  }

  .home-enter {
    margin: 0;
    max-width: min(100%, 320px);
  }

  .home-copy {
    text-align: left;
    width: min(100%, 320px);
  }

  .home-tagline {
    margin-top: 6px;
    letter-spacing: 0.08em;
  }
}

@media (max-height: 640px) {
  .home-mega-title {
    font-size: clamp(36px, 7vw, 56px);
  }

  .home-tagline {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-aurora,
  .home-cursor-glow {
    display: none;
  }

  .home-copy,
  .home-float-nav,
  .home-title-word {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}
