/* ============================================================================
   多语言适配层（i18n.css）
   ----------------------------------------------------------------------------
   中文版排版按「2~6 字短标签 + 两行大标题」设计，直译成德语/俄语/孟加拉语等
   长文本语言后：导航被挤出容器、首屏标题压到留资卡、按钮撑破头部。
   本文件只做「非中文语种的收敛」与「RTL 镜像」，不改中文版观感。

   中文判定：html[lang="cn"] / html[lang^="zh-"]（zh-Hant 等）保持原样，
   其余语言统一通过 html:not(:lang(cn)):not(:lang(zh)) 命中。
   ============================================================================ */

/* ---------- 1. 全局：长词换行 + 横向溢出兜底 ---------- */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6, p, li, dd, dt, blockquote, figcaption,
a, span, b, strong, em, i, small, label, td, th, button {
    overflow-wrap: break-word;
    word-break: normal;
}

/* flex / grid 子项默认 min-width:auto 会把容器撑破 */
.wl-wrap,
.wl-hero__in > *,
.wl-hd__main .wl-wrap > *,
.wl-hd__util .wl-wrap > *,
.wl-stats__in > *,
.wl-hero__stats > *,
.wl-grid > *,
.wl-cards > *,
.wl-sorts > * {
    min-width: 0;
}

