/* 第8轮 A 块：深色近黑 token + 营销首页（对照 design/lingscan-home-demo.html 母版）
   依据：SSOT 规范 §三 token、§五 母版条款；铁律 5 配色 / 铁律 6 圆角 ≤8px / 铁律 7 动效归属。
   加载顺序：必须在 lingscan-tokens.css / surface-cream.css 之后，覆盖为深色。 */

/* ===== 1. 仅保留落地页舞台/胶囊扩展；brass/canvas/t-* 一律用 lingscan-tokens ===== */
:root {
  --chip-ok-bg: rgba(95, 160, 95, 0.18);
  --chip-ok-fg: #8fd08f;
  --chip-idle-bg: rgba(255, 255, 255, 0.06);
  --chip-idle-fg: #c3c5c1;
  --chip-note-bg: rgba(232, 138, 42, 0.16);
  --chip-note-fg: #f3a55d;

  --stage-canvas: #151618;
  --stage-rail: #141517;
  --stage-panel: #1c1e21;
  --stage-raised: #23262a;
  --stage-text: #f6f5f2;
  --stage-text-2: #c3c5c1;
  --stage-mute: #979a93;
  --stage-line: rgba(255, 255, 255, 0.10);
}

body {
  background: var(--canvas) !important;
  color: var(--text) !important;
}

