/* 新版首页（转换优先·上下排布）专属样式
 * 仅在 /home-next（index-next 视图）加载。
 * 结构约定：
 *   .chat-container.home-v2.hv2-topdown  → 上下排布模式（默认）：隐藏左侧 rail，
 *       由顶部导航条（.hv2-header）承接入口，编辑器全宽居中为主角
 *   .chat-container.home-v2（无 hv2-topdown）→ 经典三栏，全部规则失效回落原有样式，
 *       仅保留 .hv2-back-btn 返回浮标
 *   .hv2-section → 仅 topdown 模式可见的新增分区（header / hero / below）
 */

/* ===== 新增分区默认隐藏，仅 topdown 模式显示 ===== */
.home-v2 .hv2-section {
    display: none;
}

.hv2-topdown .hv2-section {
    display: block;
}

/* ===== topdown 模式：隐藏 rail（在容器内部），容器全宽、块级页面滚动 ===== */
.hv2-topdown .spa-sidebar {
    display: none;
}

.chat-container.hv2-topdown {
    display: block;
    margin-left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 #FAF9F6;
}

/* 隐藏会话列表与经典欢迎区（chat-main），保留 DOM 供 main.js 正常初始化 */
.hv2-topdown .chat-sidebar,
.hv2-topdown .chat-main {
    display: none !important;
}

/* ===== 顶部导航条 ===== */
.hv2-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 249, 246, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0 48px;
    height: 60px;
    transition: transform 0.28s ease;
    will-change: transform;
}

/* 下滚时收起导航条（上滚/回顶自动恢复，逻辑见 home-next.js） */
.hv2-header.hv2-header--hidden {
    transform: translateY(-100%);
}

.hv2-topdown .hv2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 提升特异性(0,2,0)覆盖 tiptap 包 `:root *` 的全局 transition:none 重置，
       否则收起动画不生效（该重置与 .hv2-header 同特异性但后加载获胜） */
    transition: transform 0.28s ease;
}

.hv2-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.hv2-header-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.hv2-header-name {
    font-family: var(--spa-font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--spa-text-main);
}

.hv2-header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hv2-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--spa-text-sub);
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hv2-nav-item:hover {
    background: #F3F4F6;
    color: var(--spa-primary);
}

.hv2-nav-item .layui-icon,
.hv2-nav-item .iconfont {
    font-size: 17px;
}

.hv2-nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 6px;
    line-height: 1.3;
}

/* 客服二维码悬浮弹层 */
.hv2-nav-qr-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 12px;
    box-shadow: var(--spa-shadow-modal);
    padding: 14px;
    gap: 14px;
    z-index: 200;
}

.hv2-nav-qr:hover .hv2-nav-qr-popup {
    display: flex;
}

.hv2-nav-qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hv2-nav-qr-item img {
    width: 120px;
    height: 120px;
}

.hv2-nav-qr-item span {
    font-size: 12px;
    color: var(--spa-text-sub);
    white-space: nowrap;
}

.hv2-nav-login {
    font-size: 14px;
    color: #fff;
    background: var(--spa-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 22px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.hv2-nav-login:hover {
    background: #1D4ED8;
}

.hv2-nav-avatar {
    background: transparent;
    border: none;
    padding: 0;
    margin-left: 8px;
    cursor: pointer;
}

.hv2-nav-avatar img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: var(--spa-shadow-card);
    display: block;
}

/* ===== Hero 区 ===== */
.hv2-hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 46px 24px 8px;
    text-align: center;
}

.hv2-hero-title {
    font-family: var(--spa-font-serif);
    font-size: 42px;
    font-weight: 700;
    color: var(--spa-text-main);
    margin: 0 0 12px;
    line-height: 1.3;
}

.hv2-hero-em {
    color: var(--spa-primary);
}

.hv2-hero-subtitle {
    font-size: 16px;
    color: var(--spa-text-sub);
    margin: 0 0 24px;
}

.hv2-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* 粘贴主按钮 */
.hv2-paste-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: var(--spa-primary);
    border: none;
    border-radius: 12px;
    padding: 13px 34px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
    transition: all 0.2s ease;
}

.hv2-paste-btn:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.34);
}

