/**
 * H5 全站外层背景归一化
 * 只覆盖页面/壳层背景，避免旧松韵绿、薄荷绿在左右边缘和底栏背后露出。
 */

:root {
  --as-page-bg: #F6F8FC !important;
  --h5-canvas: #F6F8FC !important;
  --ds-bg-page: #F6F8FC !important;
  --sy-bg-main: #F6F8FC !important;
  --as-tab-bar-bg: rgba(255, 255, 255, 0.94) !important;
}

html,
body,
#app,
.uni-page,
.uni-page-body,
.page,
.home-page,
.main-container,
.tab-page,
.app-container {
  background: #F6F8FC !important;
  background-image: none !important;
  background-color: #F6F8FC !important;
}

body::before,
body::after,
.app-container::before,
.app-container::after,
.main-content::before,
.main-content::after,
.lh2-root::before,
.lh2-root::after,
.lh2-page::before,
.lh2-page::after {
  background: #F6F8FC !important;
  background-image: none !important;
}

body.page-tab-create,
body.page-tab-create.lh-home-shelf,
body.page-tab-create.lh-home-shelf.lh-create-songyun,
body.page-tab-agent,
body.page-tab-agent.h5-shelf-mirror,
body.page-tab-agent.h5-shelf-mirror.lh-create-songyun,
body.page-tab-assistant,
body.page-tab-mine,
body.page-tab-mine.lh-create-songyun {
  background: #F6F8FC !important;
  background-image: none !important;
  background-color: #F6F8FC !important;
}

body.page-tab-create #mainContent,
body.page-tab-agent #mainContent,
body.page-tab-assistant #mainContent,
body.page-tab-mine #mainContent,
body.page-tab-create .main-content,
body.page-tab-agent .main-content,
body.page-tab-assistant .main-content,
body.page-tab-mine .main-content,
body.page-tab-create .lh2-root,
body.page-tab-agent .lh2-root,
body.page-tab-mine .lh2-root,
body.page-tab-create .lh2-page,
body.page-tab-agent .lh2-page,
body.page-tab-mine .lh2-page,
body.page-tab-create .create-dash,
body.page-tab-agent .create-dash,
body.page-tab-create .home-page,
body.page-tab-agent .home-page,
body.page-tab-create .create-page,
body.page-tab-agent .agent-page {
  background: #F6F8FC !important;
  background-image: none !important;
  background-color: #F6F8FC !important;
}

body.page-tab-create .lh-new-home,
body.page-tab-create .create-page,
body.page-tab-agent #agentToolsRoot .lh2-page,
body.page-tab-agent #agentToolsRoot .create-dash,
body.page-tab-agent #agentToolsRoot .create-dash__inner,
body.page-tab-agent .agent-page,
body.page-tab-create .main-container,
body.page-tab-agent .main-container {
  background: linear-gradient(180deg, #F8FAFF 0%, #F3F6FB 100%) !important;
  background-color: #F3F6FB !important;
}

body.page-tab-create .tab-bar,
body.page-tab-agent .tab-bar,
body.page-tab-assistant .tab-bar,
body.page-tab-mine .tab-bar {
  background: rgba(255, 255, 255, 0.94) !important;
  background-image: none !important;
}

/* 高优先级覆盖旧松韵壳层，修复 ?tab=create&cat=1 和 agent 外侧绿边 */
html body.page-tab-create.lh-home-shelf,
html body.page-tab-create.lh-home-shelf.lh-create-songyun,
html body.page-tab-create.lh-home-shelf.lh-create-songyun.lh-redesign,
html body.page-tab-agent.h5-shelf-mirror,
html body.page-tab-agent.h5-shelf-mirror.lh-create-songyun,
html body.page-tab-mine.lh-create-songyun {
  background: #F6F8FC !important;
  background-image: none !important;
  background-color: #F6F8FC !important;
}

html body.page-tab-create.lh-home-shelf .app-container,
html body.page-tab-create.lh-home-shelf #mainContent,
html body.page-tab-create.lh-home-shelf .main-content,
html body.page-tab-create.lh-home-shelf .lh2-root,
html body.page-tab-create.lh-home-shelf .lh2-page,
html body.page-tab-create.lh-home-shelf #createToolsSheet,
html body.page-tab-create.lh-home-shelf #homeDashScrollLayer,
html body.page-tab-create.lh-home-shelf .create-dash,
html body.page-tab-agent.h5-shelf-mirror .app-container,
html body.page-tab-agent.h5-shelf-mirror #mainContent,
html body.page-tab-agent.h5-shelf-mirror .main-content,
html body.page-tab-agent.h5-shelf-mirror .lh2-root,
html body.page-tab-agent.h5-shelf-mirror .lh2-page,
html body.page-tab-agent.h5-shelf-mirror #agentToolsRoot {
  background: #F6F8FC !important;
  background-image: none !important;
  background-color: #F6F8FC !important;
}