/* ---------- 2. 非中文语种：页头收敛 ---------- */
html:not(:lang(cn)):not(:lang(zh)) .wl-hd__main .wl-wrap {
    gap: 18px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-nav__a {
    font-size: 14.5px;
    padding: 0 11px;
    letter-spacing: -.1px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-logo__txt b {
    font-size: 19px;
    letter-spacing: .3px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-logo__txt i {
    letter-spacing: 1.2px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hd__act {
    gap: 8px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hd__util-l {
    letter-spacing: 0;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hd__util-r {
    gap: 14px;
}

/* 导航不参与压缩，靠右侧动作区让位，避免互相压字 */
html:not(:lang(cn)):not(:lang(zh)) .wl-nav {
    min-width: 0;
    overflow: hidden;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-nav__list {
    flex-wrap: nowrap;
}

/* 外语站页头：容器 .wl-wrap 最大宽 1480px（--wrap），窗口再宽行宽也不增长。
   所以「收按钮文案、隐藏热线、缩小 logo」这些让宽度的规则必须常驻——
   原先挂在 max-width:1599 里，1600px 以上窗口（行宽仍是 1480）时全部失效，
   导航超宽 86px（德语 358px）被 .wl-nav 的 overflow:hidden 切掉最后一栏。 */
html:not(:lang(cn)):not(:lang(zh)) .wl-hd__act .wl-md-hide {
    display: none !important;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hd__act .wl-md-show {
    display: inline !important;
}

/* 热线文案很长（Free survey · design consultation / Kontaktieren Sie uns），
   1480 的行宽里放不下「logo + 8 栏 + 热线 + 按钮」；号码顶栏、页脚、右侧悬浮栏都有，
   这里对所有语言统一收掉，避免把导航挤到 overflow:hidden 里被切。 */
.wl-hd__phone {
    display: none !important;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-nav__a {
    font-size: 14px;
    padding: 0 10px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-logo__txt i {
    display: none;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-logo__mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

/* 首页入口由 logo 承担，只在 1440 以下收起，宽屏保留完整 8 栏 */
@media (max-width: 1439px) {
    html:not(:lang(cn)):not(:lang(zh)) .wl-nav__list > li:first-child {
        display: none;
    }
}

@media (min-width: 1024px) and (max-width: 1439px) {
    html:not(:lang(cn)):not(:lang(zh)) .wl-nav__a {
        font-size: 13.5px;
        padding: 0 8px;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-hd__main .wl-wrap {
        gap: 12px;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-hd__phone {
        display: none;
    }
}

/* ---------- 3. 非中文语种：首屏 ---------- */
/* 首屏保留老站同一套大图（模板原样），只收敛标题与标签的字号 */

/* 右侧悬浮快捷栏：小方块放不下长文案，改为纯图标，避免压住右侧留资卡 */
html:not(:lang(cn)):not(:lang(zh)) .wl-rail {
    right: 12px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-rail__i {
    width: 54px;
    height: 54px;
    padding: 0;
    font-size: 0;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-rail__i > span:not(.wl-rail__pop) {
    display: none;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-rail__i svg {
    width: 24px;
    height: 24px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hero__t {
    font-size: clamp(25px, 2.9vw, 44px);
    line-height: 1.2;
    letter-spacing: -.4px;
    max-width: 24em;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hero__tag {
    font-size: 12.5px;
    padding: 8px 16px;
    letter-spacing: .2px;
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hero__d {
    font-size: 16px;
    line-height: 1.85;
    margin-top: 20px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hero__pts span {
    font-size: 13px;
    padding: 8px 14px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-hero__act {
    margin-top: 32px;
    gap: 12px;
}

/* 首屏数据条：长文案两行 */
html:not(:lang(cn)):not(:lang(zh)) .wl-hero__stat span {
    line-height: 1.5;
    margin-top: 10px;
}

/* ---------- 4. 非中文语种：区块标题 / 卡片 ---------- */
html:not(:lang(cn)):not(:lang(zh)) .wl-h2,
html:not(:lang(cn)):not(:lang(zh)) .wl-sec__t {
    font-size: clamp(24px, 2.6vw, 38px);
    letter-spacing: -.5px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-filter a {
    padding: 0 18px;
    min-height: 46px;
    font-size: 14.5px;
}

html:not(:lang(cn)):not(:lang(zh)) .wl-leadcard__t {
    font-size: 20px;
    letter-spacing: -.2px;
}

/* ---------- 5. 语言菜单：33 项两列铺开，一屏看全 ---------- */
.wl-lang__menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    width: 524px;
    max-width: calc(100vw - 24px);
    max-height: min(82vh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    min-width: 0;
}

.wl-lang__menu .lang-flag {
    width: 20px;
    height: 14px;
}

.wl-lang__i {
    padding: 6px 10px;
    gap: 8px;
}

.wl-lang__i b {
    font-size: 12.5px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-lang__i i {
    font-size: 10.5px;
    white-space: nowrap;
    flex: none;
}

/* 屏幕不高时（笔记本/小窗口）改三列，保证 33 项一屏看全 */
@media (max-height: 840px) {
    .wl-lang__menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 700px;
        max-height: min(88vh, 540px);
    }

    /* 三列时每格更窄，省掉右侧国家名，保证语言名不被截断 */
    .wl-lang__menu .wl-lang__i i {
        display: none;
    }
}

/* 桌面上窄（1024~1279）也走三列，避免菜单比屏幕还宽 */
@media (max-width: 1279px) and (min-width: 1024px) {
    .wl-lang__menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 620px;
    }

    .wl-lang__menu .wl-lang__i i {
        display: none;
    }
}

/* 手机端：两列 + 宽度自适应 */
@media (max-width: 767px) {
    .wl-lang__menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(92vw, 360px);
        max-height: 62vh;
    }

    .wl-lang__i {
        padding: 7px 8px;
        gap: 6px;
    }

    .wl-lang__i b {
        font-size: 12.5px;
    }

    .wl-lang__menu .wl-lang__i i {
        display: none;
    }
}

/* 移动端抽屉里的语言分段：33 项改为网格，可滚动 */
.wl-langm__seg {
    flex-wrap: wrap;
    max-height: 34vh;
    overflow-y: auto;
}

.wl-langm__seg a {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    min-height: 40px;
    font-size: 13px;
    padding: 0 6px;
}

/* ---------- 6. 各语种字体栈（本地缺字体时按序回退） ---------- */
html:lang(th) body { font-family: "Noto Sans Thai", "Leelawadee UI", "Tahoma", system-ui, sans-serif; }
html:lang(bn) body { font-family: "Noto Sans Bengali", "Nirmala UI", "Bangla MN", "Vrinda", system-ui, sans-serif; }
html:lang(hi) body { font-family: "Noto Sans Devanagari", "Nirmala UI", "Mangal", system-ui, sans-serif; }
html:lang(mr) body { font-family: "Noto Sans Devanagari", "Nirmala UI", "Mangal", system-ui, sans-serif; }
html:lang(gu) body { font-family: "Noto Sans Gujarati", "Nirmala UI", "Shruti", system-ui, sans-serif; }
html:lang(ta) body { font-family: "Noto Sans Tamil", "Nirmala UI", "Latha", system-ui, sans-serif; }
html:lang(te) body { font-family: "Noto Sans Telugu", "Nirmala UI", "Gautami", system-ui, sans-serif; }
html:lang(km) body { font-family: "Noto Sans Khmer", "Khmer UI", "Leelawadee UI", system-ui, sans-serif; }
html:lang(my) body { font-family: "Noto Sans Myanmar", "Myanmar Text", "Padauk", system-ui, sans-serif; }
html:lang(ar) body { font-family: "Noto Sans Arabic", "Segoe UI", "Tahoma", system-ui, sans-serif; }
html:lang(fa) body { font-family: "Noto Sans Arabic", "Vazirmatn", "Tahoma", system-ui, sans-serif; }
html:lang(ur) body { font-family: "Noto Sans Arabic", "Noto Nastaliq Urdu", "Tahoma", system-ui, sans-serif; }
html:lang(he) body { font-family: "Noto Sans Hebrew", "Segoe UI", "Arial Hebrew", system-ui, sans-serif; }
html:lang(ko) body { font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Microsoft YaHei", system-ui, sans-serif; }
html:lang(ja) body { font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif; }

/* ---------- 7. RTL（ar / he / fa / ur） ---------- */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .wl-hero::after {
    background: linear-gradient(260deg, #FFFFFF 0%, rgba(255, 255, 255, .97) 26%,
        rgba(255, 255, 255, .86) 46%, rgba(240, 248, 255, .55) 68%, rgba(240, 248, 255, .18) 100%);
}

html[dir="rtl"] .wl-hero::before {
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, .75), transparent 62%);
    mask-image: linear-gradient(to left, rgba(0, 0, 0, .75), transparent 62%);
}

/* 页头：logo / 导航 / 动作区整体镜像（flex 顺序自动翻转，这里只修边线） */
html[dir="rtl"] .wl-lang {
    padding-left: 0;
    padding-right: 22px;
    border-left: 0;
    border-right: 1px solid var(--c-line);
}

html[dir="rtl"] .wl-lang__menu {
    left: 0;
    right: auto;
}

html[dir="rtl"] .wl-lang__menu::before {
    right: auto;
    left: 22px;
}

html[dir="rtl"] .wl-lang__i i {
    margin-left: 0;
    margin-right: auto;
}

/* 数据条分隔线/内边距镜像 */
html[dir="rtl"] .wl-hero__stat:not(:first-child) {
    border-left: 0;
    border-right: 1px solid var(--c-line);
    padding-left: 20px;
    padding-right: 44px;
}

/* 方向性图标镜像 */
html[dir="rtl"] .wl-btn svg,
html[dir="rtl"] .wl-linkmore svg,
html[dir="rtl"] .wl-nav__a > svg {
    transform: scaleX(-1);
}

html[dir="rtl"] .wl-nav__i:hover .wl-nav__a svg {
    transform: scaleX(-1) rotate(180deg);
}

/* 面包屑 / 列表里的方向箭头 */
html[dir="rtl"] .wl-crumb svg {
    transform: scaleX(-1);
}

/* 表单标签与占位对齐 */
html[dir="rtl"] .wl-fld,
html[dir="rtl"] .wl-fld label,
html[dir="rtl"] .wl-form input,
html[dir="rtl"] .wl-form select,
html[dir="rtl"] .wl-form textarea {
    text-align: right;
}

html[dir="rtl"] .wl-leadcard__ft {
    justify-content: flex-start;
}

/* 悬浮侧栏贴左 */
html[dir="rtl"] .wl-side,
html[dir="rtl"] .wl-fab {
    right: auto;
    left: 16px;
}

/* ---------- 8. 移动端：非中文语种进一步压缩 ---------- */
@media (max-width: 767px) {
    html:not(:lang(cn)):not(:lang(zh)) .wl-hero__t {
        font-size: clamp(22px, 6.4vw, 30px);
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-hero__tag {
        font-size: 11.5px;
        line-height: 1.5;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-hd__main .wl-wrap {
        gap: 10px;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-logo__txt b {
        font-size: 17px;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-logo__txt i {
        font-size: 9.5px;
        letter-spacing: .8px;
    }

    /* 头部 CTA 让位给汉堡与语言键（底部转化条已有同名按钮） */
    html:not(:lang(cn)):not(:lang(zh)) .wl-hd__act .wl-btn--cta {
        display: none;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-hd__act {
        gap: 6px;
    }

    /* 底部转化条：长文案限两行，不撑高 */
    html:not(:lang(cn)):not(:lang(zh)) .wl-mbar a,
    html:not(:lang(cn)):not(:lang(zh)) .wl-mbar button {
        font-size: 11px;
        line-height: 1.2;
        gap: 2px;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-mbar .is-main {
        font-size: 11.5px;
        gap: 6px;
        padding: 0 8px;
    }

    html:not(:lang(cn)):not(:lang(zh)) .wl-mbar .is-main span {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ---------- 5b. 兜底：菜单只认 .is-open ----------
   一旦有残留样式（旧版调试样式被浏览器缓存）把菜单常显，这里用 !important 把
   可见性钉回「由 .is-open 单一决定」，避免出现关不掉的下拉。 */
.wl-lang:not(.is-open) .wl-lang__menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.wl-lang.is-open .wl-lang__menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ---------- 9. 导航：一级栏目单行显示 ----------
   老站中文标签 2~4 字，一行放得下；换成外语后（Referenzen / Nachrichten 之类）
   很容易被挤成两行，导航高度不齐、看着乱。这里统一禁止折行，并按窗口宽度分档
   收字号与内距，保证 logo、8 个栏目、右侧按钮始终排在一行、互不压盖。

   分档说明（外语站）：
     ≥1440      14px / 内距 10        —— 行宽被 --wrap（1480）封顶，这一档是常态
     1280~1439  13.5px / 内距 9
     1200~1279  12.5px / 内距 9
     1024~1199  12px / 内距 6，隐藏 logo 文字与下拉箭头
   泰/缅/高棉/泰米尔/孟加拉/古吉拉特等字形更宽的语言，各档再降 1~1.5px。 */
.wl-nav__list {
    flex-wrap: nowrap;
}

.wl-nav__i {
    flex: 0 0 auto;
}

.wl-nav__a {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 15em;
}

@media (min-width: 1440px) {
    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)) .wl-nav__a {
        font-size: 14px;
        padding: 0 10px;
        letter-spacing: 0;
    }

    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)):is(:lang(th), :lang(my), :lang(km), :lang(ta), :lang(te), :lang(bn), :lang(gu), :lang(hi), :lang(mr)) .wl-nav__a {
        font-size: 13.5px;
        padding: 0 8px;
    }
}

@media (min-width: 1280px) and (max-width: 1439px) {
    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)) .wl-nav__a {
        font-size: 13.5px;
        padding: 0 11px;
        letter-spacing: 0;
    }

    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)):is(:lang(th), :lang(my), :lang(km), :lang(ta), :lang(te), :lang(bn), :lang(gu), :lang(hi), :lang(mr)) .wl-nav__a {
        font-size: 13px;
        padding: 0 6px;
    }

    .wl-nav__a svg {
        width: 12px;
        height: 12px;
    }
}

@media (min-width: 1200px) and (max-width: 1279px) {
    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)) .wl-nav__a {
        font-size: 12.5px;
        padding: 0 9px;
        letter-spacing: 0;
    }

    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)):is(:lang(th), :lang(my), :lang(km), :lang(ta), :lang(te), :lang(bn), :lang(gu), :lang(hi), :lang(mr)) .wl-nav__a {
        font-size: 11.5px;
        padding: 0 4px;
    }

    .wl-nav__a svg {
        width: 11px;
        height: 11px;
    }
}

/* 1024~1199（小平板、半屏窗口）：logo 只留图形、栏目去掉下拉箭头 */
@media (min-width: 1024px) and (max-width: 1199px) {
    html:not(:lang(zh)):not(:lang(cn)) .wl-logo__txt {
        display: none;
    }

    html:not(:lang(zh)):not(:lang(cn)) .wl-hd__main .wl-wrap {
        gap: 10px;
    }

    html:not(:lang(zh)):not(:lang(cn)) .wl-nav__list {
        gap: 0;
    }

    html:not(:lang(zh)):not(:lang(cn)) .wl-nav__a {
        font-size: 12px;
        padding: 0 6px;
        letter-spacing: 0;
    }

    html:not(:lang(zh)):not(:lang(cn)) .wl-nav__a svg {
        display: none;
    }

    html:not(:lang(zh)):not(:lang(cn)):is(:lang(th), :lang(my), :lang(km), :lang(ta), :lang(te), :lang(bn), :lang(gu), :lang(hi), :lang(mr)) .wl-nav__a {
        font-size: 11px;
        padding: 0 4px;
    }
}

/* 中文站：行宽同样被 --wrap（1480）封顶，16px 字号 + 18px 内距在 8 个栏目下会超 12~42px，
   按档把内距/字号收一点（≥1440 观感与老站基本一致） */
@media (min-width: 1600px) {
    html:lang(zh) .wl-nav__a {
        padding: 0 14px;
    }
}

@media (min-width: 1280px) and (max-width: 1439px) {
    html:lang(zh) .wl-nav__a {
        font-size: 15px;
        padding: 0 10px;
    }
}

@media (max-width: 1279px) {
    html:lang(zh) .wl-nav__a {
        font-size: 14px;
        padding: 0 8px;
    }
}

/* 1024~1199 中文站：老站页头在这个宽度本来就会挤到按钮上，
   只把栏目标字号与内距收一点，观感与 ≥1200 基本一致 */
@media (min-width: 1024px) and (max-width: 1199px) {
    html:lang(zh) .wl-nav__a {
        font-size: 13.5px;
        padding: 0 4px;
    }

    html:lang(zh) .wl-logo__txt i {
        display: none;
    }

    html:lang(zh) .wl-hd__act .wl-md-hide {
        display: none !important;
    }

    html:lang(zh) .wl-hd__act .wl-md-show {
        display: inline !important;
    }
}

/* ---------- 10. 宽屏（≥1600）：版心放大到 1640/1760 后，导航也跟着放大 ---------- */
@media (min-width: 1600px) {
    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)) .wl-nav__a {
        font-size: 15px;
        padding: 0 14px;
    }

    html:not(:lang(zh)):not(:lang(cn)):not(:lang(ja)):not(:lang(ko)):is(:lang(th), :lang(my), :lang(km), :lang(ta), :lang(te), :lang(bn), :lang(gu), :lang(hi), :lang(mr)) .wl-nav__a {
        font-size: 14.5px;
        padding: 0 10px;
    }

    html:lang(zh) .wl-nav__a {
        font-size: 16px;
        padding: 0 16px;
    }
}