.hv2-paste-btn-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 载入示例 chips */
.hv2-sample-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hv2-sample-label {
    font-size: 13px;
    color: #9ca3af;
}

.hv2-sample-chip {
    font-size: 13px;
    color: var(--spa-text-sub);
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 16px;
    padding: 4px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hv2-sample-chip:hover {
    color: var(--spa-primary);
    border-color: var(--spa-primary);
    background: #EFF6FF;
}

/* ===== 编辑器居中为主角（宽度按视口自适应，14寸屏不顶满） ===== */
.hv2-topdown .editor-panel {
    display: flex;
    max-width: 1200px;
    width: min(1200px, calc(100% - 160px));
    min-width: 0;
    height: 66vh;
    min-height: 440px;
    margin: 22px auto 0;
    border: 1px solid var(--spa-border);
    border-left: 1px solid var(--spa-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
}

/* B 营销叙事版：编辑器再收窄，让位给内容叙事 */
.hv2-vb.hv2-topdown .editor-panel {
    max-width: 1040px;
    width: min(1040px, calc(100% - 160px));
    height: 58vh;
}

/* C 工具聚焦版：紧凑工具形态 */
.hv2-vc.hv2-topdown .editor-panel {
    max-width: 960px;
    width: min(960px, calc(100% - 160px));
    height: 62vh;
    margin-top: 16px;
}

/* C 版 Hero 紧凑化 */
.hv2-vc .hv2-hero {
    padding-top: 28px;
}

.hv2-vc .hv2-hero-title {
    font-size: 30px;
    margin-bottom: 8px;
}

.hv2-vc .hv2-hero-subtitle {
    font-size: 14px;
    margin-bottom: 16px;
}

.hv2-vc .hv2-paste-btn {
    font-size: 15px;
    padding: 11px 26px;
}

/* B 版 Hero：顶部留白收敛（原 56px 过空），把版面让给下方工作区 */
.hv2-vb .hv2-hero {
    padding-top: 28px;
}

.hv2-vb .hv2-hero-title {
    font-size: 46px;
}

/* Hero 按钮行（B 版含次按钮） */
.hv2-hero-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.hv2-hero-secondary {
    font-size: 14px;
    color: var(--spa-text-sub);
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 12px;
    padding: 13px 24px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hv2-hero-secondary:hover {
    color: var(--spa-primary);
    border-color: var(--spa-primary);
}

/* ===== 编辑器下方区域 ===== */
.hv2-below {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 48px 48px;
}

.hv2-vb .hv2-below {
    max-width: 1100px;
}

.hv2-vc .hv2-below {
    max-width: 1000px;
}

/* 通用分区标题 */
.hv2-sec-title {
    font-family: var(--spa-font-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--spa-text-main);
    text-align: center;
    margin: 0 0 8px;
}

.hv2-sec-subtitle {
    font-size: 14px;
    color: var(--spa-text-sub);
    text-align: center;
    margin: 0 0 26px;
}

/* AI 对话折叠条 */
.hv2-ai-fold {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 10px;
    padding: 13px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hv2-ai-fold:hover {
    border-color: var(--spa-primary);
    box-shadow: var(--spa-shadow-card);
}

.hv2-ai-fold-text {
    font-size: 14px;
    color: var(--spa-text-sub);
}

.hv2-ai-fold-action {
    font-size: 14px;
    color: var(--spa-primary);
    flex-shrink: 0;
}

.hv2-ai-fold-action .layui-icon {
    font-size: 12px;
}

/* 转换工具矩阵：宽屏一行 6 卡 */
.hv2-block-title {
    font-size: 13px;
    color: #9ca3af;
    margin: 28px 0 10px;
}

.hv2-tools-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.hv2-tool-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hv2-tool-card:hover {
    border-color: var(--spa-primary);
    box-shadow: var(--spa-shadow-card);
    transform: translateY(-2px);
}

.hv2-tool-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--spa-text-main);
    white-space: nowrap;
}

.hv2-tool-card:hover .hv2-tool-name {
    color: var(--spa-primary);
}

.hv2-tool-desc {
    font-size: 12px;
    color: #9ca3af;
}

.hv2-tool-card-more {
    background: #FAF9F6;
    border-style: dashed;
}

/* 多端下载横条 */
.hv2-channels {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 10px;
    padding: 13px 20px;
    margin-top: 28px;
}

.hv2-channels-label {
    font-size: 13px;
    color: #9ca3af;
    flex-shrink: 0;
}

.hv2-channel-item {
    font-size: 14px;
    color: var(--spa-text-main);
    text-decoration: none;
}

.hv2-channel-item:hover {
    color: var(--spa-primary);
}

.hv2-channel-tip {
    font-size: 12px;
    color: #9ca3af;
    margin-left: 6px;
}

.hv2-channels-all {
    margin-left: auto;
    font-size: 13px;
    color: var(--spa-primary);
    text-decoration: none;
    flex-shrink: 0;
}

/* SEO 场景卡片区 */
.hv2-scenes {
    margin-top: 56px;
    text-align: center;
}

.hv2-scenes-title {
    font-family: var(--spa-font-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--spa-text-main);
    margin: 0 0 8px;
}

.hv2-scenes-subtitle {
    font-size: 14px;
    color: var(--spa-text-sub);
    margin: 0 0 24px;
}

.hv2-scenes-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    text-align: left;
}

.hv2-scene-card {
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.hv2-scene-card:hover {
    box-shadow: var(--spa-shadow-card);
    transform: translateY(-2px);
}

.hv2-scene-badge {
    display: inline-block;
    font-size: 12px;
    color: var(--spa-primary);
    background: #EFF6FF;
    border-radius: 8px;
    padding: 2px 10px;
    margin-bottom: 10px;
}

.hv2-scene-badge-purple {
    color: #7C3AED;
    background: #F5F3FF;
}

.hv2-scene-badge-amber {
    color: #D97706;
    background: #FFFBEB;
}

.hv2-scene-badge-green {
    color: #059669;
    background: #ECFDF5;
}

.hv2-scene-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--spa-text-main);
    margin-bottom: 6px;
}