html body.page-tab-create.lh-home-shelf .lh-new-home,
html body.page-tab-create.lh-home-shelf.lh-create-songyun .lh-new-home,
html body.page-tab-create.lh-home-shelf .lh-redesign-page,
html body.page-tab-agent.h5-shelf-mirror #agentToolsRoot .lh2-page,
html body.page-tab-agent.h5-shelf-mirror #agentToolsRoot .create-dash,
html body.page-tab-agent.h5-shelf-mirror #agentToolsRoot .create-dash__inner {
  background: linear-gradient(180deg, #F8FAFF 0%, #F3F6FB 100%) !important;
  background-color: #F3F6FB !important;
}

/* 最高优先级：修复移动端页面左右 gutter 继续透出旧绿色 */
html:has(body.page-tab-create),
html:has(body.page-tab-agent),
html:has(body.page-tab-assistant),
html:has(body.page-tab-mine),
html:has(body.page-tab-create) body,
html:has(body.page-tab-agent) body,
html:has(body.page-tab-assistant) body,
html:has(body.page-tab-mine) body,
html:has(body.page-tab-create) .app-container,
html:has(body.page-tab-agent) .app-container,
html:has(body.page-tab-assistant) .app-container,
html:has(body.page-tab-mine) .app-container,
html:has(body.page-tab-create) .main-content,
html:has(body.page-tab-agent) .main-content,
html:has(body.page-tab-assistant) .main-content,
html:has(body.page-tab-mine) .main-content {
  background: #F6F8FC !important;
  background-image: none !important;
  background-color: #F6F8FC !important;
}

/*
 * 主壳 Tab 字色与 common.css / design-system 对齐。
 * index-page 内创作、我的等曾覆盖「松韵」偏黑 (#08090d)，与工具子页 #0f172a 切换时有割裂感。
 */
body.page-tab-create,
body.page-tab-mine,
body.page-tab-agent,
body.page-tab-assistant,
body.page-tab-template {
  --text-primary: #0f172a !important;
  --text-secondary: #334155 !important;
  --text-muted: #64748b !important;
  --zen-ink: #0f172a !important;
  --zen-mist: #334155 !important;
  --zen-ink-rgb: 15, 23, 42 !important;
  --zen-mist-rgb: 51, 65, 85 !important;
}

/* ========== 暗黑模式：覆盖上方浅色硬编码 ========== */
html[data-h5-appearance='dark'] {
  --as-page-bg: #000000 !important;
  --h5-canvas: #000000 !important;
  --ds-bg-page: #000000 !important;
  --sy-bg-main: #000000 !important;
  --as-tab-bar-bg: rgba(28, 28, 30, 0.94) !important;
  --text-primary: #f5f5f7 !important;
  --text-secondary: rgba(235, 235, 245, 0.72) !important;
  --text-muted: rgba(235, 235, 245, 0.48) !important;
  --zen-ink: #f5f5f7 !important;
  --zen-mist: rgba(235, 235, 245, 0.72) !important;
  --zen-ink-rgb: 245, 245, 247 !important;
  --zen-mist-rgb: 235, 235, 245 !important;
  color-scheme: dark;
}

html[data-h5-appearance='dark'],
html[data-h5-appearance='dark'] body,
html[data-h5-appearance='dark'] #app,
html[data-h5-appearance='dark'] .uni-page,
html[data-h5-appearance='dark'] .uni-page-body,
html[data-h5-appearance='dark'] .page,
html[data-h5-appearance='dark'] .home-page,
html[data-h5-appearance='dark'] .main-container,
html[data-h5-appearance='dark'] .tab-page,
html[data-h5-appearance='dark'] .app-container {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}

html[data-h5-appearance='dark'] body::before,
html[data-h5-appearance='dark'] body::after,
html[data-h5-appearance='dark'] .app-container::before,
html[data-h5-appearance='dark'] .app-container::after,
html[data-h5-appearance='dark'] .main-content::before,
html[data-h5-appearance='dark'] .main-content::after,
html[data-h5-appearance='dark'] .lh2-root::before,
html[data-h5-appearance='dark'] .lh2-root::after,
html[data-h5-appearance='dark'] .lh2-page::before,
html[data-h5-appearance='dark'] .lh2-page::after {
  background: #000000 !important;
  background-image: none !important;
}

html[data-h5-appearance='dark'] body.page-tab-create,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf.lh-create-songyun,
html[data-h5-appearance='dark'] body.page-tab-agent,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror.lh-create-songyun,
html[data-h5-appearance='dark'] body.page-tab-assistant,
html[data-h5-appearance='dark'] body.page-tab-mine,
html[data-h5-appearance='dark'] body.page-tab-mine.lh-create-songyun {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
  --text-primary: #f5f5f7 !important;
  --text-secondary: rgba(235, 235, 245, 0.72) !important;
  --text-muted: rgba(235, 235, 245, 0.48) !important;
  --zen-ink: #f5f5f7 !important;
  --zen-mist: rgba(235, 235, 245, 0.72) !important;
  --zen-ink-rgb: 245, 245, 247 !important;
  --zen-mist-rgb: 235, 235, 245 !important;
}

