/* 多语言文字溢出处理 - 通用解决方案 */

/* 基础文字溢出处理 */
.text-overflow-base {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
}

/* 针对不同语言的处理 */
[data-lang="en"] .text-overflow-base {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

[data-lang="zh"] .text-overflow-base {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 创始人页面speech-text特殊处理 */
.speech-text {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    line-height: 1.6;
}

.speech-text p {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    margin-bottom: 50px;
    text-align: justify;
}

/* 产品详情页面面料解析内容处理 */
.analysis-content,
.analysis-content p,
#fabricDescription {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    line-height: 1.8;
    text-align: justify;
}

/* 关于页面section内容处理 */
.section-block p,
.section-block span {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.8;
    text-align: justify;
}

/* 可持续发展页面section描述处理 */
.section-description,
.section-description p {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.8;
    text-align: justify;
}

/* 科研创新页面内容处理 */
.capability-block p,
.capability-block .section-description {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.8;
    text-align: justify;
}

/* 通用段落文字处理 */
p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 长文本内容特殊处理 */
.long-text-content {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    line-height: 1.8;
    text-align: justify;
}

/* 标题文字处理 */
h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 按钮文字处理 */
button, .button, .btn {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* 导航菜单文字处理 */
.nav-link, .dropdown-menu a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* 表格内容处理 */
table td, table th {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 卡片内容处理 */
.card, .card-body, .card-text {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 特殊容器处理 */
.container-fluid, .container {
    overflow-wrap: break-word;
}

/* 响应式文字处理 */
@media (max-width: 768px) {
    .speech-text,
    .analysis-content,
    .section-description,
    .capability-block p {
        font-size: 14px;
        line-height: 1.6;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
    }
}

@media (max-width: 480px) {
    .speech-text,
    .analysis-content,
    .section-description,
    .capability-block p {
        font-size: 13px;
        line-height: 1.5;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
    }
}

/* 英文环境下的特殊处理 */
html[lang="en"] .speech-text,
html[lang="en"] .analysis-content,
html[lang="en"] .section-description,
html[lang="en"] .capability-block p {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    text-align: justify;
    text-justify: inter-word;
}

/* 中文环境下的特殊处理 */
html[lang="zh"] .speech-text,
html[lang="zh"] .analysis-content,
html[lang="zh"] .section-description,
html[lang="zh"] .capability-block p {
    word-break: break-all;
    overflow-wrap: break-word;
    text-align: justify;
}

/* 防止特定元素被破坏的保护 */
.no-break {
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: nowrap !important;
}

/* 品牌名称、产品编号等不应该被断行的内容 */
.brand-name,
.product-code,
.company-name,
.logo-text {
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: nowrap !important;
}

/* 数字和代码不应该被断行 */
code, .code, .product-specs .spec-value {
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: nowrap !important;
}

/* 确保容器有足够的空间 */
.text-container {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 弹性布局下的文字处理 */
.flex-text {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 网格布局下的文字处理 */
.grid-text {
    min-width: 0;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 自动调整字体大小 */
.auto-resize-text {
    font-size: clamp(12px, 2vw, 16px);
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 文字省略处理（用于单行文本） */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 多行文字省略处理 */
.text-ellipsis-multiline {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 滚动条样式优化 */
.scrollable-text {
    overflow-y: auto;
    max-height: 500px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.scrollable-text::-webkit-scrollbar {
    width: 6px;
}

.scrollable-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.scrollable-text::-webkit-scrollbar-thumb {
    background: #C6AA76;
    border-radius: 3px;
}

.scrollable-text::-webkit-scrollbar-thumb:hover {
    background: #B8A068;
} 

/* 创始人页面英文模式下的段落隐藏处理 */
html[lang="en"] .speech-text p[data-no-translate] {
    display: none !important;
}

/* 确保隐藏段落不影响布局 */
.speech-text p[data-no-translate] {
    transition: opacity 0.3s ease;
} 