/* water-lily QR 导航 模块（leng-qrcode-nav.css）
 *
 * 2026-09-18 第五次改：flex 强制垂直堆叠 + 中间页 CSS 整合
 *   - 改：用 display: flex + flex-direction: column + align-items: center
 *         强制 QR + "扫码导航" 4 字垂直堆叠且水平居中（不依赖任何子元素 display:block）
 *   - 改：中间分支页 .lqr-* 全部迁到这里（不再内联 style，避免 LENG 反馈"页面也要简洁"难调）
 *   - 删：中间页副标题 / 坐标行 / 底部提示文字（PHP 同步去掉 echo）
 *   - 改：按钮顺序 amap / baidu / qqmap，文字去 emoji（PHP 同步）
 *
 * 加载条件：仅 .single（详情页）由 functions.php enqueue (priority 36)
 * 注入位置：地图双图下方（the_content priority 5 filter）
 */

/* ═══════════════════════════════════════════════════════════════════════════
   详情页 QR 容器（紧凑右对齐到双图下方）
   ═══════════════════════════════════════════════════════════════════════════ */
.leng-qr-nav {
    margin: 4px 0 8px auto;     /* 上 4 + 下 8：紧凑（之前 14/22 偏大）*/
    padding: 0;
    background: transparent;
    border: none;
    width: 80px;
    box-sizing: content-box;
    display: flex;              /* 强制所有子元素垂直堆叠 + 水平居中（不论子元素默认 display） */
    flex-direction: column;
    align-items: center;        /* 水平居中（QR 图 + "扫码导航" 4 字都对齐中心） */
    line-height: 1.2;          /* flex 容器统一 line-height，防短句带 \n 造成大间距 */
}

.leng-qr-nav-link {
    display: block;
    text-decoration: none;
    line-height: 0;             /* line-height: 0 抹掉 QR 容器底部隐式 inline 间隙 */
    -webkit-tap-highlight-color: transparent;
}

.leng-qr-nav-img {
    display: block;
    margin: 0;                  /* flex 父已自动居中，子元素无需 auto */
    padding: 3px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    width: 80px;
    height: 80px;
    box-sizing: border-box;
}

.leng-qr-nav .leng-qr-nav-title {  /* 提高 specificity (0,2,0) 抗主题覆盖 */
    display: block;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    font-size: 9px !important;
    font-weight: 300 !important;   /* light, 防 Win 字体在 400 weight 下渲染偏粗 */
    color: #999 !important;        /* 强制灰色，防主题 .entry-content 通用 span 棕色覆盖 */
    line-height: 1 !important;
    letter-spacing: 0.2px;
    text-align: center !important;
    font-style: normal !important;
    text-decoration: none !important;
    -webkit-font-smoothing: antialiased;
}

/* ─── 历史兜底（已废弃：原本用于"微信扫一扫..."提示） ─── */
.leng-qr-nav-tip {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   中间分支页（扫码跳转目标）
   - PHP 端 template_redirect 拦截 ?leng_nav=POST_ID 后 echo HTML
   - 这里集中维护所有 .lqr-* 样式
   - 2026-09-18 简化：去掉副标题"选择导航 App 前往"+ 坐标行 + 底部提示文字
   - 2026-09-18 按钮顺序：高德 / 百度 / 腾讯
   ═══════════════════════════════════════════════════════════════════════════ */
body.lqr-body {
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Microsoft Yahei", sans-serif;
    background: #f5f5f7;
    margin: 0;
    padding: 20px;
    color: #222;
}

.lqr-container {
    max-width: 360px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lqr-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin: 0 0 18px;
    padding: 0;
    text-align: center;
    /* word-break: keep-all 防长标题换行不正常 */
    word-break: keep-all;
}

.lqr-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.lqr-btn:active { transform: scale(0.98); }
.lqr-btn-amap   { background: #00b3a4; }    /* 高德 - 绿 */
.lqr-btn-baidu  { background: #2e7df0; }    /* 百度 - 蓝 */
.lqr-btn-qqmap  { background: #ff6600; }    /* 腾讯 - 橙 */
.lqr-btn-apple  { background: #007aff; }    /* Apple Maps - Apple 系统蓝 */
.lqr-btn-apple  {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.lqr-btn-main   { font-size: inherit; font-weight: inherit; }
.lqr-btn-sub    { font-size: 10px; font-weight: 300; opacity: 0.85; line-height: 1.2; }
.lqr-btn-disabled {
    background: #b0b0b0;
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}
.lqr-btn-back {
    background: #f0f0f3;
    color: #666;
    font-weight: normal;
    margin-top: 8px;
}

/* 中间页底部站名 + 域名（小号 / 居中 / 浅灰，不抢戏）*/
.lqr-footer {
    margin-top: 14px;
    padding: 0;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    text-align: center;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* Apple Maps 偏移提示已嵌入按钮内（.lqr-btn-sub），独立 .lqr-warning 已删 */

/* ─── 窄屏 ─── */
@media (max-width: 480px) {
    .leng-qr-nav {
        margin: 4px 0 8px auto;
    }
    .leng-qr-nav-img {
        width: 72px;          /* 窄屏缩 8px */
        height: 72px;
    }
    .leng-qr-nav {
        width: 72px;
    }
    .lqr-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    .lqr-container {
        padding: 20px 16px;
    }
}

/* ─── 暗色模式（详情页 + 中间页均生效）─── */
@media (prefers-color-scheme: dark) {
    .leng-qr-nav-img {
        background: #fff;
        border-color: #4a4a4a;
    }
    .leng-qr-nav-title { color: #aaa; }

    body.lqr-body {
        background: #1a1a1a;
        color: #eee;
    }
    .lqr-container {
        background: #2a2a2a;
    }
    .lqr-title {
        color: #f1f1f1;
    }
    .lqr-btn-back {
        background: #3a3a3a;
        color: #aaa;
    }
    .lqr-footer {
        color: #888;       /* 暗色模式浅灰 */
    }
}