html[data-h5-appearance='dark'] body.page-tab-create #mainContent,
html[data-h5-appearance='dark'] body.page-tab-agent #mainContent,
html[data-h5-appearance='dark'] body.page-tab-assistant #mainContent,
html[data-h5-appearance='dark'] body.page-tab-mine #mainContent,
html[data-h5-appearance='dark'] body.page-tab-create .main-content,
html[data-h5-appearance='dark'] body.page-tab-agent .main-content,
html[data-h5-appearance='dark'] body.page-tab-assistant .main-content,
html[data-h5-appearance='dark'] body.page-tab-mine .main-content,
html[data-h5-appearance='dark'] body.page-tab-create .lh2-root,
html[data-h5-appearance='dark'] body.page-tab-agent .lh2-root,
html[data-h5-appearance='dark'] body.page-tab-mine .lh2-root,
html[data-h5-appearance='dark'] body.page-tab-create .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-agent .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-mine .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-create .create-dash,
html[data-h5-appearance='dark'] body.page-tab-agent .create-dash,
html[data-h5-appearance='dark'] body.page-tab-create .home-page,
html[data-h5-appearance='dark'] body.page-tab-agent .home-page,
html[data-h5-appearance='dark'] body.page-tab-create .create-page,
html[data-h5-appearance='dark'] body.page-tab-agent .agent-page {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}

html[data-h5-appearance='dark'] body.page-tab-create .lh-new-home,
html[data-h5-appearance='dark'] body.page-tab-create .create-page,
html[data-h5-appearance='dark'] body.page-tab-agent #agentToolsRoot .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-agent #agentToolsRoot .create-dash,
html[data-h5-appearance='dark'] body.page-tab-agent #agentToolsRoot .create-dash__inner,
html[data-h5-appearance='dark'] body.page-tab-agent .agent-page,
html[data-h5-appearance='dark'] body.page-tab-create .main-container,
html[data-h5-appearance='dark'] body.page-tab-agent .main-container {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}

html[data-h5-appearance='dark'] body.page-tab-create .tab-bar,
html[data-h5-appearance='dark'] body.page-tab-agent .tab-bar,
html[data-h5-appearance='dark'] body.page-tab-assistant .tab-bar,
html[data-h5-appearance='dark'] body.page-tab-mine .tab-bar {
  background: rgba(28, 28, 30, 0.94) !important;
  background-image: none !important;
}

html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf.lh-create-songyun,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf.lh-create-songyun.lh-redesign,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror.lh-create-songyun,
html[data-h5-appearance='dark'] body.page-tab-mine.lh-create-songyun {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}

html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .app-container,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf #mainContent,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .main-content,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .lh2-root,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf #createToolsSheet,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf #homeDashScrollLayer,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .create-dash,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror .app-container,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror #mainContent,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror .main-content,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror .lh2-root,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror #agentToolsRoot {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}

html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .lh-new-home,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf.lh-create-songyun .lh-new-home,
html[data-h5-appearance='dark'] body.page-tab-create.lh-home-shelf .lh-redesign-page,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror #agentToolsRoot .lh2-page,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror #agentToolsRoot .create-dash,
html[data-h5-appearance='dark'] body.page-tab-agent.h5-shelf-mirror #agentToolsRoot .create-dash__inner {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}

html[data-h5-appearance='dark']:has(body.page-tab-create),
html[data-h5-appearance='dark']:has(body.page-tab-agent),
html[data-h5-appearance='dark']:has(body.page-tab-assistant),
html[data-h5-appearance='dark']:has(body.page-tab-mine),
html[data-h5-appearance='dark']:has(body.page-tab-create) body,
html[data-h5-appearance='dark']:has(body.page-tab-agent) body,
html[data-h5-appearance='dark']:has(body.page-tab-assistant) body,
html[data-h5-appearance='dark']:has(body.page-tab-mine) body,
html[data-h5-appearance='dark']:has(body.page-tab-create) .app-container,
html[data-h5-appearance='dark']:has(body.page-tab-agent) .app-container,
html[data-h5-appearance='dark']:has(body.page-tab-assistant) .app-container,
html[data-h5-appearance='dark']:has(body.page-tab-mine) .app-container,
html[data-h5-appearance='dark']:has(body.page-tab-create) .main-content,
html[data-h5-appearance='dark']:has(body.page-tab-agent) .main-content,
html[data-h5-appearance='dark']:has(body.page-tab-assistant) .main-content,
html[data-h5-appearance='dark']:has(body.page-tab-mine) .main-content {
  background: #000000 !important;
  background-image: none !important;
  background-color: #000000 !important;
}
