/* =========================================================
   528btc 文章页静态复刻 · 补充样式
   - 16 语种排版适配（含阿拉伯语 RTL）
   - 小屏自适应（原站为固定 1200px PC 布局）
   ========================================================= */

/* ---------- 多语言字体 ---------- */
html[lang="ar"] body,
html[lang="hi"] body {
    font-family: "Noto Sans Arabic", "Noto Sans Devanagari", "PingFang TC",
        "Microsoft JhengHei", "Microsoft YaHei", Arial, sans-serif;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .leftside-navbar {
    flex-direction: row-reverse;
}

html[dir="rtl"] .article_time > div {
    text-align: right;
}

/* ---------- 非中文语种：导航收紧，避免长译文挤压搜索框 ---------- */
html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) header .header_by .BJ_lt > ul > li {
    margin-left: 4px;
}

html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) header .header_by .BJ_lt > ul > li > a {
    font-size: 13px;
    white-space: nowrap;
}

html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) header .header_by .BJ_rt .header_box > * {
    margin-left: 10px;
}

html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) header .header_by .BJ_rt .header_box .ipt input {
    width: 100px;
}

/* 非中文语种按单词换行，避免英文/德文等标题被拆成两截 */
html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) .article .article_title {
    word-break: normal;
    overflow-wrap: break-word;
}

html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) .rich_text p,
html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) .events_conten,
html:not([lang="zh-Hans"]):not([lang="zh-Hant"]) .new_article_title a {
    overflow-wrap: break-word;
}

/* ---------- 自适应 ---------- */
@media (max-width: 1240px) {
    .BJ_main {
        width: auto !important;
        max-width: 1200px;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    /* 头部导航在 901-1240px 之间收紧间距，避免换行挤压 */
    header .header_by .BJ_lt > ul {
        flex-wrap: nowrap;
    }

    header .header_by .BJ_lt > ul > li {
        margin-left: 10px;
    }

    header .header_by .BJ_lt > ul > li > a {
        font-size: 14px;
    }

    header .header_by .BJ_rt .header_box .ipt input {
        width: 110px;
    }

    header .header_by .BJ_rt .header_box > * {
        margin-left: 14px;
    }

    .footer_bj .BJ_main {
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    .BJ_by .BJ_main {
        display: block;
    }

    .BJ_by .BJ_main .BJ_lt {
        width: 100% !important;
        min-width: 0;
    }

    /* 正文与摘要使用固定 820px 宽度，窄屏改为 100% 防止横向裁切 */
    .BJ_by .BJ_main .article,
    .BJ_by .BJ_main .article .Abstract,
    .BJ_by .BJ_main #contentToCapture,
    .BJ_by .BJ_main .rich_text {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .BJ_by .BJ_main .rich_text img,
    .BJ_by .BJ_main .Abstract_img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* 右侧栏（行情 / 快讯）在窄屏隐藏，保证正文可读 */
    .BJ_by .BJ_main .BJ_rt {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .leftside-navbar {
        flex-wrap: nowrap;
    }

    .header_by .BJ_lt,
    .header_by .BJ_rt {
        width: auto !important;
    }
}

/* 960px 左右英文/德文导航更长，进一步收紧，保证单行 */
@media (max-width: 1000px) {
    header .header_by .BJ_lt > ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    header .header_by .BJ_lt > ul::-webkit-scrollbar {
        display: none;
    }

    header .header_by .BJ_lt > ul > li {
        margin-left: 6px;
    }

    header .header_by .BJ_lt > ul > li > a {
        font-size: 12px;
        white-space: nowrap;
    }

    header .header_by .BJ_rt .header_box > * {
        margin-left: 6px;
    }

    header .header_by .BJ_rt .header_box .ipt input {
        width: 110px;
    }
}

@media (max-width: 768px) {
    /* 移动端隐藏顶部提示条，修正 fixed header 占位 */
    body {
        padding-top: 60px !important;
    }

    header .tip {
        display: none;
    }

    header .header_by {
        flex-wrap: wrap;
        padding: 6px 0;
        height: auto !important;
    }

    header .leftside-navbar {
        display: none;
    }

    /* 覆盖基础样式里更高优先级的 display:flex */
    header .header_by .BJ_lt > ul.leftside-navbar {
        display: none !important;
    }

    header .BJ_rt {
        margin-left: auto;
    }

    .article_title {
        font-size: 22px !important;
        line-height: 1.45 !important;
        padding-top: 12px !important;
    }

    .article_time {
        flex-wrap: wrap;
        gap: 6px;
    }

    .rich_text p,
    .Abstract_text {
        font-size: 16px !important;
        line-height: 1.8 !important;
    }

    .calendar_bg {
        padding: 8px 0 !important;
    }

    .events_list {
        flex-wrap: nowrap;
    }

    /* 相关阅读 / 币界百科 / 币界资讯：缩略图与文案在窄屏内自适应 */
    .calendar_bg {
        display: block !important;
    }

    .calendar_bg .calendar_left {
        width: 100% !important;
        min-width: 0 !important;
    }

    .calendar_bg .Other_events,
    .calendar_bg .Other_events .events_content_box,
    .calendar_bg .Other_events .events_list {
        width: 100% !important;
    }

    .calendar_bg .Other_events .events_list {
        height: auto !important;
        min-height: 0;
        margin: 16px 0;
    }

    .calendar_bg .Other_events .btc-ico {
        width: 96px !important;
        height: 68px !important;
        margin-right: 10px !important;
        flex: 0 0 96px;
    }

    .calendar_bg .Other_events .events_text {
        width: auto !important;
        flex: 1 1 0;
        min-width: 0;
    }

    .calendar_bg .Other_events .events_text .events_title .title_a {
        width: auto !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        -webkit-line-clamp: 2;
    }

    .calendar_bg .Other_events .events_conten {
        font-size: 13px;
        line-height: 1.6;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .footer_text {
        font-size: 12px;
        line-height: 1.7;
    }
}

/* 屏幕阅读器专用 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