/* ===== 2. 开场动画（Goo + LOGO，2 秒自动进入功能页；reduced-motion 隐藏） ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #151618;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  transition: opacity 0.55s ease, visibility 0.55s;
}
.splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
.sp-logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, var(--brass-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sp-logo em {
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 5px;
  margin-left: 12px;
  background: linear-gradient(90deg, var(--brass), var(--brass-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sp-goo { width: 230px; height: 230px; position: relative; }
#sp-goo-canvas { width: 100%; height: 100%; }
.sp-fallback { position: absolute; inset: 0; display: none; }
.sp-fallback circle { fill: rgba(168, 100, 27, 0.5); }
.sp-fallback .s1 { animation: spblob 0.9s ease-in-out infinite; }
.sp-fallback .s2 { animation: spblob 0.9s ease-in-out 0.16s infinite; }
.sp-fallback .s3 { animation: spblob 0.9s ease-in-out 0.32s infinite; }
@keyframes spblob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-24px) scale(1.1); } }

/* ===== 3. 顶栏模式切换（大号按钮态，恒定不丢） ===== */
@keyframes lift { 50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.18); } }
.mode {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  margin-left: 10px;
  overflow: hidden;
}
.mode button {
  height: 36px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--t-3);
  border-radius: 4px;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s;
}
.mode button.on {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  animation: lift 2s ease-in-out infinite;
}
.mode button:not(.on):hover { color: #fff; }

/* 顶栏 nav-mid 模式切换（锚点版，选中 = 浅灰 + 白提亮，禁琥珀） */
.site-header.top .nav-mid.mode {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  margin-left: calc(10px + 4em);
  flex: 0 0 auto;
}
/* 对齐参考页：桌面只显示全文，避免「创作创作 / 分析分析」 */
.site-header.top .nav-mid.mode .m-short { display: none; }
.site-header.top .nav-mid.mode .m-full { display: inline; }
@media (max-width: 560px) {
  .site-header.top .nav-mid.mode { margin-left: 0; flex: 1; }
  .site-header.top .nav-mid.mode .m-full { display: none; }
  .site-header.top .nav-mid.mode .m-short { display: inline; }
}
.site-header.top .nav-mid.mode a.home-view-nav {
  height: 36px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--t-3);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-bottom: 0;
  transition: all 0.25s;
}
.site-header.top .nav-mid.mode a.home-view-nav.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  animation: lift 2s ease-in-out infinite;
}
.site-header.top .nav-mid.mode a.home-view-nav:not(.active):hover { color: #fff; }

/* ===== 4. 营销首页（未登录 landing） ===== */
/* 注意：body 也会被挂上 landing 类（guest 态标记），所以展示/隐藏规则必须用 #landing ID 精确命中首页容器，避免 .landing 裸类误伤 body 导致整页 display:none */
#landing { display: none; }
body.landing #landing { display: block; }
/* 第8轮 C 块：未登录 guest 态点击「音乐分析/创作/工作台」导航后，隐藏营销首页、只显示目标视图（分析页独占，避免 landing 与分析页重叠） */
body.landing.view-analyze #landing,
body.landing.view-create #landing,
body.landing.view-workspace #landing { display: none !important; }
/* 唯一左栏 = #home-side：访客落地也显示 shell 骨架，仅主栏叠营销内容 */
body.landing .shell-app { display: grid !important; }
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .shell-main {
  visibility: hidden;
  pointer-events: none;
}
body.landing.view-create .shell-main,
body.landing.view-workspace .shell-main,
body.landing.view-analyze .shell-main {
  visibility: visible;
  pointer-events: auto;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #landing {
  position: fixed;
  left: 230px;
  right: 0;
  top: 64px;
  bottom: 0;
  overflow: auto;
  z-index: 20;
  background: var(--bg, #151618);
}
/* 主页用参考页 foot；隐藏下方全站 footer 避免双页脚 */
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .site-footer {
  display: none !important;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .shell-app.app {
  grid-template-columns: 230px 1fr !important;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #home-side {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 230px;
  z-index: 25;
  overflow: hidden;
}
@media (max-width: 768px) {
  body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #landing {
    left: 64px;
  }
  body.landing .site-header.top .nav-mid:not(.open) {
    display: none !important;
  }
  body.landing .site-header.top .nav-mid.open {
    display: flex !important;
  }
  body.landing .site-header.top .top-text-zone {
    gap: 6px;
    font-size: 12px;
    min-width: 0;
  }
  body.landing .site-header.top .top-text-zone .sep {
    display: none;
  }
}
@media (min-width: 769px) {
  body.landing .site-header.top .nav-mid { display: flex; }
}

.landing-layout { display: flex; width: 100%; gap: 0; min-height: calc(100vh - 64px); }
.landing-layout--rail-shared { display: block; }
.landing-main { flex: 1; min-width: 0; }
/* 左栏 .rg / .rail-cta / .side → rail-nav.css */

/* 主区 Hero~CTA/页脚样式 → home-demo.css（照搬参考页逐值，禁止在此手调间距） */

/* ===== 5. 深色壳覆盖（登录工作台：顶栏/侧栏/面板轨/工作台） ===== */
body:not(.landing) .site-header.top { background: rgba(21, 22, 24, 0.82); border-bottom: 1px solid var(--line); }
body:not(.landing) .side { background: #181a1d; }
body:not(.landing) .panel-rail { background: #141517; }
body:not(.landing) .side .item.active { background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }
body:not(.landing) .side .item.active svg { stroke: #fff; }
body:not(.landing) .side .item:hover { background: rgba(255, 255, 255, 0.09); }
body:not(.landing) .home-dashboard .w-card,
body:not(.landing) .home-dashboard .tool-card { background: #1c1e21; border-color: var(--line); border-radius: 8px; }
body:not(.landing) .home-dashboard .w-card .meta .t { color: #fff; }
body:not(.landing) .home-dashboard .tool-card:hover { border-color: var(--brass); }
body:not(.landing) .main.home-dashboard .hero h1,
body:not(.landing) .main.home-dashboard .hero .view-title { color: #fff; }

/* 生成区 iframe 背景翻深（B 块前先保证深色底） */
body.view-create .shell-main-create { background: var(--canvas) !important; }
body.view-create .shell-create-hero h1,
body.view-create .shell-create-hero .view-title { color: #fff !important; }
body.view-create .shell-create-hero p { color: var(--t-3) !important; }
body.view-create #home-compose-frame { background: var(--canvas) !important; }

@media (max-width: 900px) {
  /* #home-side 走 shell 窄栏，不再用旧抽屉 display:none */
  .landing-layout { display: block; }
  .landing-steps { grid-template-columns: 1fr 1fr; gap: 26px 0; padding: 32px 12px; }
  .landing-step-line { display: none; }
  .landing-hero-in { padding-inline: 20px; }
}
@media (max-width: 560px) {
  .landing-steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero h1 { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
