/* ==========================================================================
   jb51-btc-guide-standalone 自定义样式
   仅用于：首屏语言切换防闪烁、静态行情卡、响应式与 RTL 适配
   ========================================================================== */

html.i18n-loading body {
    visibility: hidden;
}

html {
    scroll-behavior: smooth;
}

/* 原站头部为 fixed，正文需要让出 60px */
body {
    padding-top: 60px;
}

#article,
#content,
.con_right {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 静态行情快照卡 */
.coin-snapshot {
    display: flex;
    align-items: center;
    gap: 18px 28px;
    flex-wrap: wrap;
    margin: 22px 0;
    padding: 18px 22px;
    border: 1px solid #e3eaf2;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef4f9 100%);
    box-shadow: 0 2px 10px rgba(15, 35, 60, 0.04);
}

.coin-snapshot__head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
}

.coin-snapshot__head img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
}

.coin-snapshot__name {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.coin-snapshot__name strong {
    font-size: 17px;
    color: #1f2d3d;
}

.coin-snapshot__name span {
    font-size: 13px;
    color: #7b8794;
}

.coin-snapshot__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 12px 26px;
    flex: 1 1 420px;
}

.coin-snapshot__grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coin-snapshot__grid span {
    font-size: 12px;
    color: #8a97a6;
}

.coin-snapshot__grid strong {
    font-size: 17px;
    color: #22303f;
    font-weight: 700;
}

.coin-snapshot__grid .coin-snapshot__up {
    color: #16a34a;
}

.coin-snapshot__note {
    flex: 0 0 100%;
    font-size: 12px;
    color: #9aa6b2;
    border-top: 1px dashed #dbe4ee;
    padding-top: 10px;
}

/* 目录锚点留出少量滚动间距 */
.maodian {
    scroll-margin-top: 76px;
}

/* 复制邀请码的轻量反馈 */
code[data-copy] {
    cursor: pointer;
}

code[data-copy].is-copied {
    background: #d9f5e3;
    color: #137a3a;
}

/* 窄屏：头部改为静态，正文单列，避免固定宽度溢出 */
@media (max-width: 1279px) {
    body {
        padding-top: 0;
    }

    #header {
        position: static !important;
        display: block !important;
        height: auto !important;
        width: 100% !important;
    }

    #header .layout {
        display: block !important;
        width: 100% !important;
        max-width: 1200px;
        padding: 10px 14px 0;
        box-sizing: border-box;
    }

    #logo {
        float: none !important;
        width: auto !important;
        max-width: 100% !important;
    }

    #summary,
    #remind {
        width: auto !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    #search {
        display: none;
    }

    #nav {
        float: none !important;
        clear: both;
        width: 100%;
        max-width: 100%;
        position: static !important;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    #nav > li {
        float: none !important;
        display: inline-block;
        vertical-align: top;
    }

    .main {
        display: flow-root;
        width: auto !important;
        max-width: 1200px;
        padding: 0 14px;
        box-sizing: border-box;
    }

    .footer_con {
        width: auto !important;
        max-width: 1200px;
        padding-left: 14px;
        padding-right: 14px;
        box-sizing: border-box;
    }

    .con_left,
    .con_right {
        float: none !important;
        width: 100% !important;
    }

    #article,
    #content,
    #xgcon {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .con_right {
        margin-top: 22px;
    }

    #content img,
    #xgcon img,
    .con_right img {
        max-width: 100%;
        height: auto;
    }

    #content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #content th,
    #content td {
        word-break: break-word;
    }

    #xgcon li {
        display: block !important;
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    #xgcon li > a {
        display: block !important;
        width: 100% !important;
    }

    #xgcon li img {
        float: none !important;
        display: block;
        width: 100% !important;
        max-width: 100%;
        height: auto;
        margin-bottom: 8px;
    }

    #xgcon li h3,
    #xgcon li p,
    #xgcon li span {
        float: none !important;
        width: 100% !important;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    #logo {
        max-width: 100%;
    }

    #title {
        font-size: 22px;
        line-height: 1.4;
    }

    #content {
        font-size: 16px;
        line-height: 1.85;
    }

    .coin-snapshot {
        padding: 14px 16px;
    }

    .coin-snapshot__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 16px;
    }

    .coin-snapshot__grid strong {
        font-size: 15px;
    }

    #nav > li {
        font-size: 14px;
    }
}

/* 阿拉伯语 RTL 基础适配 */
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] #position,
html[dir="rtl"] #article,
html[dir="rtl"] #summary,
html[dir="rtl"] #content,
html[dir="rtl"] .con_right,
html[dir="rtl"] #footer {
    text-align: right;
}

html[dir="rtl"] #content ul,
html[dir="rtl"] #content ol {
    padding-right: 22px;
    padding-left: 0;
}

html[dir="rtl"] .coin-snapshot__grid strong,
html[dir="rtl"] .coinrank .iusd,
html[dir="rtl"] .coinrank .icny {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

html[dir="rtl"] #nav > li > ul {
    left: auto;
    right: 0;
}

html[dir="rtl"] #nav > li {
    float: right;
}

@media (max-width: 1279px) {
    html[dir="rtl"] #nav > li {
        float: none;
    }
}

/* 目标语言字体兜底 */
html[lang="ar"] body {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

html[lang="hi"] body {
    font-family: "Nirmala UI", Mangal, "Segoe UI", Arial, sans-serif;
}