.hv2-scene-desc {
    font-size: 13px;
    color: var(--spa-text-sub);
    line-height: 1.7;
    margin: 0;
}

/* 收尾 CTA */
.hv2-cta {
    text-align: center;
    margin-top: 60px;
    padding: 44px 24px;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 16px;
}

.hv2-cta-title {
    font-family: var(--spa-font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--spa-text-main);
    margin: 0 0 8px;
}

.hv2-cta-subtitle {
    font-size: 14px;
    color: var(--spa-text-sub);
    margin: 0 0 22px;
}

.hv2-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.hv2-cta-secondary {
    font-size: 14px;
    color: var(--spa-text-sub);
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 12px;
    padding: 13px 26px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hv2-cta-secondary:hover {
    color: var(--spa-primary);
    border-color: var(--spa-primary);
}

/* 页脚 */
.hv2-footer {
    text-align: center;
    margin-top: 36px;
    font-size: 12px;
    line-height: 1.6;
}

.hv2-footer-links a {
    color: #9ca3af;
    text-decoration: none;
}

.hv2-footer-links a:hover {
    color: #666;
}

.hv2-footer-links a + a::before {
    content: "·";
    margin: 0 8px;
    color: #d1d5db;
}

.hv2-footer-beian {
    display: inline-block;
    margin-top: 4px;
    color: #9ca3af;
    text-decoration: none;
}

.hv2-footer-beian:hover {
    color: #666;
}

/* ===== 经典模式下的返回浮标 ===== */
.hv2-back-btn {
    position: fixed;
    left: calc(var(--spa-rail-width) + 16px);
    bottom: 18px;
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--spa-text-sub);
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 20px;
    padding: 7px 16px;
    cursor: pointer;
    box-shadow: var(--spa-shadow-card);
    transition: all 0.2s ease;
}

.hv2-back-btn:hover {
    color: var(--spa-primary);
    border-color: var(--spa-primary);
}

.hv2-back-btn .layui-icon {
    font-size: 13px;
}

