/**
 * 工具子页：灵涵蓝黑科技风（与首页 / 智能体主壳一致）
 * 由 _common_css_links.php 引入
 */

/* 与 body 同底：工具内页冷灰蓝（与首页主壳一致）。有界面主题时 html 带 data-h5-skin，勿铺灰否则宽屏居中 .app-container 两侧露冷边 */
html:not([data-h5-skin]):has(body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant)) {
    background: #f3f6fb !important;
    background-color: #f3f6fb !important;
    background-image: none !important;
}

html body.detail-page,
html body.ecom-page,
html body.page-nova-video,
html body.page-ai-video-prompt,
html body.page-creator-studio,
html body.watermark-tool-page,
html body.tuwen-page-clean,
html body.hk-page,
html body.golden-quote-page,
html body.vrp-page,
html body.linghui-page,
html body.product-max-page {
    background: linear-gradient(180deg, #f8faff 0%, #f3f6fb 100%) !important;
    background-color: #f3f6fb !important;
    background-image: none !important;
    color: #0f172a;
}

html body.detail-page .app-container,
html body.ecom-page .app-container,
html body.page-nova-video .app-container,
html body.page-ai-video-prompt .app-container,
html body.page-creator-studio .app-container,
html body.watermark-tool-page .app-container,
html body.tuwen-page-clean .app-container,
html body.hk-page .app-container {
    background: transparent !important;
}

html body.detail-page .nav-header,
html body.ecom-page .nav-header,
html body.page-nova-video .nav-header,
html body.page-ai-video-prompt .nav-header,
html body.page-creator-studio .nav-header,
html body.watermark-tool-page .nav-header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    color: #0f172a !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
}

html body.detail-page .nav-back,
html body.ecom-page .nav-back,
html body.page-nova-video .nav-back,
html body.page-ai-video-prompt .nav-back,
html body.page-creator-studio .nav-back,
html body.watermark-tool-page .nav-back {
    color: #0f172a !important;
}

html body.detail-page .section-card,
html body.ecom-page .section-card,
html body.page-nova-video .section-card,
html body.watermark-tool-page .section-card {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
    color: #0f172a;
}

html[data-h5-appearance='dark'] body.detail-page,
html[data-h5-appearance='dark'] body.ecom-page,
html[data-h5-appearance='dark'] body.page-nova-video,
html[data-h5-appearance='dark'] body.page-ai-video-prompt,
html[data-h5-appearance='dark'] body.page-creator-studio,
html[data-h5-appearance='dark'] body.watermark-tool-page,
html[data-h5-appearance='dark'] body.tuwen-page-clean {
    background: #060614 !important;
    background-image: none !important;
    color: #e2e8f0;
}

/* 无 body 类名的工具页（排除主壳四 Tab、登录、模板、AI助理） */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) {
    background: linear-gradient(180deg, #f8faff 0%, #f3f6fb 100%) !important;
    background-color: #f3f6fb !important;
    background-image: none !important;
    color: #0f172a;
    --page-hero-gradient: linear-gradient(135deg, #07111f 0%, #123b9a 55%, #2f5bff 100%);
    --accent: #1d4fff;
    --accent-subtle: rgba(29, 79, 255, 0.12);
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) {
    background: #060614 !important;
    background-image: none !important;
    color: #e2e8f0;
}

/* 工具子页正文：与主壳 common 字体栈一致，略收紧字距 */
html body.detail-page .main-content,
html body.linghui-page .main-content,
html body.ecom-page .ecom-inset {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html body.detail-page .section-title,
html body.linghui-page .section-title,
html body.ecom-page .section-title {
    letter-spacing: -0.015em;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .nav-header {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04) !important;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .nav-back {
    color: #0f172a !important;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .nav-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
}

/* 工具子页顶栏不显示「灵涵速推」角标；公众号/小红书/AI助理等菜单页保留 */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant):not(.gzh-viral-page):not(.xhs-viral-page):not(.page-tab-gzh-master):not(.page-tab-xhs-master) .nav-brand-mark {
    display: none !important;
}

/* 创作/历史 Tab 轨道：白底卡片容器（选中格见下） */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav,
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tabs {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
}

/* 创作/历史（及全站同类分段）：选中 = 中性灰底 + 深灰描边 + 黑字（与比例 3:4 选中 pill 一致，避免默认大片蓝） */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item:not(.active),
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab:not(.active) {
    color: #64748b !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item.active,
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab.active {
    position: relative !important;
    overflow: hidden !important;
    isolation: isolate !important;
    color: #0a0a0a !important;
    font-weight: 700 !important;
    border: 1px solid #52525b !important;
    border-radius: 12px !important;
    background: #e4e4e7 !important;
    box-shadow: none !important;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item.active::before,
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab.active::before {
    content: none !important;
    display: none !important;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item.active .h5-ico-tab,
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab.active .h5-ico-tab {
    color: #0a0a0a !important;
    opacity: 1 !important;
}

body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item:not(.active) .h5-ico-tab,
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab:not(.active) .h5-ico-tab {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* 区块标题字阶统一 */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .section-title,
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .form-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.015em !important;
    color: #0f172a !important;
}

/* 表单区小图标：纯深色（无渐变） */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .form-title-icon {
    background: #18181b !important;
    box-shadow: none !important;
}

/* 主按钮：纯深色（无渐变） */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .submit-btn:not(:disabled) {
    background: #18181b !important;
    box-shadow: none !important;
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item:not(.active),
html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab:not(.active) {
    color: #94a3b8 !important;
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item.active,
html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab.active {
    position: relative !important;
    overflow: hidden !important;
    isolation: isolate !important;
    color: #fafafa !important;
    font-weight: 700 !important;
    border: 1px solid #a1a1aa !important;
    border-radius: 12px !important;
    background: #3f3f46 !important;
    box-shadow: none !important;
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item.active::before,
html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab.active::before {
    content: none !important;
    display: none !important;
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .tab-nav-item.active .h5-ico-tab,
html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .detail-tab.active .h5-ico-tab {
    color: #fafafa !important;
    opacity: 1 !important;
}

/* 底部留白：减轻固定底/背景「穿透」裁切感（电商详情图页保留自身大留白，勿覆盖） */
body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant):not(.ecom-page) .main-content {
    padding-bottom: max(40px, calc(env(safe-area-inset-bottom, 0px) + 32px)) !important;
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .nav-header {
    background: rgba(28, 28, 30, 0.96) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-h5-appearance='dark'] body:not(.page-auth):not(.page-tab-create):not(.page-tab-agent):not(.page-tab-mine):not(.page-tab-template):not(.page-tab-assistant) .nav-title {
    color: rgba(248, 250, 252, 0.94) !important;
}

/* ── AI助理页专属覆盖（body.page-tab-assistant）── */
body.page-tab-assistant .nav-header {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    box-shadow: none !important;
}
body.page-tab-assistant .nav-title {
    color: #0F172A !important;
    -webkit-text-fill-color: #0F172A !important;
    font-weight: 800 !important;
}
body.page-tab-assistant .nav-brand-mark {
    color: #27272a !important;
    -webkit-text-fill-color: #27272a !important;
    background: #f4f4f5 !important;
    border: 1px solid #e4e4e7 !important;
    font-weight: 700 !important;
}
