/* ========== H5 手机适配 ========== */
@media (max-width: 768px) {
    /* 顶部导航 */
    .mobile-detail-header {
        display: flex;
        align-items: center;
        padding: 10px 16px;
        background: #fff;
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    /* 基础布局 */
    html, body {
        overflow: visible;
        height: auto;
    }
    .detail-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    /* 左侧面板 */
    .detail-panel-wrap {
        width: 100%;
        min-width: auto;
        height: auto;
        border-right: none;
        box-shadow: none;
    }
    .detail-panel-inner {
        padding: 12px 16px;
        overflow-y: visible;
    }
    .sidebar-logo {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .detail-footer {
        padding: 12px 16px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .detail-model-select {
        font-size: 12px;
        padding: 6px 10px;
    }
    .detail-generate-btn {
        font-size: 13px;
        padding: 10px 16px;
    }

    /* 右侧图片区 */
    .detail-image-wrap {
        height: auto;
        min-height: 300px;
        overflow: visible;
        padding: 10px;
        margin-top: 0;
        flex: none;
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    .detail-image-wrap::before {
        display: none;
    }
    .detail-image-stats {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 8px;
        margin-bottom: 8px;
        backdrop-filter: none;
        background: rgba(255,255,255,0.85);
    }
    .detail-image-stat-item {
        font-size: 11px;
        padding: 4px 8px;
        gap: 3px;
    }

    /* 主图容器 - 修复宽度问题 */
    figure.detail-page-img-wrap {
        width: 100% !important;
        display: block !important;
        margin: 0 auto !important;
    }
    .detail-img-container {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }
    .detail-main-title {
        width: 100%;
        text-align: center;
    }
    .detail-main-title h1 {
        font-size: 14px !important;
        line-height: 1.4;
    }
    img.detail-page-img {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 50vh !important;
        object-fit: contain !important;
        display: block !important;
    }

    /* 缩略图条 */
    .detail-thumb-strip {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        flex-direction: row;
        gap: 6px;
        margin-bottom: 8px;
        overflow-x: auto;
        padding: 4px 0;
        justify-content: flex-start;
    }
    .detail-thumb-item {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    /* 相关推荐 - 左右横向滚动 */
    .detail-related-fixed {
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #e6e8ee;
        flex-direction: column;
    }
    .related-header {
        padding: 12px 16px;
    }
    .related-content {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 12px;
        max-height: none;
        -webkit-overflow-scrolling: touch;
    }
    .related-scroll {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px;
        width: max-content;
        padding-bottom: 4px;
    }
    .related-item {
        width: 120px !important;
        flex-shrink: 0;
    }
    .related-item img {
        width: 100%;
        height: 80px;
        object-fit: cover;
    }
    .related-item-title {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .detail-page-img-wrap {
        width: 100% !important;
        max-width: 100% !important;
    }
    
  /* 彻底覆盖 detail.css 的图片区样式 */
.detail-image-wrap {
    display: block !important;
    height: auto !important;
    width: 100% !important;
    padding: 10px !important;
}

.detail-image-wrap .detail-page-img-wrap {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    padding-right: 0 !important;
    display: block !important;
    flex-direction: unset !important;
}

.detail-image-wrap .detail-page-img {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 50vh !important;
}

.detail-img-container {
    width: 100% !important;
    max-width: 100% !important;
}
.detail-layout {
    flex-direction: column-reverse;  /* 颠倒顺序 */
}

html, body {
    overflow: visible !important;
    height: auto !important;
}
.detail-layout {
    overflow: visible !important;
}

.detail-prompt-text {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

 /* 1. 修复核心风格解析文本换行 */
 .style-content {
    word-break: break-word !important;
    white-space: pre-wrap !important;
    overflow-wrap: break-word !important;
}

/* 2. 修复适用场景标签样式 */
.usage-tag {
    display: inline-block !important;
    padding: 4px 12px !important;
    background: #f0f4f8 !important;
    color: #2c5282 !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    margin: 4px 4px 4px 0 !important;
}

/* 3. 修复展开收缩功能 - 强制允许点击 */
.analysis-item {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

.analysis-item:active {
    background: rgba(0,0,0,0.02);
}

/* 确保 analysis-content 能正确显示 */
.analysis-content {
    display: none;
    word-break: break-word;
}
.analysis-item.active .analysis-content {
    display: block !important;
}
.analysis-item .analysis-title {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    overflow: visible !important;
    width: 100% !important;
}

.analysis-item .analysis-title svg {
    flex-shrink: 0 !important;
    width: 14px !important;
    height: 14px !important;
}

/* 修复包含按钮的div容器 */
.analysis-item .analysis-title > div[style*="display: flex"] {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    gap: 6px !important;
}

.analysis-item .analysis-title h2,
.analysis-item .analysis-title h3 {
    white-space: nowrap !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* 确保箭头图标不换行 */
.analysis-item .analysis-title > svg.arrow-icon {
    flex-shrink: 0 !important;
    order: -1 !important;
}

/* 彻底隐藏相关推荐（更强选择器） */
body .detail-related-fixed,
.detail-image-wrap .detail-related-fixed,
aside.detail-related-fixed {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* 同时隐藏相关推荐内部所有元素 */
.relatedzh {
    display: none !important;
}

.analysis-item .analysis-title h3 {
    display: inline !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

/* 同时确保 span 不换行 */
.analysis-item .analysis-title > span {
    display: inline !important;
    flex-shrink: 0 !important;
}
}