/* ===== 窄屏适配（预览页以桌面为主，做基本兜底） ===== */
@media (max-width: 1100px) {
    .hv2-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hv2-scenes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .hv2-header {
        padding: 0 16px;
    }

    .hv2-nav-item {
        padding: 8px 8px;
    }

    .hv2-hero-title {
        font-size: 26px;
    }

    .hv2-topdown .editor-panel {
        width: calc(100% - 24px);
    }

    .hv2-below {
        padding: 16px 12px 40px;
    }

    .hv2-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hv2-channels-all {
        margin-left: 0;
    }

    .hv2-scenes-grid {
        grid-template-columns: 1fr;
    }

    .hv2-cta-actions {
        flex-direction: column;
    }
}

/* ===== SEO 分区：三步用法 ===== */
.hv2-howto {
    margin-top: 56px;
}

.hv2-howto-grid {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.hv2-howto-step {
    flex: 1;
    max-width: 300px;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
}

.hv2-howto-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #EFF6FF;
    color: var(--spa-primary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hv2-howto-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--spa-text-main);
    margin-bottom: 6px;
}

.hv2-howto-desc {
    font-size: 13px;
    color: var(--spa-text-sub);
    line-height: 1.7;
    margin: 0;
}

.hv2-howto-arrow {
    align-self: center;
    color: #d1d5db;
    font-size: 20px;
    flex-shrink: 0;
}

/* ===== SEO 分区：四大还原能力（左右交替 + 前后对比演示卡） ===== */
.hv2-abilities {
    margin-top: 56px;
}

.hv2-ability-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 34px;
}

.hv2-ability-row-reverse {
    flex-direction: row-reverse;
}

.hv2-ability-text {
    flex: 1;
}

.hv2-ability-tag {
    display: inline-block;
    font-size: 12px;
    color: var(--spa-primary);
    background: #EFF6FF;
    border-radius: 8px;
    padding: 2px 10px;
    margin-bottom: 10px;
}

.hv2-ability-text h3 {
    font-family: var(--spa-font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--spa-text-main);
    margin: 0 0 8px;
}

.hv2-ability-text p {
    font-size: 14px;
    color: var(--spa-text-sub);
    line-height: 1.8;
    margin: 0;
}

.hv2-ability-demo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hv2-demo-before,
.hv2-demo-after {
    position: relative;
    border-radius: 10px;
    padding: 18px 16px 14px;
    font-size: 13px;
    line-height: 1.7;
}

.hv2-demo-before {
    background: #2B2B2B;
    color: #A7F3D0;
    font-family: "SF Mono", Consolas, Menlo, monospace;
}

.hv2-demo-after {
    background: #fff;
    border: 1px solid var(--spa-border);
    color: var(--spa-text-main);
    box-shadow: var(--spa-shadow-card);
}

.hv2-demo-label {
    position: absolute;
    top: -9px;
    left: 12px;
    font-size: 11px;
    color: #9ca3af;
    background: #FAF9F6;
    border: 1px solid var(--spa-border);
    border-radius: 8px;
    padding: 0 8px;
    font-family: var(--spa-font-sans);
}

.hv2-demo-label-after {
    color: var(--spa-primary);
    border-color: #BFDBFE;
}

.hv2-demo-math {
    display: block;
    text-align: center;
    font-family: "Times New Roman", serif;
    font-size: 17px;
    padding: 6px 0;
}

.hv2-demo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hv2-demo-table th,
.hv2-demo-table td {
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    text-align: center;
}

.hv2-demo-table th {
    background: #F3F4F6;
    font-weight: 600;
}

.hv2-demo-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
}

.hv2-demo-flow span {
    display: inline-block;
    border: 1.5px solid var(--spa-primary);
    color: var(--spa-primary);
    border-radius: 6px;
    padding: 3px 16px;
    font-size: 12px;
    background: #EFF6FF;
}

.hv2-demo-flow em {
    font-style: normal;
    color: #9ca3af;
    line-height: 1;
}

.hv2-demo-after-code code {
    display: block;
    background: #F6F8FA;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: "SF Mono", Consolas, Menlo, monospace;
    font-size: 12.5px;
}

