/* =========================================================
   前台移动端样式（完全独立）
   仅在 <= 768px 生效；桌面端样式见 front-desktop.css
   ========================================================= */
@media (max-width: 768px) {

    /* ---------- 基础 ---------- */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }
    html {
        -webkit-text-size-adjust: 100%;
    }
    body {
        font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
        font-size: 16px;
        line-height: 1.7;
        background: #f5f7fa;
        color: #1f2937;
    }
    body.drawer-open {
        overflow: hidden;
    }
    a {
        color: #2563eb;
        text-decoration: none;
    }
    img {
        max-width: 100%;
    }
    button {
        font-family: inherit;
    }
    /* 隐藏桌面端专用元素 */
    .desktop-only {
        display: none !important;
    }

    /* ---------- 顶栏 ---------- */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
        border-bottom: 1px solid #eef0f3;
    }
    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 52px;
        padding: 0 8px;
        padding-top: env(safe-area-inset-top);
    }
    .header-left {
        display: flex;
        align-items: center;
        gap: 2px;
        min-width: 0;
        flex: 1;
    }
    .menu-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: none;
        background: none;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #374151;
        cursor: pointer;
    }
    .menu-btn:active {
        background: #f0f2f5;
    }
    .logo {
        font-size: 17px;
        font-weight: 700;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* 手机版左上角：官网首页 / 文档首页 两个框（替代 logo） */
    .logo { display: none; }
    .header-brand-links {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }
    .brand-box {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 5px 11px;
        font-size: 13px;
        font-weight: 600;
        color: #4b5563;
        background: #fff;
        border: 1px solid #e2e5ea;
        border-radius: 999px;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
        white-space: nowrap;
        transition: transform .12s ease, background-color .12s ease;
    }
    .brand-box svg {
        flex-shrink: 0;
    }
    .brand-box:active {
        transform: scale(.94);
        background: #f3f4f6;
    }
    /* 手机版隐藏文章修改按钮 */
    .quick-edit-btn { display: none !important; }
    .header-right {
        display: flex;
        align-items: center;
        gap: 2px;
    }
    /* 桌面端搜索框在移动端隐藏，用搜索图标代替 */
    .header-search {
        display: none;
    }
    .search-icon-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #374151;
        border-radius: 10px;
    }
    .search-icon-btn:active {
        background: #f0f2f5;
    }
    .admin-link {
        display: none;
    }

    /* ---------- 页面骨架：单列 ---------- */
    .page {
        display: block;
    }
    .content {
        padding: 12px 12px 28px;
    }
    /* 有底部导航时留出空间 */
    .has-tabbar .content {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }
    .page-wide .sidebar {
        display: none;
    }

    /* ---------- 侧边抽屉 ---------- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 210;
        width: min(84vw, 340px);
        background: #fff;
        display: flex;
        flex-direction: column;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
    }
    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        box-shadow: 8px 0 32px rgba(16, 24, 40, 0.18);
    }
    .drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px;
        border-bottom: 1px solid #f0f1f4;
        flex-shrink: 0;
    }
    .drawer-title {
        font-size: 16px;
        font-weight: 600;
        color: #111827;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .drawer-close {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        border: none;
        background: none;
        color: #6b7280;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        cursor: pointer;
    }
    .drawer-close:active {
        background: #f0f2f5;
    }
    .sidebar-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    .drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 200;
        background: rgba(17, 24, 39, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s, visibility 0.25s;
    }
    .drawer-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* ---------- 侧栏卡片 ---------- */
    .sidebar-card {
        background: #f8fafc;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
    }
    .sidebar-title {
        font-size: 14px;
        font-weight: 600;
        color: #94a3b8;
        margin-bottom: 8px;
        letter-spacing: 0.02em;
    }
    .sidebar-switch a {
        display: flex;
        align-items: center;
        min-height: 42px;
        padding: 8px 10px;
        background: #eef2f7;
        border-radius: 10px;
        font-size: 16px;
        color: #475569;
    }
    .sidebar-switch a:active {
        background: #e2e8f0;
    }
    .pdf-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        min-height: 44px;
        margin-top: 10px;
        background: #2563eb;
        color: #fff;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
    }
    .pdf-btn:active {
        background: #1d4ed8;
    }

    /* ---------- 分类列表（默认侧栏） ---------- */
    .category-list {
        list-style: none;
    }
    .category-item a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 42px;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 16px;
        color: #374151;
    }
    .category-item a:active,
    .category-item a.active {
        background: #eff6ff;
        color: #1d4ed8;
        font-weight: 600;
    }
    .category-item .count {
        font-size: 13px;
        color: #b0b7c3;
    }
    .category-children {
        list-style: none;
    }
    .level-1 a { padding-left: 24px; }
    .level-2 a { padding-left: 38px; }

    /* ---------- 目录树 ---------- */
    .toc-tree {
        list-style: none;
    }
    .toc-cat-title {
        display: flex;
        align-items: center;
        min-height: 42px;
        padding: 6px 8px;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
    }
    .toc-cat-title:active {
        background: #eef2f7;
    }
    .toc-cat-title.collapsed {
        color: #6b7280;
    }
    .toc-cat-title .arrow {
        flex-shrink: 0;
        margin-right: 6px;
        font-size: 10px;
        color: #9ca3af;
        transition: transform 0.2s;
    }
    .toc-cat-title.collapsed .arrow {
        transform: rotate(-90deg);
    }
    .toc-cat-title .count {
        margin-left: auto;
        padding-left: 8px;
        font-size: 13px;
        color: #b0b7c3;
        font-weight: 400;
    }
    .toc-cat-children {
        list-style: none;
        margin-left: 12px;
        border-left: 2px solid #eef0f4;
        padding-left: 6px;
    }
    .toc-art a {
        display: block;
        min-height: 40px;
        padding: 8px;
        border-radius: 8px;
        font-size: 16px;
        line-height: 1.45;
        color: #4b5563;
    }
    .toc-art a:active {
        background: #eef2f7;
    }
    .toc-art a.active {
        background: #eff6ff;
        color: #1d4ed8;
        font-weight: 600;
    }
    .toc-l2 > .toc-cat-title { padding-left: 20px; font-size: 15px; font-weight: 500; }
    .toc-l3 > .toc-cat-title { padding-left: 32px; font-size: 15px; font-weight: 500; }
    .toc-l2 > .toc-cat-children .toc-art a { padding-left: 22px; margin-left: 12px; }
    .toc-l3 > .toc-cat-children .toc-art a { padding-left: 30px; margin-left: 20px; }

    /* ---------- 卡片 ---------- */
    .card {
        background: #fff;
        border-radius: 14px;
        padding: 16px;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    }
    .card + .card {
        margin-top: 12px;
    }
    .card-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 18px;
        font-weight: 700;
        color: #111827;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f1f4;
    }
    .card-title a {
        font-size: 15px;
        font-weight: 500;
        color: #2563eb;
    }

    /* ---------- 面包屑：单行横向滚动 ---------- */
    .breadcrumb {
        display: flex;
        align-items: center;
        font-size: 15px;
        color: #9ca3af;
        margin-bottom: 12px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }
    .breadcrumb::-webkit-scrollbar {
        display: none;
    }
    .breadcrumb a {
        color: #6b7280;
        flex-shrink: 0;
    }
    .breadcrumb span {
        margin: 0 6px;
        color: #c3c9d4;
        flex-shrink: 0;
    }

    /* ---------- 文章详情 ---------- */
    .article-detail h1 {
        font-size: 26px;
        line-height: 1.45;
        margin: 2px 0 10px;
        color: #111827;
    }
    .article-detail .meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        font-size: 14px;
        color: #9ca3af;
        padding-bottom: 14px;
        margin-bottom: 16px;
        border-bottom: 1px solid #f0f1f4;
    }
    .article-detail .meta .badge-top {
        align-self: center;
    }

    /* ---------- 正文排版 ---------- */
    /* 正文阅读使用自定义宋体（思源宋体），标题与表格使用黑体 */
    .article-content {
        font-family: "Noto Serif SC", "Songti SC", "STSong", SimSun, serif;
        font-size: 18px;
        line-height: 2;
        color: #24292f;
        overflow-wrap: anywhere;
    }
    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4,
    .article-content h5,
    .article-content h6 {
        font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
        color: #111827;
        line-height: 1.5;
    }
    .article-content h1 { font-size: 24px; margin: 26px 0 12px; }
    .article-content h2 {
        font-size: 21px;
        margin: 26px 0 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eef0f3;
    }
    .article-content h3 { font-size: 19px; margin: 22px 0 10px; }
    .article-content h4 { font-size: 18px; margin: 18px 0 8px; }
    .article-content h5 { font-size: 17px; margin: 16px 0 8px; }
    .article-content h6 { font-size: 16px; margin: 14px 0 8px; }
    .article-content p {
        margin: 12px 0;
    }
    .article-content ul,
    .article-content ol {
        margin: 12px 0;
        padding-left: 22px;
    }
    .article-content li {
        margin: 7px 0;
    }
    .article-content code {
        background: #f2f4f7;
        padding: 2px 6px;
        border-radius: 5px;
        font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace;
        font-size: 0.88em;
        color: #d6336c;
    }
    .article-content pre {
        background: #1e293b;
        color: #e2e8f0;
        padding: 14px;
        border-radius: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 16px 0;
        line-height: 1.75;
    }
    .article-content pre code {
        background: none;
        padding: 0;
        color: inherit;
        font-size: 14px;
    }
    .article-content blockquote {
        border-left: 3px solid #2563eb;
        background: #f6f9ff;
        padding: 10px 12px;
        margin: 14px 0;
        border-radius: 0 8px 8px 0;
        color: #5b6472;
    }
    .article-content blockquote p {
        margin: 4px 0;
    }
    .article-content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
        margin: 16px 0;
        font-size: 15px;
    }
    .article-content th,
    .article-content td {
        font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
        border: 1px solid #e8ecf1;
        padding: 8px 10px;
        text-align: left;
    }
    .article-content th {
        background: #f8fafc;
        font-weight: 600;
        white-space: nowrap;
    }
    .article-content img {
        display: block;
        max-width: 100% !important;
        height: auto !important;
        margin: 18px auto;
        border-radius: 8px;
        cursor: zoom-in;
    }
    .article-content a {
        color: #2563eb;
    }
    .article-content hr {
        border: none;
        border-top: 1px solid #eef0f3;
        margin: 20px 0;
    }

    /* ---------- 上一篇 / 下一篇 ---------- */
    .pn-nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 28px;
        padding-top: 18px;
        border-top: 1px solid #f0f1f4;
    }
    .pn-item {
        display: block;
        border: 1px solid #eef1f5;
        background: #fafbfd;
        border-radius: 12px;
        padding: 12px 14px;
    }
    .pn-item:active {
        background: #f0f5ff;
        border-color: #dbe7ff;
    }
    .pn-label {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 14px;
        color: #9ca3af;
        margin-bottom: 4px;
    }
    .pn-title {
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
        line-height: 1.45;
    }
    .pn-item.next .pn-label {
        justify-content: flex-end;
    }
    .pn-item.next .pn-title {
        text-align: right;
    }

    /* ---------- 文档列表（文章行） ---------- */
    .article-list {
        list-style: none;
    }
    .article-item {
        padding: 13px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    .article-item:last-child {
        border-bottom: none;
        padding-bottom: 4px;
    }
    .article-title {
        font-size: 16px;
        font-weight: 500;
        line-height: 1.5;
        margin-bottom: 4px;
    }
    .article-title a {
        color: #1f2937;
    }
    .article-title .badge-top {
        margin-right: 6px;
        vertical-align: 1px;
    }
    .article-summary {
        font-size: 15px;
        color: #6b7280;
        line-height: 1.6;
        margin-top: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .article-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        font-size: 14px;
        color: #9ca3af;
        margin-top: 6px;
    }
    .article-meta .article-book {
        background: #f3f4f6;
        padding: 1px 8px;
        border-radius: 5px;
        font-size: 13px;
        color: #6b7280;
    }

    /* ---------- 文档中心首页 ---------- */
    .books-container {
        padding: 4px 0 8px;
    }
    .books-header {
        margin-bottom: 16px;
        text-align: center;
    }
    .books-header h1 {
        font-size: 28px;
        color: #111827;
        margin-bottom: 4px;
    }
    /* 手机版首页标题：产品选择 */
    .books-header h1 .title-t { display: none; }
    .books-header h1 .title-m { display: inline; }
    .books-header p {
        font-size: 16px;
        color: #6b7280;
    }
    .back-link {
        display: inline-block;
        font-size: 14px;
        color: #6b7280;
        margin-bottom: 12px;
    }
    .group-page-head {
        text-align: center;
        margin-bottom: 20px;
    }
    .groups-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .group-card {
        display: flex;
        align-items: center;
        gap: 14px;
        background: #fff;
        border: 1px solid #eef1f5;
        border-radius: 14px;
        padding: 16px;
        color: inherit;
    }
    .group-icon {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
        border-radius: 12px;
        background: linear-gradient(135deg, #3b82f6, #6366f1);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .group-icon span {
        font-size: 26px;
        color: rgba(255, 255, 255, 0.92);
    }
    .group-card:nth-child(2n) .group-icon { background: linear-gradient(135deg, #10b981, #059669); }
    .group-card:nth-child(3n) .group-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
    .group-card:nth-child(4n) .group-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
    .group-info {
        flex: 1;
        min-width: 0;
    }
    .group-info h3 {
        font-size: 19px;
        color: #111827;
        margin-bottom: 4px;
    }
    .group-info p {
        font-size: 13px;
        color: #6b7280;
        line-height: 1.6;
        margin-bottom: 6px;
    }
    .group-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        color: #9ca3af;
    }
    .books-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .book-card {
        display: flex;
        background: #fff;
        border: 1px solid #eef1f5;
        border-radius: 14px;
        overflow: hidden;
        color: inherit;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    }
    .book-card:active {
        background: #f8fafc;
    }
    .book-cover {
        width: 104px;
        min-height: 118px;
        flex-shrink: 0;
        background: linear-gradient(135deg, #3b82f6, #6366f1);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    .book-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .book-cover-placeholder span {
        font-size: 40px;
        color: rgba(255, 255, 255, 0.92);
    }
    .book-card:nth-child(2n) .book-cover-placeholder { background: linear-gradient(135deg, #10b981, #059669); }
    .book-card:nth-child(3n) .book-cover-placeholder { background: linear-gradient(135deg, #f59e0b, #d97706); }
    .book-card:nth-child(4n) .book-cover-placeholder { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
    .book-info {
        flex: 1;
        min-width: 0;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
    }
    .book-info h3 {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        font-size: 18px;
        color: #111827;
        margin-bottom: 4px;
    }
    /* 手机版书籍卡片只保留主标题（书名），隐藏描述副标题 */
    .book-card .book-info p { display: none; }
    .book-version {
        background: #eff6ff;
        color: #2563eb;
        font-size: 13px;
        font-weight: 500;
        padding: 1px 6px;
        border-radius: 5px;
    }
    .book-info p {
        font-size: 15px;
        color: #6b7280;
        line-height: 1.55;
        margin: 2px 0 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .book-meta {
        margin-top: auto;
        display: flex;
        align-items: center;
        gap: 10px;
        padding-top: 8px;
        border-top: 1px solid #f3f4f6;
        font-size: 14px;
        color: #9ca3af;
    }
    .book-pdf {
        display: flex;
        align-items: center;
        gap: 3px;
        color: #059669;
        font-size: 14px;
    }
    .book-enter {
        margin-left: auto;
        color: #2563eb;
        font-size: 14px;
        font-weight: 600;
        flex-shrink: 0;
    }

    /* ---------- 搜索页 ---------- */
    .search-form {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
    }
    .search-input {
        flex: 1;
        min-width: 0;
        height: 42px;
        padding: 0 14px;
        border: 1px solid #dde1e7;
        border-radius: 10px;
        font-size: 16px; /* >=16px 避免 iOS 聚焦缩放 */
        background: #f8fafc;
        color: #1f2937;
        outline: none;
    }
    .search-input:focus {
        border-color: #2563eb;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }
    .search-btn {
        height: 42px;
        padding: 0 18px;
        border: none;
        border-radius: 10px;
        background: #2563eb;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        flex-shrink: 0;
    }
    .search-btn:active {
        background: #1d4ed8;
    }
    /* 分组页：搜索框+按钮一行，「按文档筛选」独立成第二行 */
    .search-filter {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        height: 42px;
        padding: 0 12px;
        color: #374151;
        background-color: #fff;
        border-color: #dde1e7;
    }
    .group-search-form {
        margin-bottom: 20px;
    }
    .search-summary {
        font-size: 15px;
        color: #6b7280;
        margin-bottom: 12px;
    }
    .search-summary strong {
        color: #2563eb;
    }
    .empty-tip {
        text-align: center;
        color: #9ca3af;
        font-size: 15px;
        padding: 36px 0;
    }

    /* ---------- 徽标 ---------- */
    .badge {
        display: inline-block;
        padding: 2px 8px;
        font-size: 13px;
        font-weight: 500;
        border-radius: 5px;
        background: #eff6ff;
        color: #2563eb;
    }
    .badge-top {
        background: #fef2f2;
        color: #dc2626;
    }

    /* ---------- 分页 ---------- */
    .pagination {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 20px;
    }
    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
        border: 1px solid #e2e6eb;
        border-radius: 10px;
        background: #fff;
        font-size: 14px;
        color: #4b5563;
    }
    .pagination .active {
        background: #2563eb;
        border-color: #2563eb;
        color: #fff;
        font-weight: 600;
    }
    .pagination .disabled {
        opacity: 0.45;
    }

    /* ---------- 底部导航栏 ---------- */
    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        display: flex;
        background: rgba(255, 255, 255, 0.96);
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        backdrop-filter: saturate(180%) blur(16px);
        border-top: 1px solid #eef0f3;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .tab-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        height: 56px;
        font-size: 13px;
        color: #6b7280;
        background: none;
        border: none;
        cursor: pointer;
    }
    .tab-item svg {
        width: 22px;
        height: 22px;
    }
    .tab-item.active,
    .tab-item:active {
        color: #2563eb;
    }

    /* ---------- 返回顶部 ---------- */
    .back-top {
        position: fixed;
        right: 14px;
        bottom: calc(74px + env(safe-area-inset-bottom));
        z-index: 140;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: #fff;
        border: 1px solid #e5e9ef;
        box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
        color: #4b5563;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    }
    .back-top.show {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    /* ---------- 页脚 ---------- */
    .footer {
        text-align: center;
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
        color: #9ca3af;
        font-size: 14px;
    }
    .has-tabbar .footer {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }
    .footer-links {
        margin-top: 6px;
    }
    .footer-links a {
        color: #6b7280;
        margin: 0 8px;
    }

    /* ---------- 空状态 ---------- */
    .empty-state {
        text-align: center;
        padding: 70px 20px;
        color: #9ca3af;
        font-size: 15px;
    }

    /* ---------- 图片灯箱（点击正文图片放大） ---------- */
    .img-lightbox {
        position: fixed;
        inset: 0;
        z-index: 300;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 24px;
        background: rgba(15, 23, 42, 0.9);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }
    .img-lightbox.show {
        opacity: 1;
        visibility: visible;
        /* 手势交给 JS 处理：双指捏合只缩放图片，页面固定不缩放不滚动 */
        touch-action: none;
    }
    .img-lightbox img {
        display: block;
        max-width: 94vw;
        max-height: 84vh;
        width: auto;
        height: auto;
        border-radius: 6px;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
        cursor: zoom-out;
        will-change: transform;
    }
    .img-lightbox .img-lightbox-caption {
        max-width: 90vw;
        color: #cbd5e1;
        font-size: 14px;
        line-height: 1.5;
        text-align: center;
    }
    .img-lightbox .img-lightbox-caption:empty {
        display: none;
    }

}

/* ===== 阶段五：搜索高亮 / 反馈底栏 / 代码复制（页内 TOC 移动端不显示） ===== */
.article-summary mark {
    background: #fff1a8;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}
.page-toc {
    display: none !important;
}
.code-wrap {
    position: relative;
    margin: 14px 0;
}
.code-wrap pre {
    margin: 0;
}
.code-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    opacity: 1;
}
.feedback-bar {
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
}
.feedback-question {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}
.feedback-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.feedback-btn {
    padding: 8px 16px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
}
.feedback-btn:disabled {
    opacity: .6;
    cursor: default;
}
.feedback-comment {
    margin-top: 12px;
}
.feedback-comment textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.feedback-submit {
    padding: 6px 18px;
    font-size: 13px;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.feedback-submit:disabled {
    opacity: .6;
    cursor: default;
}
.feedback-counts {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}
.feedback-msg {
    margin-top: 6px;
    font-size: 12px;
}
.feedback-msg.ok {
    color: #16a34a;
}
.feedback-msg.err {
    color: #dc2626;
}

/* ---------- 标题锚点深链（A1） ---------- */
.article-content h2,
.article-content h3,
.article-content h4 {
    scroll-margin-top: 70px;
}
.anchor-link {
    display: inline-block;
    margin-left: 6px;
    color: #94a3b8;
    font-size: 0.72em;
    text-decoration: none;
    opacity: 0.55; /* 移动端无 hover，常显弱化 */
    vertical-align: middle;
}
.anchor-link:hover,
.anchor-link:active {
    color: #2563eb;
    opacity: 1;
}
.anchor-tip {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%) translateY(8px);
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 16px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 400;
    max-width: 80vw;
    word-break: break-all;
}
.anchor-tip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
    /* ---------- 手机版联系客服（独立设计） ---------- */
    .m-contact {
        margin-top: 24px;
        border-radius: 20px;
        overflow: hidden;
        background: #fff;
        border: 1px solid #eef0f4;
        box-shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
    }
    .m-contact-head {
        padding: 20px 16px;
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        text-align: center;
    }
    .m-contact-head h2 { margin: 0 0 4px; font-size: 19px; color: #fff; letter-spacing: 1px; }
    .m-contact-head p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
    .m-contact-body {
        padding: 16px 14px 18px;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .m-wx-card,
    .m-tel-card {
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        border: 1px solid #eef0f4;
        box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
    }
    /* 彩色头带：微信绿 / 电话蓝 */
    .m-card-band {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 12px;
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        letter-spacing: 1px;
    }
    .m-card-band svg { flex-shrink: 0; }
    .m-band-wx { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
    .m-band-tel { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
    .m-card-inner { padding: 20px 16px 20px; text-align: center; }
    .m-wx-card img {
        width: 170px;
        height: 170px;
        border-radius: 14px;
        background: #fff;
        padding: 8px;
        border: 1px solid #e2e5ea;
        box-shadow: 0 2px 8px rgba(22, 101, 52, 0.10);
    }
    .m-wx-card .m-card-inner p,
    .m-tel-card .m-card-inner p { margin: 0; font-size: 13px; color: #4b5563; }
    .m-wx-card img + p { margin-top: 12px !important; }
    .m-tel-num {
        display: block;
        font-size: 27px;
        font-weight: 700;
        color: #111827;
        letter-spacing: 2px;
        text-decoration: none;
        margin-bottom: 4px;
    }
    .m-tel-time { font-size: 12px; color: #6b7280; margin: 0 0 14px !important; }
    .m-tel-btn {
        display: block;
        padding: 13px;
        border-radius: 12px;
        background: linear-gradient(135deg, #16a34a, #15803d);
        color: #fff !important;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(22, 163, 74, 0.30);
    }
    .m-tel-btn:active { background: #166534; }
    /* ---------- 首页：联系客服入口条（内容在 /contact 独立页） ---------- */
    .m-contact-entry {
        margin-top: 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        background: #fff;
        border: 1px solid #eef0f4;
        border-radius: 16px;
        box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
        text-decoration: none;
        transition: transform .12s ease, background-color .12s ease;
    }
    .m-contact-entry:active {
        transform: scale(.98);
        background: #f8fafc;
    }
    .m-entry-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
        color: #fff;
        flex-shrink: 0;
        box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    }
    .m-entry-text {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .m-entry-text strong { font-size: 15px; color: #111827; }
    .m-entry-text small { font-size: 12px; color: #6b7280; }
    .m-entry-arrow { font-size: 22px; color: #9ca3af; line-height: 1; }

    /* 顶部导航「官网首页 / 联系客服」（手机已有左上角胶囊入口，避免重复） */
    .official-link { display: none; }
