/* web/responsive.css —— 全站移动端适配（只在窄屏生效，桌面端完全不受影响）
 * 原则：不改 HTML 结构、不做第二套页面；只覆盖布局，让电脑上原本的样子保持原样。
 */

/* ---------- 平板 / 手机 ---------- */
@media (max-width: 760px) {
    html { -webkit-text-size-adjust: 100%; }
    body { overflow-x: hidden; }

    /* 容器留白收紧 */
    .wrap, .container, .shell, .page { padding-left: 12px; padding-right: 12px; }

    /* 卡片：留白收紧、圆角略降 */
    .card, .doc-block {
        padding: 14px 13px !important;
        border-radius: 13px !important;
        margin-bottom: 12px !important;
    }

    /* 标题缩一档，避免换行太丑 */
    h1 { font-size: 19px !important; line-height: 1.4; }
    h2 { font-size: 15.5px !important; line-height: 1.45; }
    h3, b { line-height: 1.5; }

    /* 表单行：强制单列，任何写了 min-width / width 的内联样式都放开 */
    .row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .row > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }

    /* 输入框：铺满 + 16px 字号（小于 16px 时 iOS 会自动放大页面） */
    input, select, textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
    }
    input[type="checkbox"], input[type="radio"] { width: auto !important; }

    /* 按钮：允许换行，不要挤成一条 */
    button, .btn { max-width: 100%; }
    .actions, .row > button { flex-wrap: wrap; }

    /* 表格：容器内横向滑动，不再把卡片撑破 */
    table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    table th, table td { white-space: nowrap; }

    /* 代码块（对接资料那几段）：横向滑动，字号缩小 */
    pre {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        font-size: 11.5px !important;
        line-height: 1.65 !important;
    }
    pre code { white-space: pre; }

    /* 长地址 / 长哈希不撑破卡片 */
    code, .mono { word-break: break-all; }

    /* 标签页 / 页签：横向滑动，不折成两行 */
    .tabs, .gtabs, .nav, .navbar {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar, .gtabs::-webkit-scrollbar { display: none; }
    .tab, .gtab { flex: 0 0 auto !important; white-space: nowrap; }

    /* 顶部工具条（标题 + 按钮）自动换行 */
    .card > div[style*="display:flex"], .head, .toolbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* KPI 卡片：两列 */
    .kpis, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

    /* 下注页两侧池子：上下排，数字不再挤 */
    .pool, .pools { width: 100% !important; }
    .odds { font-size: 11px !important; }

    /* 浮层 / 弹窗自适应 */
    .modal, .dialog, .sheet { width: 92vw !important; max-width: 92vw !important; }

    /* 对接文档里的长 URL 可换行 */
    .doc-block pre { margin: 6px 0 0 !important; }
}

/* ---------- 小屏手机 ---------- */
@media (max-width: 420px) {
    .kpis, .kpi-grid { grid-template-columns: 1fr !important; }
    h1 { font-size: 17.5px !important; }
    h2 { font-size: 15px !important; }
    .card, .doc-block { padding: 12px 11px !important; }
    table { font-size: 11.5px !important; }
}

/* ---------- 头部：身份条 / 返回链接不再压住标题 ---------- */
@media (max-width: 760px) {
    body { padding: 14px 10px 32px !important; }

    .hero {
        padding: 16px 14px !important;
        border-radius: 14px !important;
        margin-bottom: 12px !important;
    }
    .hero h1 { font-size: 18px !important; line-height: 1.45; margin-bottom: 6px !important; }
    .hero .desc { font-size: 12.5px !important; line-height: 1.75 !important; }
    .pills { margin-top: 10px !important; gap: 6px !important; }

    /* 右上角的「身份 + 退出」：改成正常流，排在标题上方 */
    .hero-top,
    .hero > div[style*="position:absolute"] {
        position: static !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        margin: 0 0 10px 0 !important;
        padding: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .hero-top .pill,
    .hero > div[style*="position:absolute"] .pill {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }
    .hero-top button,
    .hero > div[style*="position:absolute"] button {
        padding: 5px 12px !important;
        font-size: 11.5px !important;
    }

    /* 其它页面里 hero 右上角的「返回」链接，同样回到流内 */
    .hero .back {
        position: static !important;
        display: inline-block !important;
        margin: 0 0 8px 0 !important;
        font-size: 11.5px !important;
    }
}