.hv2-demo-after-code .k { color: #CF222E; }
.hv2-demo-after-code .f { color: #8250DF; }
.hv2-demo-after-code .s { color: #0A3069; }

/* ===== SEO 分区：多端矩阵大卡（深蓝底） ===== */
.hv2-devices {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-top: 56px;
    background: linear-gradient(135deg, #1E40AF, #2563EB 55%, #3B82F6);
    border-radius: 18px;
    padding: 44px 48px;
    color: #fff;
}

.hv2-devices-left {
    flex: 1;
}

.hv2-devices-badge {
    display: inline-block;
    font-size: 12px;
    color: #DBEAFE;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 2px 10px;
    margin-bottom: 12px;
}

.hv2-devices-left h2 {
    font-family: var(--spa-font-serif);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
    color: #fff;
}

.hv2-devices-left p {
    font-size: 14px;
    color: #DBEAFE;
    line-height: 1.8;
    margin: 0 0 20px;
}

.hv2-devices-all {
    display: inline-block;
    font-size: 14px;
    color: #1E40AF;
    background: #fff;
    border-radius: 10px;
    padding: 10px 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hv2-devices-all:hover {
    transform: translateY(-1px);
    color: #1E40AF;
}

.hv2-devices-right {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hv2-device-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 14px 18px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hv2-device-row:hover {
    background: rgba(255, 255, 255, 0.18);
}

.hv2-device-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.hv2-device-name em {
    font-style: normal;
    font-size: 11px;
    background: #fff;
    color: #1E40AF;
    border-radius: 6px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: 2px;
}

.hv2-device-desc {
    font-size: 12.5px;
    color: #BFDBFE;
}

/* ===== SEO 分区：FAQ ===== */
.hv2-faq {
    margin-top: 56px;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.hv2-faq .hv2-sec-title {
    margin-bottom: 20px;
}

.hv2-faq-item {
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 10px;
    padding: 0 18px;
    margin-bottom: 10px;
}

.hv2-faq-item summary {
    font-size: 15px;
    font-weight: 600;
    color: var(--spa-text-main);
    padding: 14px 0;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 26px;
}

.hv2-faq-item summary::-webkit-details-marker {
    display: none;
}

.hv2-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    font-weight: 400;
}

.hv2-faq-item[open] summary::after {
    content: "−";
    color: var(--spa-primary);
}

.hv2-faq-item p {
    font-size: 14px;
    color: var(--spa-text-sub);
    line-height: 1.8;
    margin: 0;
    padding: 0 0 16px;
}

/* ===== 新分区窄屏兜底 ===== */
@media (max-width: 900px) {
    .hv2-howto-grid {
        flex-direction: column;
        align-items: center;
    }

    .hv2-howto-arrow {
        transform: rotate(90deg);
    }

    .hv2-ability-row,
    .hv2-ability-row-reverse {
        flex-direction: column;
        gap: 18px;
    }

    .hv2-devices {
        flex-direction: column;
        padding: 32px 24px;
        gap: 24px;
    }
}

/* ============================================================
   B 版：左编辑器 + 右「格式预览工作台」两栏
   ============================================================ */

/* 工作行默认透明化：不影响经典三栏 / A、C 版居中编辑器布局 */
.hv2-work-row { display: contents; }

/* B 版 topdown：工作行变为两栏 flex，编辑器与预览各占一半 */
.hv2-vb.hv2-topdown .hv2-work-row {
    display: flex;
    gap: 14px;
    align-items: stretch;
    max-width: 1400px;
    width: min(1400px, calc(100% - 80px));
    height: 90vh;
    min-height: 640px;
    margin: 8px auto 0;
}

/* 左栏编辑器：取消原居中定位，改为行内主角，占据剩余最大空间（比预览宽） */
.hv2-vb.hv2-topdown .editor-panel {
    max-width: none;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
}

/* B 版 topdown 下收起编辑器自带的导出工具条（改由右栏导出条统一承接） */
.hv2-vb.hv2-topdown .editor-panel .export-buttons-area,
.hv2-vb.hv2-topdown .editor-panel .export-template-area {
    display: none !important;
}

/* B 版 topdown：压缩编辑器顶部「创作工作台」头条（60→44px），把高度还给正文编辑区，
   并与右栏格式切换器视觉对齐 */
.hv2-vb.hv2-topdown .editor-panel .editor-controls {
    height: 44px;
    padding: 0 12px 0 16px;
}

/* 中栏：竖排格式切换轨（仅 vb topdown 显示） */
.hv2-fmt-rail { display: none; }
.hv2-vb.hv2-topdown .hv2-fmt-rail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex: 0 0 132px;
    height: 100%;
    padding: 8px 0;
}

/* 右栏：纯预览区（收窄，让位给左侧编辑器） */
.hv2-preview-pane { display: none; }
.hv2-vb.hv2-topdown .hv2-preview-pane {
    display: flex;
    flex-direction: column;
    flex: 0 0 clamp(340px, 34%, 460px);
    min-width: 0;
    height: 100%;
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* --- 中栏：竖排格式项（图标 + 名称 + → 箭头） --- */
.hv2-fmt-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 10px 11px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}
.hv2-fmt-item:hover {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.hv2-fmt-item.is-active {
    background: #fff;
    border-color: var(--spa-border);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
}
.hv2-fmt-ico {
    flex: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hv2-fmt-ico svg { width: 24px; height: 24px; display: block; }
.hv2-fmt-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}
.hv2-fmt-item.is-active .hv2-fmt-name { color: var(--spa-text-main, #2B2B2B); font-weight: 600; }
/* → 箭头：指向右侧预览，寓意"左侧内容 → 该格式的最终形态"；默认淡出，选中/悬停显现 */
.hv2-fmt-arrow {
    flex: none;
    font-size: 16px;
    line-height: 1;
    color: #c8c8c8;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.hv2-fmt-item:hover .hv2-fmt-arrow { opacity: 0.55; transform: translateX(0); }
.hv2-fmt-item.is-active .hv2-fmt-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--spa-primary, #2563EB);
    font-weight: 700;
}

/* --- 预览区顶部：标注「最终效果预览」+ 承接模板选择与主导出按钮 ---
   两行网格：首行 标题 / 模板 chip / 下载按钮，次行副标题独占整宽（挤在首行会被截断） */
.hv2-preview-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "title chip btn"
        "sub   sub  sub";
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--spa-border);
    background: #FAFAF8;
}
/* 模板 chip 的 padding 比默认大一档，与下载按钮高度拉齐 */
.hv2-preview-head .hv2-tpl-chip { grid-area: chip; padding: 8px 10px; }
.hv2-preview-head .hv2-export-btn { grid-area: btn; }
.hv2-preview-head-title {
    grid-area: title;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--spa-text-main, #2B2B2B);
    white-space: nowrap;
    overflow: hidden;
}
/* 窄栏（预览栏最窄 340px）时标题让位给模板 chip 与按钮，截断带省略号 */
.hv2-preview-head-title-text { overflow: hidden; text-overflow: ellipsis; }
.hv2-preview-head-eye { color: var(--spa-primary, #2563EB); flex: none; }
.hv2-preview-head-sub {
    grid-area: sub;
    font-size: 12px;
    color: #999;
    padding-left: 21px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 标题与副标题直接参与顶栏网格，不再由这层包裹盒排版 */
.hv2-preview-head-main { display: contents; }

/* 预览缩放档（仅 Word/PDF） */
.hv2-zoom { display: flex; flex: none; border: 1px solid var(--spa-border); border-radius: 7px; overflow: hidden; background: #fff; }
.hv2-zoom-btn {
    border: none;
    background: transparent;
    padding: 4px 9px;
    font-size: 11px;
    color: #777;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hv2-zoom-btn + .hv2-zoom-btn { border-left: 1px solid var(--spa-border); }
.hv2-zoom-btn:hover { color: var(--spa-primary, #2563EB); }
.hv2-zoom-btn.is-active { background: var(--spa-primary, #2563EB); color: #fff; }

/* --- 预览台 --- */
.hv2-preview-stage {
    flex: 1 1 auto;
    overflow: auto;
    background: #F1F0EC;
    padding: 20px;
}
.hv2-preview-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
    color: #999;
    font-size: 14px;
}

/* --- 底部导出条 --- */
.hv2-export-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--spa-border);
    background: #fff;
}
.hv2-export-hint { flex: 1 1 auto; min-width: 0; font-size: 12px; color: #999; line-height: 1.4; }

/* Word/PDF 专属：导出模板选择 chip（点击唤起编辑器既有模板弹窗） */
.hv2-tpl-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    padding: 6px 10px;
    border: 1px solid var(--spa-border);
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hv2-tpl-chip:hover { border-color: var(--spa-primary, #2563EB); color: var(--spa-primary, #2563EB); }
.hv2-tpl-chip svg { flex: none; }
.hv2-tpl-caret { font-size: 10px; opacity: 0.7; }
.hv2-export-btn {
    flex: none;
    padding: 9px 20px;
    border-radius: 10px;
    background: var(--spa-primary, #2563EB);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.hv2-export-btn:hover { background: #1D4ED8; }

/* 处理中：转圈 + 禁止再次点击（导出要跑好几秒，没反馈会被当成没点上） */
.hv2-export-btn.is-busy { pointer-events: none; background: #4B7BE5; }
.hv2-export-spin {
    display: none;
    width: 13px;
    height: 13px;
    margin-right: 8px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hv2-spin 0.7s linear infinite;
}
.hv2-export-btn.is-busy .hv2-export-spin { display: inline-block; }
@keyframes hv2-spin { to { transform: rotate(360deg); } }

/* --- Word / PDF：真 A4 分页预览（页面尺寸/边距/字体全部由模板参数驱动，见 home-next.js layoutPages） --- */
.hv2-doc-wrap { position: relative; }   /* 100% 档时 doc 会溢出，由预览台横向滚动承接 */
.hv2-doc { transform-origin: top left; }   /* 宽度与 scale 由 JS 按 A4 与栏宽计算 */
.hv2-pg {
    position: relative;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
    margin-bottom: 22px;
    color: #000;
}
.hv2-pg-body { overflow: hidden; }
/* 单个块（超长表格/大图）高过一页时不裁剪，改为纸张变长，如实呈现 */
.hv2-pg.is-overflow { height: auto !important; }
.hv2-pg.is-overflow .hv2-pg-body { height: auto !important; overflow: visible; }
.hv2-pg-head,
.hv2-pg-foot {
    position: absolute;
    left: 0;
    right: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    color: #555;
    font-size: 9pt;
}
.hv2-pg-head { top: 0; align-items: flex-end; padding-bottom: 6px; justify-content: center; }
/* 页眉文字带下框线，对应导出时页眉段落的 w:pBdr（w:sz="6" 即 0.75pt，与文字间距 1pt） */
.hv2-pg-head-text { width: 100%; text-align: center; padding-bottom: 1pt; border-bottom: 0.75pt solid currentColor; }
.hv2-pg-foot { bottom: 0; }
.hv2-doc .hv2-pg-body img,
.hv2-doc .hv2-pg-body svg { max-width: 100%; }

/* --- 图片：卡片风格选择 + 手机宽卡片预览（iframe 与出图页同构） --- */
.hv2-card-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.hv2-card-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.hv2-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: 1px solid var(--spa-border);
    border-radius: 999px;
    background: #fff;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hv2-card-chip:hover { border-color: var(--spa-primary, #2563EB); color: var(--spa-primary, #2563EB); }
.hv2-card-chip.is-active {
    border-color: var(--spa-primary, #2563EB);
    color: var(--spa-primary, #2563EB);
    background: #EFF6FF;
    font-weight: 600;
}
.hv2-card-cdot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,0.06); }

.hv2-card-fonts { display: flex; gap: 0; border: 1px solid var(--spa-border); border-radius: 7px; overflow: hidden; width: fit-content; background: #fff; }
.hv2-card-fbtn {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 11px;
    color: #777;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hv2-card-fbtn + .hv2-card-fbtn { border-left: 1px solid var(--spa-border); }
.hv2-card-fbtn.is-active { background: var(--spa-primary, #2563EB); color: #fff; }

/* 卡片固定 375px（手机宽，与出图一致），栏宽不够时整体等比缩放，绝不压缩内部布局 */
/* align-items 不能用默认的 stretch：容器高度是按 iframe 内容算出来设的，
   再把 iframe 拉伸到容器高度就成了循环依赖，切小字号时高度缩不回去、底部留一大片空白 */
.hv2-card-stage { display: flex; justify-content: center; align-items: flex-start; overflow: hidden; }
.hv2-card-frame {
    width: 375px;
    flex: none;
    border: 0;
    display: block;
    transform-origin: top center;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
    background: #fff;
}

/* --- 公众号：手机窄屏预览 --- */
.hv2-phone-scroll { display: flex; justify-content: center; }
.hv2-phone {
    width: 375px;
    max-width: 100%;
    background: #fff;
    border: 8px solid #1a1a1a;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}
.hv2-phone-body {
    /* 产物自带 padding:0 10px 的外层 section，这里补足到公众号正文约 20px 的左右边距 */
    padding: 18px 10px;
    color: #2B2B2B;
    font-size: 16px;
    line-height: 1.75;
    word-break: break-word;
}
.hv2-phone-body img, .hv2-phone-body svg, .hv2-phone-body table { max-width: 100%; }
.hv2-phone-body h1 { font-size: 21px; }
.hv2-phone-body h2 { font-size: 19px; }
.hv2-phone-body h3 { font-size: 17px; }

/* --- Excel：表格网格 --- */
.hv2-xls-block {
    background: #fff;
    border: 1px solid var(--spa-border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}
/* 滚动收敛到表格这一层，名称条不参与横向滚动 */
.hv2-xls-scroll { overflow: auto; }
.hv2-xls-name {
    padding: 6px 10px;
    font-size: 12px;
    color: #666;
    background: #F7F6F2;
    border-bottom: 1px solid var(--spa-border);
}
table.hv2-xls { border-collapse: collapse; font-size: 13px; }
/* 对齐方式与导出一致：ExcelConverter 给每个单元格设了水平+垂直居中 */
table.hv2-xls th, table.hv2-xls td {
    border: 1px solid #dcdcdc;
    padding: 5px 10px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    color: #333;
}
table.hv2-xls .hv2-xls-corner,
table.hv2-xls .hv2-xls-colh,
table.hv2-xls .hv2-xls-rowh {
    background: #F3F3F1;
    color: #999;
    font-weight: 400;
    text-align: center;
}
/* 表头与导出一致：ExcelConverter 只对首行加粗，没有填充色也没有字体色 */
table.hv2-xls tr.hv2-xls-head td { font-weight: 700; }

/* --- 占位 / 引导态（图片·PPT） --- */
.hv2-stage-tip {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    gap: 10px;
}
.hv2-stage-tip-emoji { font-size: 44px; }
.hv2-stage-tip-title { font-size: 17px; font-weight: 600; color: #333; }
.hv2-stage-tip-desc { font-size: 13px; color: #777; max-width: 320px; line-height: 1.7; }

/* --- 窄屏：两栏改上下堆叠 --- */
@media (max-width: 1100px) {
    .hv2-vb.hv2-topdown .hv2-work-row {
        flex-direction: column;
        height: auto;
        width: calc(100% - 32px);
    }
    .hv2-vb.hv2-topdown .editor-panel { height: 56vh; }
    .hv2-vb.hv2-topdown .hv2-preview-pane { height: 72vh; }
    /* 窄屏堆叠：格式轨改为横向排列，夹在编辑器与预览之间 */
    .hv2-vb.hv2-topdown .hv2-fmt-rail {
        flex-direction: row;
        flex: none;
        height: auto;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        padding: 4px 0;
    }
    .hv2-vb.hv2-topdown .hv2-fmt-item { width: auto; }
    .hv2-vb.hv2-topdown .hv2-fmt-arrow { display: none; }
}

/* --- 公众号：风格切换 chips --- */
.hv2-wx { display: flex; flex-direction: column; gap: 14px; }
.hv2-wx-themes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hv2-wx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 16px;
    border: 1px solid var(--spa-border);
    background: #fff;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hv2-wx-chip:hover { color: #333; border-color: #c9c9c9; }
.hv2-wx-chip.is-active { background: #F0F0EE; color: #222; border-color: #c4c4c0; font-weight: 600; }
.hv2-wx-cdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hv2-wx-loading { padding: 44px 0; text-align: center; color: #aaa; font-size: 14px; }
