/* ===============================================================================
   Quectel Sphinx Documentation Theme
   Based on Official Quectel Brand Design System
   基于移远通信官方品牌设计规范
   =============================================================================== */

/* ========================================
   CRITICAL: Override Sphinx Basic Theme
   ======================================== */
/* 这些样式必须在最前面，以确保覆盖 basic.css */

/* 1. 隐藏 basic 主题的所有默认元素 */
div.related,
div.sphinxsidebar,
div.bodywrapper > div.body,
div.footer {
    display: none !important;
}

/* 2. 重置 document wrapper 让它占满整个页面 */
div.documentwrapper {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. 重置 document 容器 */
div.document {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 4. 确保 body 没有默认的 padding/margin */
body {
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   Custom Web Fonts - 自定义字体
   ======================================== */
/* Stratos Regular - 400 weight (lightest available) */
@font-face {
    font-family: 'Stratos';
    src: url('../fonts/stratos-regular.49779b.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Stratos Medium - 500 weight */
@font-face {
    font-family: 'Stratos';
    src: url('../fonts/stratos-medium.5e0918.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   CSS Variables - 品牌设计变量系统
   ======================================== */
:root {
    /* Primary Colors - 主色彩 */
    --color-primary: #0066CC;
    --color-primary-dark: #004C99;
    --color-primary-light: #3385D6;
    --color-primary-lighter: #E6F2FF;
    
    /* Secondary Colors - 辅助色 */
    --color-secondary: #E31E24;
    --color-secondary-dark: #C41A1F;
    
    /* Neutral Colors - 中性色 */
    --color-black: #000000;
    --color-gray-500: #333333;
    --color-gray-400: #666666;
    --color-gray-300: #999999;
    --color-gray-200: #CCCCCC;
    --color-gray-100: #F5F5F5;
    --color-white: #FFFFFF;
    
    /* Functional Colors - 功能色 */
    --color-success: #28A745;
    --color-warning: #FFC107;
    --color-error: #DC3545;
    --color-info: #17A2B8;
    
    /* Typography - 字体 */
    --font-family: 'Stratos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'PingFang SC', 'Microsoft YaHei', '微软雅黑', 'Helvetica Neue', 'Arial', sans-serif;
    --font-size-h1: 32px;  /* 原 48px，减小 */
    --font-size-h2: 28px;  /* 原 36px，减小 */
    --font-size-h3: 24px;  /* 原 28px，减小 */
    --font-size-h4: 20px;  /* 原 24px，减小 */
    --font-size-h5: 17px;  /* 原 20px，减小 */
    --font-size-body: 15px;  /* 原 16px，稍微缩小 */
    --font-size-small: 13px;  /* 原 14px */
    --font-size-xs: 12px;
    
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.65;  /* 原 1.75，更紧凑 */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing - 间距 */
    --spacing-xxs: 1px;  /* 超小间距，用于列表项，进一步缩小 */
    --spacing-xs: 6px;   /* 原 8px，更紧凑 */
    --spacing-sm: 8px;   /* 原 12px，用于段落间距 */
    --spacing-md: 18px;  /* 原 24px，更紧凑 */
    --spacing-lg: 24px;  /* 原 32px，更紧凑 */
    --spacing-xl: 36px;  /* 原 48px，更紧凑 */
    --spacing-xxl: 48px; /* 原 64px，更紧凑 */
    --spacing-xxxl: 72px; /* 原 96px，更紧凑 */
    
    /* Layout - 布局 */
    --container-max-width: 1200px;
    --header-height: 70px;
    --contents-width: 300px;
    --on-this-page-width: 280px; /* 右侧页面内导航宽度 */
    --toc-title-height: 56px; /* TOC标题固定高度，用于保持一致的界面高度 */
    
    /* Border Radius - 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Shadows - 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    /* Transitions - 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   Reset & Base Styles - 重置和基础样式
   ======================================== */

/* 强制隐藏 Sphinx basic 主题的默认元素 */
.sphinxsidebar,
.related,
.relbar1,
.relbar2,
div.bodywrapper,
div.body,
div.documentwrapper {
    display: none !important;
}

/* 确保 document 容器占满整个宽度 */
.document {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 确保 quectel-layout 正确显示 - 三栏布局 */
.quectel-layout {
    display: flex !important;
    flex: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding-top: var(--header-height) !important;
    position: relative !important;
    min-height: calc(100vh - var(--header-height));
}
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    color: var(--color-gray-500);
    background: var(--color-white);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Screen Reader Only - 辅助功能 */
.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;
}

/* Search page form - align Sphinx's default search form with Quectel theme */
.quectel-content #search-documentation ~ form[action=""][method="get"] {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: min(100%, 680px);
    margin: 20px 0 28px;
}

.quectel-content #search-documentation ~ form[action=""][method="get"] input[name="q"] {
    flex: 1 1 320px;
    min-width: 240px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    background: var(--color-white);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.4;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.quectel-content #search-documentation ~ form[action=""][method="get"] input[name="q"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: none;
}

.quectel-content #search-documentation ~ form[action=""][method="get"] input[type="submit"] {
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: var(--font-weight-normal);
    line-height: 1;
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.quectel-content #search-documentation ~ form[action=""][method="get"] input[type="submit"]:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: none;
}

.quectel-content #search-documentation ~ form[action=""][method="get"] input[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: none;
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

.quectel-content #search-documentation ~ form[action=""][method="get"] #search-progress {
    min-height: 22px;
    padding-left: 0 !important;
    color: var(--color-gray-500);
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .quectel-content #search-documentation ~ form[action=""][method="get"] {
        align-items: stretch;
        gap: 10px;
    }

    .quectel-content #search-documentation ~ form[action=""][method="get"] input[name="q"],
    .quectel-content #search-documentation ~ form[action=""][method="get"] input[type="submit"] {
        width: 100%;
    }
}

/* ========================================
   Header - 页眉导航栏
   ======================================== */
.quectel-header {
    height: var(--header-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.quectel-header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1400px; /* Official width-container */
    height: 100%;
    margin: 0 auto;
    padding-left: 1.5rem; /* Official px-6 = 24px */
    padding-right: 1.5rem;
}

@media (min-width: 1024px) {
    .quectel-header-container {
        flex-wrap: nowrap;
    }
}

.quectel-logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0; /* Prevent logo from shrinking */
    order: 1;
}

/* Logo should maintain its aspect ratio and size */

.quectel-logo {
    display: flex;
    align-items: center;
    line-height: 0;
}

.quectel-logo img {
    height: 23px; /* Official Quectel.com logo height */
    width: auto; /* Auto width to maintain aspect ratio */
    display: block;
}

/* Keep same height on all screens to match official site */
@media (min-width: 768px) {
    .quectel-logo img {
        height: 23px;
    }
}

/* Navigation - 导航菜单 */
.quectel-nav {
    display: flex;
    align-items: stretch; /* Changed from center to stretch for full height */
    justify-content: center;
    flex: 1 1 0%; /* Allow nav to grow and center */
    gap: var(--spacing-lg);
    order: 2;
    height: 100%; /* Full height */
}

.quectel-nav-menu {
    display: flex;
    align-items: stretch; /* Changed from center to stretch for full height */
    justify-content: center;
    gap: var(--spacing-lg);
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%; /* Full height */
}

.quectel-nav-link {
    color: #000000; /* Official site uses black color */
    font-family: 'Stratos', sans-serif; /* Official Quectel font */
    font-weight: 400; /* Stratos Regular - lightest available weight */
    text-decoration: none;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    padding: 0 3px; /* Official site padding: 0px 3px */
    font-size: 17px; /* Official site: 17px */
    line-height: 1.4;
    white-space: nowrap;
    height: 100%; /* Full height to reach header bottom */
}

/* Remove responsive font size - official site uses consistent 17px */

.quectel-nav-link:hover {
    color: #000000; /* Stay black on hover, underline shows instead */
}

/* Navigation item with submenu - Mega Menu style */
.quectel-nav-item-has-submenu {
    position: relative;
}

/* Position nav item to full height for bottom alignment */
.quectel-nav-item {
    position: relative;
    height: 100%; /* Full height to reach header bottom */
}

/* Hover underline effect - aligned with header bottom border */
.quectel-nav-link::after {
    content: "";
    position: absolute;
    bottom: -1px; /* Align with header bottom border, covering it */
    left: 0;
    width: 100%;
    height: 0.25rem; /* 4px red underline */
    background-color: #FA0505; /* Quectel red */
    border-radius: 2px 2px 0 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1),
                visibility 0.15s cubic-bezier(0.4, 0, 1, 1);
}

/* Show underline on hover for all nav links */
.quectel-nav-link:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Arrow indicator - CSS triangle */
.quectel-nav-arrow {
    display: inline-block;
    margin-left: 0.25rem;
    vertical-align: middle;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

/* Mega submenu container - Full width panel */
.quectel-nav-submenu {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-height);
    width: 100vw;
    background-color: #E9ECEC;
    border-bottom: 1px solid #D8DBDB;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* 消失时有0.5s延迟，让用户有充足时间移动鼠标 */
    transition: opacity 0.2s cubic-bezier(0.4, 0, 1, 1) 0.5s,
                visibility 0.2s cubic-bezier(0.4, 0, 1, 1) 0.5s;
    z-index: 1001; /* 高于header(1000)和contents(99)，确保下拉菜单在最上层 */
}

/* 创建一个更大的桥接区域，覆盖菜单项到子菜单之间的空间 */
.quectel-nav-submenu::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
}

/* 当悬停在菜单项时显示子菜单 - 立即显示，无延迟 */
.quectel-nav-item-has-submenu:hover .quectel-nav-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    /* 悬停时立即显示，没有延迟 */
    transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1) 0s,
                visibility 0.15s cubic-bezier(0.4, 0, 1, 1) 0s;
}

.quectel-nav-submenu-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center; /* 垂直居中对齐子菜单内容 */
    height: var(--toc-title-height); /* 与左侧目录标题高度保持一致 */
    overflow: hidden; /* 隐藏超出部分 */
}

.quectel-nav-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row; /* 改为横向排列 */
    flex-wrap: wrap; /* 允许换行 */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-height: 100%; /* 限制最大高度 */
}

.quectel-nav-submenu-list li {
    margin: 0;
}

.quectel-nav-submenu-link {
    display: inline-block;
    padding: 0.75rem 1.5rem; /* 增加内边距，让每个子菜单项更高 */
    color: var(--color-gray-500);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.6; /* 增加行高 */
    font-weight: var(--font-weight-normal);
    transition: all 0.15s ease;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    min-height: 44px; /* 设置最小高度，确保每个项目高度一致 */
    display: flex;
    align-items: center; /* 垂直居中文字 */
}

.quectel-nav-submenu-link:hover {
    color: var(--color-secondary);
    background-color: rgba(227, 30, 36, 0.1);
}

/* Mobile submenu styles */
@media (max-width: 768px) {
    .quectel-nav-item-has-submenu {
        position: relative;
    }
    
    .quectel-nav-item-has-submenu .quectel-nav-submenu {
        position: static;
        background-color: transparent;
        border: none;
        padding: 0;
        margin-top: 0.5rem;
        margin-left: 1rem;
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .quectel-nav-item-has-submenu.active .quectel-nav-submenu {
        max-height: 500px;
    }
    
    .quectel-nav-submenu-content {
        padding: 0;
    }
    
    .quectel-nav-submenu-list {
        max-height: none;
        flex-flow: column nowrap;
        border-left: 2px solid var(--color-secondary);
        padding-left: 0.5rem;
    }
    
    .quectel-nav-submenu-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .quectel-nav-item-has-submenu .quectel-nav-link::after {
        content: none;
    }
}

.quectel-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.quectel-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-gray-500);
    transition: var(--transition-normal);
}

/* Right Toolbar - 右侧工具栏 */
.quectel-toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    justify-content: flex-end;
    order: 3;
}

/* Search result keyword highlight */
.quectel-content .highlighted {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0 2px;
    border-radius: 2px;
}

/* Header Search Toggle Button - 官网样式 icon icon__search-black */
.quectel-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-normal);
}

.quectel-search-toggle:hover {
    opacity: 0.7;
}

.quectel-search-toggle svg {
    width: 20px;
    height: 20px;
    stroke: #000000;
    stroke-width: 1.5;
}

/* Language Switcher - 官网样式语言切换 */
.quectel-language-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.quectel-language-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-normal);
}

.quectel-language-toggle:hover {
    opacity: 0.7;
}

.quectel-language-toggle svg {
    width: 23px;
    height: 23px;
    stroke: var(--color-black);
}

/* Language Dropdown - 参考官网 nav__language 样式 */
.quectel-language-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background-color: #E9ECEC; /* 官网语言下拉背景色 */
    border-radius: var(--radius-sm);
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    pointer-events: auto;
}

/* 添加一个伪元素来桥接按钮和下拉菜单之间的间隙 */
.quectel-language-dropdown::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
}

.quectel-language-switcher:hover .quectel-language-dropdown,
.quectel-language-dropdown.active {
    display: flex;
}

.quectel-language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--color-black);
    font-size: 16px;
    font-family: var(--font-family);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.quectel-language-option:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.quectel-language-option:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.quectel-lang-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 18px;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-gray-500);
}

.quectel-language-option:hover .quectel-lang-code {
    background-color: rgba(0, 0, 0, 0.12);
    color: var(--color-black);
}

.quectel-language-option span:last-child {
    font-weight: var(--font-weight-normal);
}

/* Search Dropdown Panel - 官网样式 nav__search__outer */
.quectel-search-dropdown {
    position: fixed;
    width: 100vw;
    top: var(--header-height);
    left: 0;
    z-index: 999;
    background-color: #E9ECEC;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.quectel-search-dropdown.active {
    opacity: 1;
    visibility: visible;
}

.quectel-search-dropdown-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem;
    position: relative;
}

.quectel-search-close-wrapper {
    position: absolute;
    top: 1.875rem;
    right: 1.875rem;
}

.quectel-search-close {
    display: block;
    margin-left: auto;
    cursor: pointer;
    font-size: 1.5rem;
    color: #A6A9A9;
    transition: color var(--transition-normal);
    line-height: 1;
}

.quectel-search-close:hover {
    color: var(--color-text);
}

.quectel-search-form-wrapper {
    margin-top: 0;
}

.quectel-search-form-wrapper form {
    display: flex;
    align-items: center;
    flex-grow: 1;
    font-weight: 400;
    padding: 9px 0;
    background-color: transparent;
    border: 0;
    border-bottom: 2px solid #A6A9A9;
}

.quectel-search-form-wrapper form label {
    width: 100%;
}

.quectel-search-form-wrapper input[type="search"],
.quectel-search-form-wrapper input[type="text"] {
    background-color: transparent;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 2;
    padding: 0;
    width: 100%;
    border: none;
    font-family: var(--font-family);
}

@media (min-width: 768px) {
    .quectel-search-form-wrapper input[type="search"],
    .quectel-search-form-wrapper input[type="text"] {
        font-size: 2.625rem;
        line-height: 1.2;
    }
}

.quectel-search-form-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

.quectel-search-form-wrapper input::placeholder {
    color: #D8DBDB;
    opacity: 1;
}

/* 隐藏浏览器默认的搜索框清空按钮(X) */
.quectel-search-form-wrapper input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.quectel-search-form-wrapper input[type="search"]::-ms-clear {
    display: none;
}

/* Search Submit Button - 放大镜按钮（仅图标，无边框、无背景） */
.quectel-search-submit-btn {
    position: relative;
    margin-left: 1.5rem;
    padding: 0 !important;
    width: 3rem;
    height: 3rem;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none !important;
    transform: none !important;
}

.quectel-search-submit-btn:hover {
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.quectel-search-submit-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: #6B6C6D;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .quectel-search-submit-btn {
        width: 3rem;
        height: 3rem;
        margin-left: 1rem;
    }
    
    .quectel-search-submit-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Screen reader only - 官网样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.quectel-search-form-wrapper input::placeholder {
    color: var(--color-gray-400);
}

/* ========================================
   Layout - 主体布局
   ======================================== */
.quectel-layout {
    display: flex;
    min-height: 100vh;
}

/* Contents - 左侧目录导航 */
.quectel-contents {
    width: var(--contents-width);
    background: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    /* 改回固定定位，不跟随内容滚动 */
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    z-index: 99;
    padding-top: 0;
    margin-top: 0;
    /* 使用 flexbox 布局来分离固定区域和滚动区域 */
    display: flex;
    flex-direction: column;
}

/* 隐藏目录导航搜索框 - 统一使用顶部导航的搜索入口 */
.quectel-search-contents {
    display: none !important;
}

/* 隐藏目录导航滚动容器 - 因为其内容（搜索框等）已被隐藏，不再需要 */
.quectel-contents-scrollable {
    display: none !important;
}

/* Table of Contents - 目录区域 */
.quectel-toc {
    /* 整个目录区域作为flex容器 */
    display: flex;
    flex-direction: column;
    flex: 1; /* 让目录区域占据侧边栏的全部空间，自适应高度 */
    background: var(--color-white);
    min-height: 0; /* 允许flex item收缩 */
    overflow-y: auto; /* 允许目录内容垂直滚动 */
}

/* 目录内容部分 */
.quectel-contents-content {
    padding: var(--spacing-md) var(--spacing-lg);
    flex: 1;
}

.quectel-toc-title {
    /* 目录标题固定在顶部，不滚动 */
    font-size: var(--font-size-h5);
    color: var(--color-gray-500);
    margin: 0;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
    border-bottom: 2px solid var(--color-secondary);
    background: var(--color-white);
    flex-shrink: 0; /* 防止标题被压缩 */
    height: var(--toc-title-height); /* 明确设置固定高度 */
    box-sizing: border-box; /* 确保padding包含在高度内 */
    display: flex;
    align-items: center; /* 垂直居中文字 */
    position: relative; /* 确保在顶部 */
    z-index: 10; /* 确保在滚动内容之上 */
}

/* 折叠按钮容器 - 独立显示在最左侧 */
.contents-toggle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    z-index: 100;
}

/* 左侧导航折叠按钮（类似右侧导航的样式） */
.contents-toggle {
    /* Layout */
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;

    /* Visual */
    border: 1px solid var(--color-gray-200);
    border-radius: 10px;
    background: rgba(0, 102, 204, 0.08); /* brand tint */
    color: var(--color-primary); /* SVG uses currentColor */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);

    /* Interaction */
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.contents-toggle svg,
.contents-toggle img {
    width: 20px;
    height: 20px;
    display: block;
    transition: transform var(--transition-fast);
}

.contents-toggle:hover {
    background: rgba(0, 102, 204, 0.14);
    border-color: rgba(0, 102, 204, 0.35);
    color: var(--color-primary-dark);
}

.contents-toggle:active {
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.contents-toggle:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(0, 102, 204, 0.22),
        0 1px 2px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 102, 204, 0.55);
}

/* 左侧导航收缩状态 */
.quectel-contents.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none;
    overflow: hidden;
}

/* 折叠时隐藏所有导航内容 */
.quectel-contents.collapsed .quectel-toc,
.quectel-contents.collapsed .quectel-contents-scrollable {
    display: none;
    opacity: 0;
    visibility: hidden;
}

/* 当左侧导航收缩时，调整主内容区域 */
body.contents-collapsed .quectel-main {
    margin-left: 0 !important; /* 不再为左侧导航预留空间 */
}

body.contents-collapsed .quectel-content-header {
    left: 0 !important; /* 标题栏左边距为0 */
    padding-left: calc(var(--spacing-xl) + 32px + var(--spacing-md)); /* 仍然为按钮留出空间 */
}

body.contents-collapsed .quectel-contents-resize-handle {
    display: none !important; /* 隐藏调整宽度的拖动条 */
}

/* Caption样式 - 作为一级标题显示在左侧导航 */
.quectel-toc p.caption {
    margin: 0 0 var(--spacing-sm) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    margin: var(--spacing-sm) var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
}

.quectel-toc p.caption .caption-text {
    color: var(--color-white);
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-semibold);
    display: block;
    text-align: center;
    letter-spacing: 0.5px;
    /* 支持文字换行显示 */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

/* 目录内容区域 - 在滚动容器内 */
.quectel-toc > ul {
    /* 目录树形内容在滚动容器内 */
    margin: 0;
    padding: var(--spacing-sm) 0 var(--spacing-md); /* 上下padding保留，左右由链接控制 */
    list-style: none;
}

/* 左侧目录区域滚动条样式 */
.quectel-toc::-webkit-scrollbar {
    width: 6px;
}

.quectel-toc::-webkit-scrollbar-track {
    background: var(--color-white);
    border-radius: 3px;
}

.quectel-toc::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
    transition: background var(--transition-fast);
}

.quectel-toc::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* TOC toggle arrow - 目录切换箭头 (SVG版本) */
.toc-toggle {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin-right: 0.25rem !important; /* 减小间距从0.5rem到0.25rem (4px) */
    margin-left: -20px !important; /* 调整负margin: 箭头16px + 间距4px = 20px */
    vertical-align: middle !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
    cursor: pointer !important;
    color: var(--color-gray-600) !important;
}

/* TOC spacer - 目录占位符（叶子节点对齐用） */
.toc-spacer {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin-right: 0.25rem !important; /* 减小间距从0.5rem到0.25rem (4px) */
    margin-left: -20px !important; /* 调整负margin: 箭头16px + 间距4px = 20px */
    vertical-align: middle !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
}

/* 悬停时箭头变颜色 */
.quectel-toc a:hover .toc-toggle {
    color: var(--color-secondary) !important;
}

/* 嵌套列表样式 */
.quectel-toc ul ul {
    margin-left: 12px; /* 进一步减少嵌套缩进，从 16px 减少到 12px */
    padding: 0;
    list-style: none;
    transition: all var(--transition-fast);
}

/* 收起状态的子列表 */
.quectel-toc li:not(.expanded) > ul {
    display: none;
}

/* 展开状态的子列表 */
.quectel-toc li.expanded > ul {
    display: block;
}

.quectel-toc li {
    margin: 0;
}

.quectel-toc a {
    display: flex;
    align-items: center;
    padding: 6px var(--spacing-lg); /* 与标题相同的左右padding */
    color: var(--color-gray-400);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    font-size: var(--font-size-small);
    line-height: 1.3;
    min-width: 0; /* 允许flex子元素收缩 */
}

/* 文字容器 - 仅在溢出时显示省略号 */
.quectel-toc a .toc-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* 悬停效果 - 白底红字 */
.quectel-toc a:hover {
    background: var(--color-white);
    color: var(--color-secondary);
    position: relative;
}

/* 仅在文字溢出时显示浮窗提示 - 使用 fixed 定位在页面最上层，显示在右侧 */
.quectel-toc a[data-overflow="true"]:hover::after {
    content: attr(data-title);
    position: fixed; /* 固定定位，不受父容器限制 */
    left: var(--left-toc-tooltip-left, 300px); /* 通过 CSS 变量设置，默认 300px */
    top: var(--left-toc-tooltip-top, 100px); /* 通过 CSS 变量设置，默认 100px */
    background: var(--color-gray-500);
    color: var(--color-white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    font-size: var(--font-size-small);
    line-height: 1.4;
    z-index: 99999; /* 最高层级 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* 选中效果（滚动自动高亮）- 白底红字 */
.quectel-toc a.current {
    background: var(--color-white) !important;
    color: var(--color-secondary) !important;
}

/* Contents Relations (Prev/Next) - 移到可滚动区域 */
.quectel-contents-relations {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-gray-200);
}

.quectel-contents-prev,
.quectel-contents-next {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    background: var(--color-white);
    border-radius: var(--radius-sm);
    color: var(--color-gray-500);
    text-decoration: none;
    transition: all var(--transition-normal);
    font-size: var(--font-size-small);
}

.quectel-contents-prev:hover,
.quectel-contents-next:hover {
    background: var(--color-secondary-lighter);
    color: var(--color-secondary);
    transform: translateX(4px);
}

.quectel-contents-prev {
    flex-direction: row;
}

.quectel-contents-next {
    flex-direction: row-reverse;
}

.quectel-contents-relation-icon {
    font-weight: var(--font-weight-bold);
}

/* Contents Resize Handle - 目录导航调整宽度拖动条 */
.quectel-contents-resize-handle {
    position: fixed;
    top: var(--header-height);
    left: calc(var(--contents-width) - 2px); /* 居中在边框上 */
    width: 4px;
    height: calc(100vh - var(--header-height));
    background: transparent;
    cursor: ew-resize;
    z-index: 100;
    transition: left var(--transition-normal);
}

.quectel-contents-resize-handle:hover,
.quectel-contents-resize-handle.dragging {
    background: transparent;
}

.quectel-contents-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 40px;
    background: var(--color-gray-300);
    border-radius: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.quectel-contents-resize-handle:hover::before {
    opacity: 1;
}

/* Main Content Area */
.quectel-main {
    flex: 1;
    /* 为固定的边栏留出空间 */
    margin-left: var(--contents-width);
    margin-right: var(--on-this-page-width);
    margin-top: var(--toc-title-height);
    background: var(--color-white);
    min-height: calc(100vh - var(--header-height) - var(--toc-title-height));
    transition: margin-right var(--transition-normal);
}

/*
   侧边栏展开/收起时：内容区域应整体移动/压缩，而不是“挤压正文左侧间距”。
   方式：
   - 用 quectel-main 的 margin-left 来给侧边栏让位（整体位移）
   - 同时保证正文容器 quectel-content 始终有稳定的左侧间距（不随主容器缩放变化）
*/
.quectel-main {
    transition: margin-left var(--transition-normal), margin-right var(--transition-normal);
}

html.qdoc-theme-initializing .quectel-main,
html.qdoc-theme-initializing .quectel-content-header,
html.qdoc-theme-initializing .quectel-contents-resize-handle,
html.qdoc-theme-initializing .on-this-page,
html.qdoc-theme-initializing .on-this-page-nav,
html.qdoc-theme-initializing .on-this-page-title,
html.qdoc-theme-initializing .on-this-page-content {
    transition: none !important;
}

/* 正文容器：保持固定的左右内边距，避免导航切换时文字“贴边/被压缩” */
.quectel-content {
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
    box-sizing: border-box;
}

/* 桌面端隐藏遮罩层 */
.quectel-contents-overlay {
    display: none;
}

/* 内容区域固定标题栏 */
.quectel-content-header {
    position: fixed;
    top: var(--header-height); /* 位于顶部导航下方 */
    left: var(--contents-width); /* 保持位于左侧导航右侧（整体位移） */
    right: var(--on-this-page-width); /* 为右侧边栏留出空间 */
    height: var(--toc-title-height); /* 与左侧TOC标题高度一致 */
    background: var(--color-white);
    border-bottom: 2px solid var(--color-secondary);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-xl); /* 与正文区域的左右内边距一致 */
    padding-left: calc(var(--spacing-xl) + 32px + var(--spacing-md)); /* 为左侧按钮留出空间 */
    z-index: 100; /* 确保在内容之上，但低于主导航 */
    box-sizing: border-box;
    color: var(--color-gray-500);
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-medium);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: left var(--transition-normal), right var(--transition-normal); /* 添加过渡动画 */
    /* 作为按钮的定位上下文（按钮将绝对定位在标题栏右侧） */
    position: fixed;
}

/* 内容标题栏内的左侧Contents折叠按钮 */
.quectel-content-header .contents-toggle {
    position: absolute !important;
    top: 50% !important;
    left: var(--spacing-lg) !important;
    right: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    /* 移除边框、背景，只保留图标 */
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--color-primary);
    box-shadow: none;
    cursor: pointer;
    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast),
        color var(--transition-fast);
}

.quectel-content-header .contents-toggle img,
.quectel-content-header .contents-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
    transition: transform var(--transition-fast);
}

.quectel-content-header .contents-toggle:hover {
    opacity: 0.7;
    color: var(--color-primary-dark);
}

.quectel-content-header .contents-toggle:active {
    transform: translateY(calc(-50% + 1px)) !important;
    opacity: 0.5;
}

.quectel-content-header .contents-toggle:focus-visible {
    outline: 2px solid rgba(0, 102, 204, 0.4);
    outline-offset: 2px;
}

/* 内容标题栏内的 Share Feedback 按钮（位于右侧折叠按钮左侧） */
.quectel-content-header .quectel-share-feedback {
    position: absolute !important;
    top: 50% !important;
    right: calc(var(--spacing-lg) + 24px + var(--spacing-md)) !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast);
}

.quectel-content-header .quectel-share-feedback img {
    width: 24px;
    height: 24px;
    display: block;
}

.quectel-content-header .quectel-share-feedback:hover {
    opacity: 0.7;
}

.quectel-content-header .quectel-share-feedback:active {
    transform: translateY(calc(-50% + 1px)) !important;
    opacity: 0.5;
}

/* 内容标题栏内的搜索按钮（位于Share Feedback按钮左侧） */
.quectel-content-header .quectel-content-search {
    position: absolute !important;
    top: 50% !important;
    right: calc(var(--spacing-lg) + 24px + var(--spacing-md) + 24px + var(--spacing-md)) !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    color: var(--color-primary);
    transition:
        color var(--transition-fast),
        opacity var(--transition-fast),
        transform var(--transition-fast);
}

.quectel-content-header .quectel-content-search svg {
    display: block;
    width: 24px;
    height: 24px;
}

.quectel-content-header .quectel-content-search:hover {
    color: var(--color-primary-dark);
    opacity: 0.7;
}

.quectel-content-header .quectel-content-search:active {
    transform: translateY(calc(-50% + 1px)) !important;
    opacity: 0.5;
}

/* 内容标题栏内的右侧按钮区域（单按钮） */
.quectel-content-header .on-this-page-toggle {
    position: absolute !important;
    top: 50% !important;
    right: var(--spacing-lg) !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

/* 当右侧边栏收缩时，调整内容头部 */
/* 
   JavaScript需要在切换收缩状态时：
   1. 切换.on-this-page元素的.collapsed类
   2. 切换body元素的.on-this-page-collapsed类
   3. 或者直接给.quectel-content-header添加.collapsed类
*/
/* 方法1：通过body上的类名控制 */
body.on-this-page-collapsed .quectel-content-header {
    right: 0; /* 侧边栏完全隐藏，标题栏占满到右边 */
}

/* 方法2：直接在content-header上添加类名 */
.quectel-content-header.collapsed {
    right: 0;
}

/* 方法3：使用:has选择器（现代浏览器支持） */
body:has(.on-this-page.collapsed) .quectel-content-header {
    right: 0;
}

.quectel-content-header-title {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: 1.4;
}

.quectel-content {
    max-width: 1215px; /* 90% of top navigation content width (1352px * 0.9 = 1216.8px) */
    margin: 0 auto;
}

/* Override basic theme document styles */
.document {
    max-width: none;
    width: 100%;
}

.documentwrapper {
    float: none;
    width: 100%;
}

.bodywrapper {
    margin: 0;
}

.body {
    padding: 0;
}

/* Hide basic theme sidebar elements */
.sphinxsidebar,
.related {
    display: none;
}

/* ========================================
   Typography - 排版样式
   ======================================== */
.quectel-content h1,
.quectel-content .section > h1 {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-gray-500);
    margin: var(--spacing-xl) 0 var(--spacing-sm);  /* 上间距拉宽：36px */
}

.quectel-content h2,
.quectel-content .section > h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-gray-500);
    margin: var(--spacing-lg) 0 var(--spacing-sm);  /* 上间距拉宽：24px */
    padding-bottom: var(--spacing-xs);  /* 原 var(--spacing-sm)，更紧凑 */
    border-bottom: 2px solid var(--color-secondary-lighter);
}

.quectel-content h3,
.quectel-content .section > h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-gray-500);
    margin: var(--spacing-lg) 0 var(--spacing-xs);  /* 上间距拉宽：24px */
}

.quectel-content h4,
.quectel-content .section > h4 {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-gray-500);
    margin: var(--spacing-md) 0 var(--spacing-xs);  /* 上间距拉宽：18px */
}

.quectel-content h5,
.quectel-content .section > h5 {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-gray-500);
    margin: var(--spacing-md) 0 var(--spacing-xs);  /* 上间距拉宽：18px */
}

/* Hide Sphinx headerlink (¶ symbol) */
.quectel-content .headerlink {
    display: none !important;
}

.quectel-content p {
    margin-bottom: var(--spacing-sm);  /* 原 var(--spacing-md)，更紧凑 */
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-500);
}

.quectel-content a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.quectel-content a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ========================================
   Code Blocks - 代码块样式（基于Quectel品牌设计规范）
   ======================================== */
/* Inline code 行内代码 */
.quectel-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: #d73a49;
    border: 1px solid #e9ecef;
}

/* Code block container 代码块容器 */
.quectel-content .code-block,
.quectel-content .highlight,
.quectel-content div[class*="highlight-"] {
    position: relative;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    margin: var(--spacing-sm) 0;  /* 原 var(--spacing-md)，减少上下留白 */
    overflow: hidden;
}

/* Code block header 代码块头部 - 隐藏不显示 */
.quectel-content .code-block-header {
    display: none;
}

/* Language label 语言标签 */
.quectel-content .code-block-language {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Copy button 复制按钮 - 放置在代码块内部右上角 */
.quectel-content .code-copy-btn,
.quectel-content .copybtn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5da;
    border-radius: 4px;
    font-size: 12px;
    color: #586069;
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    opacity: 0;
}

.quectel-content .code-block:hover .code-copy-btn,
.quectel-content .highlight:hover .copybtn {
    opacity: 1;
}

.quectel-content .code-copy-btn:hover,
.quectel-content .copybtn:hover {
    background: #ffffff;
    border-color: #959da5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.quectel-content .code-copy-btn.copied {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    opacity: 1;
}

.quectel-content .code-copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Code block content 代码块内容 */
.quectel-content .code-block-content {
    position: relative;
    padding: 16px;
    overflow-x: auto;
    background: #f6f8fa;
}

/* Pre element styling */
.quectel-content pre {
    position: relative;
    background: #f6f8fa !important;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 16px;
    padding-right: 80px; /* 为复制按钮留出空间 */
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    tab-size: 4;
    font-family: 'SFMono-Regular', 'Cascadia Mono', 'DejaVu Sans Mono', 'Consolas', 'Liberation Mono', 'Courier New', 'Microsoft YaHei Mono', 'Microsoft YaHei', 'PingFang SC', monospace;
    line-height: 1.7;
}

.quectel-content .highlight pre {
    margin: 0;
    border: none;
    background: #f6f8fa !important;
}

.quectel-content pre code {
    display: block;
    padding: 0;
    overflow-x: auto;
    background: transparent !important;
    font-family: inherit;
    font-size: 14px;
    line-height: inherit;
    color: #24292e;
    border: none;
    white-space: inherit;
    word-break: inherit;
    overflow-wrap: inherit;
}

.quectel-content .highlight pre *,
.quectel-content .code-block-content pre * {
    font-family: inherit;
}

/* Syntax highlighting - GitHub style colors
   Use .quectel-content prefix (specificity 0,3,0) to always beat
   pygments.css bare .highlight rules (specificity 0,2,0),
   regardless of CSS load order / browser cache. */

/* Comments: all sub-types */
.quectel-content .highlight .c,
.quectel-content .highlight .c1,
.quectel-content .highlight .cm,
.quectel-content .highlight .cp,
.quectel-content .highlight .cpf,
.quectel-content .highlight .cs,
.quectel-content .highlight .ch { color: #6a737d; font-style: italic; } /* Comment */

/* Keywords: all sub-types */
.quectel-content .highlight .k,
.quectel-content .highlight .kc,
.quectel-content .highlight .kd,
.quectel-content .highlight .ki,
.quectel-content .highlight .kn,
.quectel-content .highlight .kp,
.quectel-content .highlight .kr { color: #d73a49; font-weight: 600; } /* Keyword */

/* Keyword.Type (int, void, char, etc.) */
.quectel-content .highlight .kt { color: #d73a49; } /* Keyword.Type */

/* Names */
.quectel-content .highlight .n  { color: #24292e; }                   /* Name */
.quectel-content .highlight .na { color: #005cc5; }                   /* Name.Attribute */
.quectel-content .highlight .nb { color: #005cc5; }                   /* Name.Builtin */
.quectel-content .highlight .nc { color: #6f42c1; font-weight: 600; } /* Name.Class */
.quectel-content .highlight .nd { color: #e36209; }                   /* Name.Decorator */
.quectel-content .highlight .ne { color: #d73a49; font-weight: 600; } /* Name.Exception */
.quectel-content .highlight .nf { color: #6f42c1; }                   /* Name.Function */
.quectel-content .highlight .ni { color: #24292e; }                   /* Name.Entity */
.quectel-content .highlight .nl { color: #24292e; }                   /* Name.Label */
.quectel-content .highlight .nn { color: #24292e; font-weight: 600; } /* Name.Namespace */
.quectel-content .highlight .nt { color: #22863a; }                   /* Name.Tag */
.quectel-content .highlight .nv { color: #e36209; }                   /* Name.Variable */

/* Operators */
.quectel-content .highlight .o  { color: #d73a49; }                   /* Operator */
.quectel-content .highlight .ow { color: #d73a49; font-weight: 600; } /* Operator.Word */

/* Punctuation */
.quectel-content .highlight .p  { color: #24292e; }                   /* Punctuation */

/* Strings: all sub-types */
.quectel-content .highlight .s,
.quectel-content .highlight .s1,
.quectel-content .highlight .s2,
.quectel-content .highlight .sa,
.quectel-content .highlight .sb,
.quectel-content .highlight .sc,
.quectel-content .highlight .dl,
.quectel-content .highlight .sd,
.quectel-content .highlight .se,
.quectel-content .highlight .sh,
.quectel-content .highlight .si,
.quectel-content .highlight .sl,
.quectel-content .highlight .sr,
.quectel-content .highlight .ss,
.quectel-content .highlight .sx { color: #032f62; }                   /* String */

/* Numbers: all sub-types */
.quectel-content .highlight .m,
.quectel-content .highlight .mb,
.quectel-content .highlight .mf,
.quectel-content .highlight .mh,
.quectel-content .highlight .mi,
.quectel-content .highlight .ml,
.quectel-content .highlight .mo,
.quectel-content .highlight .mx { color: #005cc5; }                   /* Number */

/* Errors - override pygments red border */
.quectel-content .highlight .err { color: #b31d28; background-color: transparent; border: none; } /* Error */

/* Generic tokens */
.quectel-content .highlight .gh { color: #005cc5; font-weight: 600; } /* Generic.Heading */
.quectel-content .highlight .gu { color: #6f42c1; font-weight: 600; } /* Generic.Subheading */
.quectel-content .highlight .gi { color: #22863a; }                   /* Generic.Inserted */
.quectel-content .highlight .gd { color: #b31d28; }                   /* Generic.Deleted */

/* Whitespace */
.quectel-content .highlight .w  { color: inherit; }                   /* Text.Whitespace */

/* Ensure proper copy button positioning for legacy code blocks */
.quectel-content .highlight .copybtn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ========================================
   Tables - 表格样式
   ======================================== */
.quectel-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.quectel-content table th {
    background: var(--color-gray-100);
    color: var(--color-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    border: 1px solid var(--color-gray-200);
    font-size: var(--font-size-body);
}

.quectel-content table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-200);
    color: var(--color-gray-500);
}

.quectel-content table tr:nth-child(even) {
    background: var(--color-gray-100);
}

.quectel-content table tr:hover {
    background: #f0f0f0;
}

.quectel-content table code {
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
}

/* ========================================
   Admonitions - 提示框样式 (不同类型使用不同颜色)
   ======================================== */
/* 通用样式 */
.quectel-content .admonition,
.quectel-content .note,
.quectel-content .warning,
.quectel-content .tip,
.quectel-content .important,
.quectel-content .caution,
.quectel-content .danger {
    padding: var(--spacing-sm);  /* 从 24px 减小到 16px */
    border-radius: var(--radius-md);
    margin: 0;
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

/* 通用标题样式 */
.quectel-content .admonition-title,
.quectel-content .admonition > p.admonition-title {
    font-weight: var(--font-weight-semibold);
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

/* Note/备注 - 蓝色风格（默认） */
.quectel-content .note,
.quectel-content .admonition.note {
    background: #E6F2FF;
    border-color: #0066CC;
}

.quectel-content .note .admonition-title,
.quectel-content .admonition.note .admonition-title {
    color: #0066CC;
}

.quectel-content .note p,
.quectel-content .admonition.note p {
    color: #0066CC;
}

/* Warning/警告 - 黄色风格 */
.quectel-content .warning,
.quectel-content .admonition.warning {
    background: #FFF8E1;
    border-color: #FFC107;
}

.quectel-content .warning .admonition-title,
.quectel-content .admonition.warning .admonition-title {
    color: #F57C00;
}

.quectel-content .warning p,
.quectel-content .admonition.warning p {
    color: #F57C00;
}

/* Tip/提示 - 绿色风格 */
.quectel-content .tip,
.quectel-content .admonition.tip {
    background: #E8F5E9;
    border-color: #28A745;
}

.quectel-content .tip .admonition-title,
.quectel-content .admonition.tip .admonition-title {
    color: #28A745;
}

.quectel-content .tip p,
.quectel-content .admonition.tip p {
    color: #1B5E20;
}

/* Important/重要 & Caution/注意 & Danger/危险 - 红色风格 */
.quectel-content .important,
.quectel-content .caution,
.quectel-content .danger,
.quectel-content .admonition.important,
.quectel-content .admonition.caution,
.quectel-content .admonition.danger {
    background: #FFEBEE;
    border-color: #DC3545;
}

.quectel-content .important .admonition-title,
.quectel-content .caution .admonition-title,
.quectel-content .danger .admonition-title,
.quectel-content .admonition.important .admonition-title,
.quectel-content .admonition.caution .admonition-title,
.quectel-content .admonition.danger .admonition-title {
    color: #DC3545;
}

.quectel-content .important p,
.quectel-content .caution p,
.quectel-content .danger p,
.quectel-content .admonition.important p,
.quectel-content .admonition.caution p,
.quectel-content .admonition.danger p {
    color: #B71C1C;
}

/* 备注框内所有元素的顶部间距重置 */
.quectel-content .admonition > *:first-child,
.quectel-content .note > *:first-child,
.quectel-content .warning > *:first-child,
.quectel-content .tip > *:first-child,
.quectel-content .important > *:first-child,
.quectel-content .caution > *:first-child,
.quectel-content .danger > *:first-child {
    margin-top: 0 !important;  /* 第一个元素顶部无间距 */
}

/* 备注框内所有元素的底部间距重置 */
.quectel-content .admonition > *:last-child,
.quectel-content .note > *:last-child,
.quectel-content .warning > *:last-child,
.quectel-content .tip > *:last-child,
.quectel-content .important > *:last-child,
.quectel-content .caution > *:last-child,
.quectel-content .danger > *:last-child {
    margin-bottom: 0 !important;  /* 最后一个元素底部无间距 */
}

/* 所有备注类型的段落样式 - 缩小行间距 */
.quectel-content .admonition p,
.quectel-content .note p,
.quectel-content .warning p,
.quectel-content .tip p,
.quectel-content .important p,
.quectel-content .caution p,
.quectel-content .danger p {
    margin: 0 !important;
}

/* 多个段落之间保留适当间距 */
.quectel-content .admonition p + p,
.quectel-content .note p + p,
.quectel-content .warning p + p,
.quectel-content .tip p + p,
.quectel-content .important p + p,
.quectel-content .caution p + p,
.quectel-content .danger p + p {
    margin-top: var(--spacing-sm);
}

/* ========================================
   Table Styles - 表格样式 (基于 Quectel Brand Design Demo)
   ======================================== */

/* 通用表格样式 - 适用于所有Sphinx生成的表格 */
.quectel-content table,
.quectel-content table.docutils,
.quectel-content table.colwidths-auto,
.quectel-content table.align-default {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-body);
}

/* 表头样式 - 最高优先级确保红色显示 */
.quectel-content table th,
.quectel-content table.docutils th,
.quectel-content table.colwidths-auto th,
.quectel-content table.align-default th,
.quectel-content table.spec-table th,
.quectel-content table th.head,
.quectel-content .spec-table.docutils.align-default th,
.quectel-content table.spec-table.docutils.align-default th,
.quectel-content .spec-table.docutils.align-default th.head,
.quectel-content table.spec-table.docutils.align-default th.head {
    background: var(--color-gray-100) !important;
    color: var(--color-secondary) !important; /* Quectel红色 #E31E24 */
    padding: var(--spacing-sm) var(--spacing-md) !important;
    text-align: left !important;
    font-weight: var(--font-weight-semibold) !important;
    border: 1px solid var(--color-gray-200) !important; /* 表头单元格有边框 */
    font-size: var(--font-size-body) !important;
    line-height: var(--line-height-normal) !important;
}

/* 确保表头内的 p 和 strong 标签也显示红色 - 最高优先级 */
.quectel-content table th p,
.quectel-content table.docutils th p,
.quectel-content table.colwidths-auto th p,
.quectel-content table.align-default th p,
.quectel-content table.spec-table th p,
.quectel-content table th.head p,
.quectel-content .spec-table.docutils.align-default th.head p,
.quectel-content table.spec-table.docutils.align-default th.head p,
.quectel-content table th strong,
.quectel-content table.docutils th strong,
.quectel-content table.colwidths-auto th strong,
.quectel-content table.align-default th strong,
.quectel-content table.spec-table th strong,
.quectel-content table th.head strong,
.quectel-content .spec-table.docutils.align-default th.head strong,
.quectel-content table.spec-table.docutils.align-default th.head strong {
    color: var(--color-secondary) !important; /* Quectel红色 #E31E24 */
    font-weight: var(--font-weight-semibold) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 专门针对 th.head 类的样式强化 - 增加更多选择器覆盖 */
.quectel-content table th.head,
.quectel-content table.docutils th.head,
.quectel-content .docutils th.head,
.quectel-content th.head,
.docutils th.head,
table.docutils th.head,
table.align-default th.head {
    color: var(--color-secondary) !important; /* 确保红色显示 #E31E24 */
    font-weight: var(--font-weight-semibold) !important;
    background: var(--color-gray-100) !important;
}

/* 修复表头内部的 p 和 strong 标签颜色继承问题 */
.quectel-content table th.head p,
.quectel-content table.docutils th.head p,
.quectel-content .docutils th.head p,
.quectel-content th.head p,
.docutils th.head p,
table.docutils th.head p,
table.align-default th.head p,
.quectel-content table th.head strong,
.quectel-content table.docutils th.head strong,
.quectel-content .docutils th.head strong,
.quectel-content th.head strong,
.docutils th.head strong,
table.docutils th.head strong,
table.align-default th.head strong {
    color: var(--color-secondary) !important; /* 确保红色显示 #E31E24 */
    font-weight: var(--font-weight-semibold) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 针对原始HTML表格（无class）的表头样式 */
.quectel-content table:not([class]) th,
.quectel-content table:not([class]) th strong {
    background: var(--color-gray-100);
    color: var(--color-secondary) !important; /* Quectel红色 #E31E24 */
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    border: 1px solid var(--color-gray-200);
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
}

/* 针对原始HTML表格（无class）的单元格样式 */
.quectel-content table:not([class]) td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-200) !important;
    vertical-align: top;
    line-height: var(--line-height-normal);
}

/* 表格单元格样式 */
.quectel-content table td,
.quectel-content table.docutils td,
.quectel-content table.colwidths-auto td,
.quectel-content table.align-default td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-200) !important;
    vertical-align: top;
    line-height: var(--line-height-normal);
}

/* 奇偶行样式 - 提升可读性 */
.quectel-content table tr:nth-child(even),
.quectel-content table.docutils tbody tr:nth-child(even),
.quectel-content table.colwidths-auto tbody tr:nth-child(even),
.quectel-content table.align-default tbody tr:nth-child(even) {
    background: var(--color-gray-100);
}

/* 表格链接样式 */
.quectel-content table a,
.quectel-content table.docutils a,
.quectel-content table.colwidths-auto a,
.quectel-content table.align-default a {
    color: var(--color-primary); /* Quectel蓝色 #0066CC */
    text-decoration: none;
    transition: color var(--transition-fast);
}

.quectel-content table a:hover,
.quectel-content table.docutils a:hover,
.quectel-content table.colwidths-auto a:hover,
.quectel-content table.align-default a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* 产品规格表样式 - 特殊的两列布局（如附件所示）*/
.quectel-content table.spec-table,
.quectel-content table.product-specs {
    max-width: 800px;
    margin: var(--spacing-lg) 0;
}

/* 规格表第一列（类别列）- 灰色背景 */
.quectel-content table.spec-table td:first-child,
.quectel-content table.product-specs td:first-child {
    background: var(--color-gray-100);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-500);
    width: 40%; /* 固定宽度比例 */
    white-space: nowrap;
}

/* 规格表第二列（特性列）- 白色背景 */
.quectel-content table.spec-table td:last-child,
.quectel-content table.product-specs td:last-child {
    background: var(--color-white);
    color: var(--color-gray-500);
    width: 60%; /* 固定宽度比例 */
}

/* 确保规格表奇偶行样式正确应用 */
.quectel-content table.spec-table tr:nth-child(even) td:first-child,
.quectel-content table.product-specs tr:nth-child(even) td:first-child {
    background: var(--color-gray-200); /* 稍微深一点的灰色 */
}

.quectel-content table.spec-table tr:nth-child(even) td:last-child,
.quectel-content table.product-specs tr:nth-child(even) td:last-child {
    background: var(--color-white); /* 保持白色 */
}

/* ========================================
   原始HTML表格兼容性样式 - 自动应用产品规格表样式
   ======================================== */
/* 为所有没有CSS类的原始HTML表格应用规格表样式 */
.quectel-content table:not([class]) {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    max-width: 800px;
}

/* 原始HTML表格的表头样式 */
.quectel-content table:not([class]) th {
    background: var(--color-gray-100) !important;
    color: var(--color-secondary) !important; /* Quectel红色 #E31E24 */
    padding: var(--spacing-sm) var(--spacing-md) !important;
    text-align: left !important;
    font-weight: var(--font-weight-semibold) !important;
    border: 1px solid var(--color-gray-200) !important;
    font-size: var(--font-size-body) !important;
    line-height: var(--line-height-normal) !important;
}

/* 原始HTML表格的单元格样式 */
.quectel-content table:not([class]) td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-200);
    vertical-align: top;
    line-height: var(--line-height-normal);
}

/* 原始HTML表格第一列（类别列）- 仅为spec表格设置灰色背景 */
.quectel-content table:not([class]) td:first-child {
    /* 移除默认的灰色背景，让所有列保持一致 */
    background: inherit;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    white-space: nowrap;
}

/* 原始HTML表格第二列（特性列）- 白色背景 */
.quectel-content table:not([class]) td:last-child {
    background: inherit;
    color: var(--color-text);
}

/* 原始HTML表格的奇偶行样式 - 统一背景 */
.quectel-content table:not([class]) tr:nth-child(even) td:first-child {
    background: var(--color-gray-50); /* 统一的浅背景 */
}

.quectel-content table:not([class]) tr:nth-child(even) td:last-child {
    background: var(--color-gray-50); /* 统一的浅背景 */
}

/* 原始HTML表格中的<br>标签处理 */
.quectel-content table:not([class]) td br {
    line-height: 1.6;
}

/* 原始HTML表格的链接样式 */
.quectel-content table:not([class]) a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.quectel-content table:not([class]) a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* 响应式表格 - 移动设备优化 */
@media (max-width: 768px) {
    .quectel-content table,
    .quectel-content table.docutils,
    .quectel-content table.colwidths-auto,
    .quectel-content table.align-default,
    .quectel-content table.spec-table,
    .quectel-content table.product-specs {
        font-size: var(--font-size-small);
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .quectel-content table th,
    .quectel-content table td {
        padding: var(--spacing-xs) var(--spacing-sm);
        min-width: 120px;
    }
}

/* 列表样式 */
.quectel-content .admonition ul,
.quectel-content .admonition ol,
.quectel-content .note ul,
.quectel-content .note ol,
.quectel-content .warning ul,
.quectel-content .warning ol,
.quectel-content .tip ul,
.quectel-content .tip ol,
.quectel-content .important ul,
.quectel-content .important ol,
.quectel-content .caution ul,
.quectel-content .caution ol,
.quectel-content .danger ul,
.quectel-content .danger ol {
    margin-bottom: 0;
    line-height: 1.4;
}

/* Strong 标签继承父元素颜色 */
.quectel-content .admonition strong,
.quectel-content .note strong,
.quectel-content .warning strong,
.quectel-content .tip strong,
.quectel-content .important strong,
.quectel-content .caution strong,
.quectel-content .danger strong {
    font-weight: var(--font-weight-semibold);
}

/* ========================================
   Images - 图片样式
   ======================================== */
.quectel-content img {
    max-width: 100%;  /* 自适应，不超过容器宽度 */
    height: auto;     /* 保持宽高比 */
    margin: var(--spacing-md) auto;  /* 减小上下间距，更紧凑 */
    display: block;
    border-radius: var(--radius-md);
    box-shadow: none;
}

/* 没有 width 属性的图片，使用 auto 宽度，并限制最大高度防止图片过高 */
.quectel-content img:not([width]) {
    width: auto;       /* 不强制拉伸宽度 */
    height: auto;      /* 默认高度自适应 */
    max-width: 100%;   /* 不超出容器宽度 */
    max-height: min(500px, 60vh);  /* 防止图片高度过高，与页面文字比例失调 */
    object-fit: contain;  /* 确保在任何约束下都保持原始长宽比 */
}

@media (max-width: 768px) {
    /* 移动端图片高度进一步限制，避免单张图片占满屏幕 */
    .quectel-content img:not([width]) {
        max-height: min(260px, 40vh);
        max-width: 100%;
        object-fit: contain;  /* 保持长宽比 */
    }
}

.quectel-content .figure {
    text-align: center;
    margin: var(--spacing-md) 0;  /* 减小上下间距 */
}

.quectel-content .figure img {
    margin: 0 auto;
}

.quectel-content .caption,
.quectel-content .figure .caption {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--color-gray-400);
    line-height: 1.5;
    margin-top: var(--spacing-sm);
    font-style: italic;
    /* 支持文字换行显示 */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* ========================================
   Lists - 列表样式
   ======================================== */
.quectel-content ul,
.quectel-content ol {
    margin-bottom: var(--spacing-xs);  /* 6px，极其紧凑 */
    padding-left: var(--spacing-md);   /* 18px，更紧凑 */
    line-height: 1.6;    /* 更紧凑的行高 */
}

.quectel-content li {
    margin-bottom: var(--spacing-xxs);  /* 1px，极其紧凑 */
    color: var(--color-gray-500);
}

/* 列表项内的段落，去除多余间距 */
.quectel-content li > p {
    margin-bottom: 0;  /* 移除列表项内段落的底部间距 */
}

/* 如果列表项内有多个段落，给中间的段落一些间距 */
.quectel-content li > p + p {
    margin-top: var(--spacing-xxs);  /* 1px */
}

.quectel-content ul ul,
.quectel-content ol ol,
.quectel-content ul ol,
.quectel-content ol ul {
    margin-top: var(--spacing-xxs);     /* 1px */
    margin-bottom: var(--spacing-xxs);  /* 1px */
}

/* ========================================
   Blockquote - 引用样式
   ======================================== */
.quectel-content blockquote {
    border-left: 4px solid var(--color-primary);
    background: var(--color-gray-100);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-radius: var(--radius-sm);
    color: var(--color-gray-400);
    font-style: italic;
}

/* ========================================
   Definition List - 定义列表
   ======================================== */
.quectel-content dl dt {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-500);
    margin-top: var(--spacing-sm);
}

.quectel-content dl dd {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--color-gray-400);
}

/* ========================================
   Horizontal Rule - 分隔线
   ======================================== */
.quectel-content hr {
    border: none;
    border-top: 2px solid var(--color-gray-200);
    margin: var(--spacing-xl) 0;
}

/* ========================================
   Buttons - 按钮样式
   ======================================== */
.quectel-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
    text-decoration: none;
    min-width: 140px;
}

.quectel-btn-primary {
    background-color: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
}

.quectel-btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.18);
    transform: translateY(-1px);
    text-decoration: none;
    color: #FFFFFF;
}

.quectel-btn-secondary {
    background-color: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.quectel-btn-secondary:hover {
    background-color: var(--color-primary-lighter);
    color: var(--color-primary-dark);
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.12);
    transform: translateY(-1px);
}

.quectel-btn:focus-visible,
.quectel-btn-primary:focus-visible,
.quectel-btn-secondary:focus-visible,
.quectel-btn-prev:focus-visible,
.quectel-btn-next:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.18);
}

.quectel-btn:disabled,
.quectel-btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Page Navigation Buttons */
.quectel-page-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xxl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-gray-200);
}

.quectel-btn-prev,
.quectel-btn-next {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-white);
    border: 2px solid var(--color-secondary);
    color: var(--color-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.quectel-btn-prev:hover,
.quectel-btn-next:hover {
    background: var(--color-secondary);
    color: var(--color-white);
}

.quectel-btn-icon {
    font-weight: var(--font-weight-bold);
}

/* ========================================
   Footer - 页脚
   ======================================== */
.quectel-footer {
    background: #000000;
    color: #ffffff;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-top: 0;
    width: 100%;
    clear: both;
    position: relative;
    z-index: 101; /* Higher than content and on this page z-index: 100 */
    flex-shrink: 0;
}

.quectel-footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.quectel-footer-section h4 {
    color: #a0a0a0;
    margin-bottom: var(--spacing-md);
    margin-top: 0;
    font-size: 14px;
    font-weight: var(--font-weight-normal);
}

.quectel-footer-section p {
    color: #ffffff;
    font-size: 14px;
    line-height: var(--line-height-relaxed);
}

.quectel-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quectel-footer-links li {
    margin-bottom: 8px;
}

.quectel-footer-links a {
    color: #ffffff;
    font-size: 14px;
    text-decoration: none;
    transition: color var(--transition-normal);
}

.quectel-footer-links a:hover {
    color: #cccccc;
}

.quectel-footer-bottom {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md) 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    font-size: 14px;
}

.quectel-footer-bottom p {
    margin: 8px 0;
}

/* ========================================
   Responsive Design - 响应式设计
   ======================================== */

/* 大屏幕优化三栏布局 */
@media (min-width: 1400px) {
    :root {
        --contents-width: 320px; /* 左侧目录导航稍微增加宽度 */
        --on-this-page-width: 300px; /* 右侧导航稍微增加宽度 */
    }
}

@media (max-width: 1024px) {
    :root {
        --contents-width: 280px;
        --on-this-page-width: 260px; /* 中等屏幕下减少右侧导航宽度 */
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-h1: 32px;
        --font-size-h2: 28px;
        --font-size-h3: 24px;
        --font-size-h4: 20px;
        --font-size-body: 14px;
    }
    
    /* 移动端背景遮罩层 */
    .quectel-contents-overlay {
        display: block; /* 移动端显示遮罩层 */
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-normal), visibility var(--transition-normal);
    }
    
    .quectel-contents-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .quectel-contents {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        /* 在移动端保持 flex 布局 */
        display: flex;
        flex-direction: column;
        /* 提高移动端z-index，确保目录导航在遮罩层之上 */
        z-index: 1002;
    }
    
    .quectel-contents.open {
        transform: translateX(0);
        /* 移动端 open 状态完全覆盖 collapsed 状态（collapsed 是桌面端折叠逻辑） */
        width: var(--contents-width) !important;
        min-width: var(--contents-width) !important;
        overflow: visible !important;
    }
    
    /* 移动端目录区域调整 */
    .quectel-toc {
        /* 移动端也自适应高度，但设置一个合理的最大值 */
        max-height: 70vh;
    }
    
    .quectel-toc-title {
        padding: var(--spacing-sm) var(--spacing-md) var(--spacing-xs);
        font-size: var(--font-size-small); /* 移动端标题稍小一些 */
    }
    
    .quectel-toc > ul {
        padding: var(--spacing-xs) var(--spacing-md) var(--spacing-sm);
    }
    
    .quectel-main {
        margin-left: 0;
        margin-top: var(--header-height);
        max-width: 100%;
        /* padding: var(--spacing-md); */
        /* 移动端也需要考虑header高度 */
        min-height: calc(100vh - var(--header-height));
    }
    
    /* 移动端内容标题栏调整 */
    .quectel-content-header {
        left: 0; /* 移动端占满整个宽度 */
        right: 0; /* 移动端右侧边栏隐藏，标题栏延伸到右边缘 */
        padding: 0 var(--spacing-md);
        /* 左侧为 contents-toggle 按钮留出空间（按钮位于 left: spacing-lg，宽24px） */
        padding-left: calc(var(--spacing-lg) + 24px + var(--spacing-sm));
        font-size: var(--font-size-small);
        /* 移动端标题栏在侧边栏(1002)和遮罩层(1001)之上，确保可点击 */
        z-index: 1003;
    }
    
    /* 移动端：侧边栏从标题栏下方开始显示，不覆盖顶部按钮 */
    .quectel-contents {
        top: calc(var(--header-height) + var(--toc-title-height));
        height: calc(100vh - var(--header-height) - var(--toc-title-height));
    }
    
    .quectel-mobile-toggle {
        display: flex;
    }
    
    .quectel-nav-menu {
        display: none;
    }
    
    .quectel-content table {
        font-size: var(--font-size-small);
    }
    
    .quectel-content pre code {
        font-size: 12px;
    }
    
    .quectel-page-nav {
        flex-direction: column;
    }
}

/* ========================================
   Utility Classes - 工具类
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

/* ========================================
   Selectable Titles - 可选中的标题样式
   基于 Demo 的 Typography 设计
   ======================================== */
/* 可选中的标题基础样式 */
.quectel-content h1,
.quectel-content h2,
.quectel-content h3,
.quectel-content h4,
.quectel-content h5 {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* 标题下划线动画效果 */
.quectel-content h1::after,
.quectel-content h2::after,
.quectel-content h3::after,
.quectel-content h4::after,
.quectel-content h5::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary); /* 红色 #E31E24 */
    transition: width 0.3s ease;
}

/* 悬停效果 */
.quectel-content h1:hover,
.quectel-content h2:hover,
.quectel-content h3:hover,
.quectel-content h4:hover,
.quectel-content h5:hover {
    color: var(--color-secondary); /* 红色 */
}

/* 选中状态 */
.quectel-content h1.selected,
.quectel-content h2.selected,
.quectel-content h3.selected,
.quectel-content h4.selected,
.quectel-content h5.selected {
    color: var(--color-secondary); /* 红色 */
}

.quectel-content h1.selected::after,
.quectel-content h2.selected::after,
.quectel-content h3.selected::after,
.quectel-content h4.selected::after,
.quectel-content h5.selected::after {
    width: 100%;
}

/* 添加悬停提示样式 */
.quectel-content h1[title],
.quectel-content h2[title],
.quectel-content h3[title],
.quectel-content h4[title],
.quectel-content h5[title] {
    cursor: pointer;
}

/* ========================================
   Print Styles - 打印样式
   ======================================== */
@media print {
    .quectel-header,
    .quectel-contents,
    .quectel-footer,
    .quectel-page-nav {
        display: none;
    }
    
    .quectel-main {
        margin-left: 0;
        max-width: 100%;
    }
    
    .quectel-content {
        max-width: 100%;
    }
    
    /* 打印时移除标题的交互效果 */
    .quectel-content h1,
    .quectel-content h2,
    .quectel-content h3,
    .quectel-content h4,
    .quectel-content h5 {
        cursor: default;
    }
    
    .quectel-content h1::after,
    .quectel-content h2::after,
    .quectel-content h3::after,
    .quectel-content h4::after,
    .quectel-content h5::after {
        display: none;
    }
}

/* ========================================
   Caption Text & Utility Classes - 说明文字和工具类
   ======================================== */
/* 通用说明文字样式 - 基于Quectel品牌设计规范 */
.caption-text,
.quectel-content .caption-text {
    font-size: var(--font-size-xs);
    color: var(--color-gray-400);
    line-height: 1.5;
    /* 支持文字换行显示 */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 间距工具类 */
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

/* 文本对齐工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ========================================
   Table Styles - Quectel 品牌表格样式
   ======================================== */
/* 基于 Quectel_brand_design_demo.html 的 product-table 样式完全匹配 */

/* 1. MyST表格样式 - 带有 spec-table class */
.spec-table,
.spec-table.docutils {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: 1.6;
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.spec-table th,
.spec-table.docutils th {
    background: var(--color-gray-100) !important; /* 灰色背景 #F5F5F5 */
    color: var(--color-secondary) !important; /* 红色文字 #E31E24 */
    padding: var(--spacing-sm) var(--spacing-md) !important;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    border: 1px solid var(--color-gray-200);
    font-family: var(--font-family);
    font-size: var(--font-size-body);
}

.spec-table td,
.spec-table.docutils td {
    padding: var(--spacing-sm) var(--spacing-md) !important;
    border: 1px solid var(--color-gray-200);
    background-color: var(--color-white);
    vertical-align: top;
}

.spec-table tbody tr:nth-child(even) td,
.spec-table.docutils tbody tr:nth-child(even) td {
    background: var(--color-gray-100);
}

.spec-table tbody tr:hover td,
.spec-table.docutils tbody tr:hover td {
    background-color: #f0f8ff;
}

/* 2. 默认Sphinx docutils表格样式覆盖 */
.docutils {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: 1.6;
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.docutils th,
.docutils thead th {
    background: var(--color-gray-100) !important; /* 灰色背景 #F5F5F5 */
    color: var(--color-secondary) !important; /* 红色文字 #E31E24 */
    padding: var(--spacing-sm) var(--spacing-md) !important;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    border: 1px solid var(--color-gray-200);
    font-family: var(--font-family);
    font-size: var(--font-size-body);
}

.docutils td {
    padding: var(--spacing-sm) var(--spacing-md) !important;
    border: 1px solid var(--color-gray-200);
    background-color: var(--color-white);
    vertical-align: top;
}

.docutils tbody tr:nth-child(even) td {
    background: var(--color-gray-100);
}

.docutils tbody tr:hover td {
    background-color: #f0f8ff;
}

/* 3. 原始HTML表格自动样式应用 - 无class属性的表格 */
table:not([class]) {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: 1.6;
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

table:not([class]) th {
    background: var(--color-gray-100) !important; /* 灰色背景 #F5F5F5 */
    color: var(--color-secondary) !important; /* 红色文字 #E31E24 */
    padding: var(--spacing-sm) var(--spacing-md) !important;
    text-align: left !important;
    font-weight: var(--font-weight-semibold) !important;
    border: 1px solid var(--color-gray-200) !important;
    font-family: var(--font-family);
    font-size: var(--font-size-body) !important;
    line-height: 1.6 !important;
}

table:not([class]) td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-200);
    background-color: var(--color-white);
    vertical-align: top;
}

table:not([class]) tbody tr:nth-child(even) td {
    background: var(--color-gray-100);
}

table:not([class]) tbody tr:hover td {
    background-color: #f0f8ff;
}

/* 4. 表格标题样式 */
.docutils caption,
.spec-table caption,
table:not([class]) caption {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-500);
    margin-bottom: var(--spacing-xs);
    text-align: left;
    caption-side: top;
}

/* 5. 表格包装器 - 支持水平滚动 */
.table-wrapper {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
}

.table-wrapper table {
    margin: 0; /* 去除内部margin，由wrapper控制 */
}

/* 6. 响应式设计 - 移动端表格优化 */
@media (max-width: 768px) {
    .spec-table,
    .spec-table.docutils,
    .docutils,
    table:not([class]) {
        font-size: 14px;
    }
    
    .spec-table th,
    .spec-table.docutils th,
    .docutils th,
    table:not([class]) th,
    .spec-table td,
    .spec-table.docutils td,
    .docutils td,
    table:not([class]) td {
        padding: 8px 12px !important;
    }
}

/* 7. 表格内文本样式重置 - 确保继承正确的样式 */
.spec-table p,
.spec-table.docutils p,
.docutils p,
table:not([class]) p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.spec-table em,
.spec-table.docutils em,
.docutils em,
table:not([class]) em {
    font-style: italic;
    color: var(--color-gray-500);
}

.spec-table strong,
.spec-table.docutils strong,
.docutils strong,
table:not([class]) strong {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-500);
}

/* ========================================
   Card Components - 卡片组件
   基于移远品牌设计规范的统一卡片样式
   ======================================== */

/* 基础卡片样式 */
.quectel-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: none;
    text-decoration: none;
    display: block;
    position: relative;
}

/* 卡片悬停效果 - 与品牌设计demo保持一致 */
.quectel-card-hover:hover,
.quectel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

/* 卡片网格布局 */
.quectel-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

/* 卡片标题 */
.quectel-card .sd-card-title {
    font-size: var(--font-size-h4);
    color: var(--color-gray-500);
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
}

/* 卡片内容 */
.quectel-card .sd-card-text {
    color: var(--color-gray-400);
    line-height: var(--line-height-relaxed);
    margin-bottom: 0;
}

/* ========================================
   Document Feedback System - 文档反馈系统
   ======================================== */

/* 国际化字体优化 */
.doc-feedback-modal {
    font-family: var(--font-family);
}

/* 中文字体优化 */
.doc-feedback-modal:lang(zh),
.doc-feedback-modal:lang(zh-CN),
.doc-feedback-modal:lang(zh-Hans) {
    font-family: var(--font-family), 'PingFang SC', 'Microsoft YaHei', '微软雅黑', 'SimSun', '宋体', sans-serif;
}

/* 英文字体优化 */
.doc-feedback-modal:lang(en) {
    font-family: 'Stratos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
}

/* 中英文混排时的行高和字间距优化 */
.doc-feedback-content:lang(zh) label,
.doc-feedback-content:lang(zh-CN) label,
.doc-feedback-content:lang(zh-Hans) label {
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.doc-feedback-content:lang(en) label {
    line-height: 1.4;
    letter-spacing: normal;
}

/* 文本输入框的语言适配 */
.doc-feedback-content:lang(zh) textarea,
.doc-feedback-content:lang(zh-CN) textarea,
.doc-feedback-content:lang(zh-Hans) textarea {
    line-height: 1.8;
    letter-spacing: 0.01em;
}

.doc-feedback-content:lang(en) textarea {
    line-height: 1.5;
    letter-spacing: normal;
}

/* 弹窗遮罩层 */
.doc-feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* JS 动态调整为 center 或 flex-start */
    padding: 16px 0;
    box-sizing: border-box;
    z-index: 10000;
    animation: docFeedbackFadeIn 0.3s ease;
    overflow-y: auto; /* 兜底：极小屏幕时允许滚动到弹窗底部 */
}

@keyframes docFeedbackFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗主体 */
.doc-feedback-modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    height: min(720px, calc(var(--doc-feedback-available-height, 100vh) - 32px));
    max-height: calc(var(--doc-feedback-available-height, 100vh) - 32px);
    min-height: 320px;
    overflow: hidden;
    position: relative;
    font-family: var(--font-family);
    animation: docFeedbackSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes docFeedbackSlideIn {
    from { 
        transform: translateY(-20px) scale(0.98);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 弹窗头部 - 与访问请求弹窗保持一致 */
.doc-feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-gray-200);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-white);
}

.doc-feedback-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-500);
    font-family: var(--font-family);
    line-height: var(--line-height-tight);
}

.doc-feedback-close {
    background: none;
    border: none;
    color: var(--color-gray-400);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color var(--transition-normal);
    font-weight: var(--font-weight-normal);
}

.doc-feedback-close:hover {
    color: var(--color-gray-500);
}

/* 弹窗内容区域 */
.doc-feedback-content {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-gutter: stable;
}

/* 自定义滚动条样式 */
.doc-feedback-content::-webkit-scrollbar {
    width: 6px;
}

.doc-feedback-content::-webkit-scrollbar-track {
    background: transparent;
}

.doc-feedback-content::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
}

.doc-feedback-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

.doc-feedback-content > div {
    margin-bottom: var(--spacing-lg);
}

/* 标签样式 */
.doc-feedback-content label {
    display: block;
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-500);
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-small);
    font-family: var(--font-family);
    line-height: var(--line-height-tight);
}

/* 选中内容显示 */
.selected-content .selected-text-display {
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    font-size: var(--font-size-small);
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-500);
    max-height: 100px;
    overflow-y: auto;
    font-family: var(--font-family);
}

/* 页面信息显示 */
.page-info .page-url-display {
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    font-size: 12px;
    color: var(--color-gray-400);
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 下拉选择框 */
.doc-feedback-content select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-small);
    font-family: var(--font-family);
    background: var(--color-white);
    color: var(--color-gray-500);
    transition: all var(--transition-normal);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    box-sizing: border-box;
}

.doc-feedback-content select:hover {
    border-color: var(--color-primary-light);
}

.doc-feedback-content select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

/* 文本域和输入框 */
.doc-feedback-content textarea, 
.doc-feedback-content input[type="email"] {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-small);
    font-family: var(--font-family);
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-500);
    background: var(--color-white);
    transition: all var(--transition-normal);
    resize: vertical;
    box-sizing: border-box;
}

.doc-feedback-content textarea {
    min-height: 100px;
    max-height: 200px;
}

.doc-feedback-content textarea:hover,
.doc-feedback-content input[type="email"]:hover {
    border-color: var(--color-primary-light);
}

.doc-feedback-content textarea:focus, 
.doc-feedback-content input[type="email"]:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.doc-feedback-content textarea::placeholder,
.doc-feedback-content input[type="email"]::placeholder {
    color: var(--color-gray-300);
}

/* 字符计数 */
.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--color-gray-300);
    margin-top: 4px;
    font-family: var(--font-family);
}

.char-count span {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-400);
}

/* 接收通知勾选框 */
.receive-notification {
    margin: var(--spacing-md) 0;
}

.receive-notification .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: normal;
}

.receive-notification input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: var(--spacing-sm);
    cursor: pointer;
    accent-color: var(--color-primary);
}

.receive-notification .checkbox-label span {
    font-size: var(--font-size-small);
    color: var(--color-gray-500);
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold); /* "Receive Notification" 文字加粗 */
}

/* 用户邮箱标签和输入框 */
.user-email label {
    font-weight: normal; /* 邮箱地址标签不加粗 */
}

/* 弹窗底部 */
.doc-feedback-footer {
    padding: var(--spacing-lg);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    flex-shrink: 0; /* 确保按钮行始终可见，不被压缩 */
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
}

/* 按钮样式 - 继承 Quectel 按钮设计 */
.doc-feedback-footer .btn-cancel {
    background: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.doc-feedback-footer .btn-cancel:hover {
    background: var(--color-primary-lighter);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.12);
}

.doc-feedback-footer .btn-submit {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.doc-feedback-footer .btn-submit:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.18);
}

.doc-feedback-footer .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.doc-feedback-footer .btn-cancel:focus-visible,
.doc-feedback-footer .btn-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.18);
}

/* 加载状态遮罩 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    z-index: 10001;
}

.loading-spinner {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-family);
}

.doc-feedback-success-view {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--spacing-md) var(--spacing-lg);
}

.doc-feedback-modal .submit-success-view {
    text-align: center;
    padding: 0;
}

.doc-feedback-modal.success-compact {
    height: auto !important;
}

.doc-feedback-modal.success-compact .doc-feedback-success-view {
    flex: 0 1 auto;
    overflow-y: auto;
    padding-bottom: var(--spacing-sm);
}

.doc-feedback-modal .submit-success-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-success);
    margin: 0 0 var(--spacing-sm);
}

.doc-feedback-modal .submit-success-desc {
    color: var(--color-gray-400);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 var(--spacing-sm);
}

.doc-feedback-modal .submit-success-info {
    background: var(--color-gray-100);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    margin: 0 0 var(--spacing-sm);
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px var(--spacing-sm);
    font-size: 14px;
}

.doc-feedback-modal .submit-success-info dt {
    color: var(--color-gray-400);
    font-weight: 500;
}

.doc-feedback-modal .submit-success-info dd {
    margin: 0;
    color: var(--color-gray-600);
    word-break: break-all;
    white-space: pre-wrap;
}

.doc-feedback-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-xs);
}

.doc-feedback-modal .btn-submit-success-close {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.doc-feedback-modal .btn-submit-success-close:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.18);
}

.doc-feedback-modal .btn-submit-success-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.18);
}

/* 消息提示 */
.feedback-message {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sm);
    margin: 0 0 var(--spacing-md);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    font-family: var(--font-family);
    animation: docFeedbackSlideDown 0.3s ease;
    text-align: center;
}

.feedback-message.success {
    background: #E7F5E7;
    color: #1F7A1F;
    border: 1px solid var(--color-success);
}

.feedback-message.error {
    background: #FDE8E8;
    color: #C53030;
    border: 1px solid var(--color-error);
}

/* 字段级错误提示 */
.field-error-message {
    color: var(--color-error);
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-normal);
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
    line-height: var(--line-height-tight);
    font-family: var(--font-family);
    animation: docFeedbackSlideDown 0.2s ease;
}

/* 错误状态的字段样式 */
.field-error {
    border-color: var(--color-error) !important;
    box-shadow: 0 0 0 1px var(--color-error) !important;
}

.field-error:focus {
    border-color: var(--color-error) !important;
    box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.2) !important;
}

@keyframes docFeedbackSlideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .doc-feedback-modal {
        width: 95%;
        /* max-height 由 JS 动态计算，此处不再覆盖 */
    }
    
    .doc-feedback-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .doc-feedback-header h3 {
        font-size: var(--font-size-small);
    }
    
    .doc-feedback-content {
        padding: var(--spacing-lg);
    }
    
    .doc-feedback-footer {
        padding: var(--spacing-md) var(--spacing-lg);
        flex-direction: column-reverse;
    }
    
    .doc-feedback-footer .btn-cancel,
    .doc-feedback-footer .btn-submit {
        width: 100%;
        margin-bottom: var(--spacing-xs);
    }
    
    .doc-feedback-footer .btn-submit {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .doc-feedback-modal {
        width: 100%;
        border-radius: 0;
        /* max-height 由 JS 动态计算 */
    }
}

/* 滚动条样式 */
.doc-feedback-content::-webkit-scrollbar,
.selected-text-display::-webkit-scrollbar {
    width: 6px;
}

.doc-feedback-content::-webkit-scrollbar-track,
.selected-text-display::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 3px;
}

.doc-feedback-content::-webkit-scrollbar-thumb,
.selected-text-display::-webkit-scrollbar-thumb {
    background: var(--color-gray-200);
    border-radius: 3px;
}

.doc-feedback-content::-webkit-scrollbar-thumb:hover,
.selected-text-display::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-300);
}

/* 焦点状态 */
.doc-feedback-content button:focus-visible,
.doc-feedback-content select:focus-visible,
.doc-feedback-content textarea:focus-visible,
.doc-feedback-content input:focus-visible {
    outline: none;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .doc-feedback-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .doc-feedback-modal {
        border: 2px solid var(--color-gray-500);
    }
    
    .doc-feedback-content select,
    .doc-feedback-content textarea,
    .doc-feedback-content input[type="email"] {
        border-width: 2px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .doc-feedback-modal,
    .feedback-message {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    
    .doc-feedback-content *,
    .doc-feedback-footer * {
        transition-duration: 0.01ms !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .doc-feedback-modal {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .doc-feedback-header {
        background: #1a365d;
    }
    
    .selected-content .selected-text-display,
    .page-info .page-url-display {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .doc-feedback-content select,
    .doc-feedback-content textarea,
    .doc-feedback-content input[type="email"] {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .doc-feedback-content select:focus,
    .doc-feedback-content textarea:focus,
    .doc-feedback-content input[type="email"]:focus {
        border-color: var(--color-primary);
    }
    
    .doc-feedback-footer {
        background: #4a5568;
        border-color: #718096;
    }
    
    .char-count {
        color: #a0aec0;
    }
    
    .feedback-message.success {
        background: #22543d;
        color: #9ae6b4;
        border-color: #2f855a;
    }
    
    .feedback-message.error {
        background: #742a2a;
        color: #feb2b2;
        border-color: #c53030;
    }
    
    .field-error-message {
        color: #feb2b2;
    }
    
    .field-error {
        border-color: #c53030 !important;
        box-shadow: 0 0 0 1px #c53030 !important;
    }
    
    .field-error:focus {
        border-color: #c53030 !important;
        box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.3) !important;
    }
    
    .doc-feedback-footer .btn-cancel {
        background: transparent;
        color: #a0aec0;
        border-color: #718096;
    }
    
    .doc-feedback-footer .btn-cancel:hover {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #a0aec0;
    }
}

/* ================================================================================
   Document Feedback Icon Styles
   文档反馈图标样式
   ================================================================================ */

.feedback-icon {
    position: fixed;
    z-index: 2000; /* 确保在其他元素之上 */
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: auto;
    user-select: none;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.feedback-icon.visible {
    opacity: 1;
    transform: scale(1);
}

.feedback-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

.feedback-icon:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.feedback-icon img {
    width: 32px;
    height: 32px;
    transition: transform 0.2s;
    border-radius: 50%; /* 确保图片是圆形 */
}

.feedback-icon:hover img {
    transform: scale(1.05);
}

/* 工具提示 */
.feedback-icon .feedback-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 2001;
}

.feedback-icon .feedback-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.feedback-icon:hover .feedback-tooltip {
    opacity: 1;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .feedback-icon {
        width: 28px;
        height: 28px;
    }
    
    .feedback-icon img {
        width: 28px;
        height: 28px;
    }
    
    .feedback-icon .feedback-tooltip {
        font-size: 11px;
        padding: 4px 8px;
        top: -36px;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .feedback-icon {
        filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.1));
    }
    
    .feedback-icon:hover {
        filter: drop-shadow(0 6px 16px rgba(255, 255, 255, 0.15));
    }
}

/* ========================================
   Right Page Navigation Panel (右侧页面内导航)
   ======================================== */

/* 右侧页面内导航容器 - 改回固定定位 */
.on-this-page {
    width: var(--on-this-page-width); /* 使用专门的页面导航宽度 */
    background: var(--color-white); /* 背景色 */
    border-left: 1px solid var(--color-gray-200); /* 左侧边框而不是右侧 */
    /* 改回固定定位，不跟随内容滚动 */
    position: fixed;
    top: var(--header-height);
    right: 0;
    height: calc(100vh - var(--header-height));
    z-index: 99;
    padding-top: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
}

/* 如果 TOC 尚未填充，仍允许显示标题栏与 toggle（避免按钮因 display:none 消失） */
.on-this-page .on-this-page-list:empty {
    padding: 0;
    margin: 0;
}

/* 收缩状态 - 隐藏整个侧边栏 */
.on-this-page.collapsed {
    /* 折叠后：侧边栏本体完全隐藏，不占空间（正文变宽） */
    width: 0;
    height: calc(100vh - var(--header-height));
    overflow: visible; /* 允许 toggle 以 fixed 形式显示 */
    background: transparent;
    border-left: 0;
}

/* 收缩状态：保留一个“最小标题栏”承载 toggle。
   注意：把标题栏压到 height:0 在某些环境会让内部 button 的布局盒也变成 0x0（看起来像“按钮消失”）。 */
.on-this-page.collapsed .on-this-page-title {
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-bottom: 0;
    overflow: visible; /* 允许 toggle 以 fixed 形式显示 */
    background: transparent;
}

/* 收缩状态下隐藏标题文字（toggle 已移至 nav 内，不再是 title 的子元素） */
.on-this-page.collapsed .on-this-page-title {
    display: none !important;
}

.on-this-page.collapsed .on-this-page-content {
    display: none;
}

/* 移除之前的伪元素文字 */
.on-this-page.collapsed::before {
    display: none;
}

/* 折叠后：容器本体不接收点击（只剩 fixed 的 toggle 可点） */
.on-this-page.collapsed {
    pointer-events: none;
}

/* nav 仍作为顶部栏容器（标题区域固定） */
.on-this-page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

/* NOTE: collapsed 状态下按钮可见性由 `.on-this-page-toggle` 的 fixed 规则控制（单按钮方案） */

.on-this-page:not(.collapsed) .on-this-page-nav {
    display: flex;
}

.on-this-page:not(.collapsed) .on-this-page-content {
    display: block;
}

.on-this-page.collapsed .on-this-page-nav,
.on-this-page.collapsed .on-this-page-content {
    display: none;
}

/* 移除之前的伪元素文字 */
.on-this-page.collapsed::before {
    display: none;
}

/* TOC标题 - 固定在顶部不滚动 */
.on-this-page-title {
    font-size: var(--font-size-h5);
    color: var(--color-gray-500);
    margin: 0;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
    border-bottom: 2px solid var(--color-secondary);
    background: var(--color-white);
    flex-shrink: 0;
    height: var(--toc-title-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 为切换按钮腾出空间 */
    white-space: nowrap;
    overflow: hidden;
    /* 移除 position: relative，避免创建层叠上下文遮挡提示框 */
}

/* 右侧标题栏与左侧目录标题对齐（结构不同：右侧 title 在 nav 内） */
.on-this-page-nav {
    height: var(--toc-title-height);
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
    border-bottom: 2px solid var(--color-secondary);
    background: var(--color-white);
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 移除 position: relative，避免创建层叠上下文遮挡提示框 */
}

/* 标题文本样式保持与左侧一致（仅负责文字本身） */
.on-this-page-title {
    padding: 0;
    border: 0;
    background: transparent;
    height: auto;
    min-height: 0;
}

/* 展开状态下显示标题文字 */
.on-this-page:not(.collapsed) .on-this-page-title {
    font-size: var(--font-size-h5); /* 恢复正常字体大小 */
}

/* 切换按钮（移远主题 icon button） */
.on-this-page-toggle {
    /* Layout */
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;

    /* Visual - 移除边框、背景，只保留图标 */
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--color-primary); /* SVG uses currentColor */
    box-shadow: none;

    /* Interaction */
    cursor: pointer;
    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast),
        color var(--transition-fast);
}

.on-this-page-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* When the icon is an image (standalone themed SVG) */
.on-this-page-toggle img {
    width: 24px;
    height: 24px;
    display: block;
    /* 默认不旋转；用水平翻转表现“展开/收起”方向 */
    transform: none;
    transition: none;
}

/* Rotate icon when the page navigation is collapsed */
/* 1) Fallback if JS ever adds body.on-this-page-collapsed */
body.on-this-page-collapsed .on-this-page-toggle img {
    transform: scaleX(-1);
}

/* 2) Robust selector for current DOM (header contains button; `.on-this-page` is a sibling) */
body:has(.on-this-page.collapsed) .quectel-content-header .on-this-page-toggle img {
    transform: scaleX(-1);
}

/* 双保险：避免图标被其它规则意外隐藏 */
.on-this-page-toggle,
.on-this-page-toggle svg {
    opacity: 1 !important;
    visibility: visible !important;
}

.on-this-page-toggle img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 展开时：顶层按钮隐藏，不需要恢复成 static（这里保留空规则以明确意图） */

.on-this-page-toggle:hover {
    opacity: 0.7;
    color: var(--color-primary-dark);
}

.on-this-page-toggle:active {
    transform: translateY(1px);
    opacity: 0.5;
}

.on-this-page-toggle:focus-visible {
    outline: 2px solid rgba(0, 102, 204, 0.4);
    outline-offset: 2px;
}

/* 图标动效（保留旋转逻辑；不再覆盖图标尺寸） */
.on-this-page-toggle svg {
    transition: none;
}

/* 收缩状态的图标翻转（不要旋转，直接左右翻转 180°） */
.on-this-page.collapsed ~ .on-this-page-toggle svg {
    transform: scaleX(-1);
}

/* TOC内容区域 - 只有内容可滚动，标题固定 */
.on-this-page-content {
    flex: 1;
    overflow-y: visible;
    min-height: 0;
    position: relative; /* 创建层叠上下文 */
    z-index: 20; /* 高于标题栏的 z-index: 10 */
    /* 移除padding，让内部的列表自己处理 */
}

/* 收缩状态下隐藏内容 */
.on-this-page.collapsed .on-this-page-content {
    opacity: 0;
    overflow: hidden;
}

/* TOC列表 - 添加适当的padding */
.on-this-page-list {
    list-style: none;
    margin: 0;
    padding: var(--spacing-sm) 0 var(--spacing-md); /* 上下padding保留，左右由链接控制 */
}

/* Nested list styling (mirror left `.quectel-toc ul ul`) */
.on-this-page-list ul {
    margin-left: 12px; /* 与左侧完全一致的嵌套缩进 */
    padding: 0;
    list-style: none;
    transition: all var(--transition-fast);
}

/* Collapse/expand children (mirror left `.quectel-toc li:not(.expanded) > ul`) */
.on-this-page-item:not(.expanded) > ul {
    display: none;
}

.on-this-page-item.expanded > ul {
    display: block;
}

/* 智能折叠：添加平滑过渡效果 */
.on-this-page-item > ul {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.on-this-page-item.expanded > ul {
    max-height: 2000px; /* 足够大的值以容纳所有子项 */
    opacity: 1;
}

/* 智能折叠：非激活路径上的项目添加折叠样式 */
.on-this-page-item.auto-collapsed > ul {
    display: none;
    max-height: 0;
    opacity: 0;
}

/* 智能折叠：激活路径上的项目自动展开 */
.on-this-page-item.active-path > .on-this-page-link {
    /* 确保激活路径上的项目链接可见 */
    opacity: 1;
}

.on-this-page-item.active-path > ul {
    display: block;
    max-height: 2000px;
    opacity: 1;
}

/* TOC列表项 */
.on-this-page-item {
    margin: 0;
}

/* 右侧链接/层级/状态：完全遵循左侧 `.quectel-toc a` 体系 */
.on-this-page-link {
    display: flex;
    align-items: center;
    padding: 6px var(--spacing-lg); /* 与标题相同的左右padding */
    color: var(--color-gray-400);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    font-size: var(--font-size-small);
    line-height: 1.3;
    min-width: 0; /* 允许flex子元素收缩 */
    position: relative; /* 为绝对定位的提示框提供定位上下文 */
}

/* Right TOC arrow/spacer - 完全与左侧一致的样式 */
.on-this-page-link .toc-toggle {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin-right: 0.25rem !important; /* 与左侧一致：4px */
    margin-left: -20px !important; /* 与左侧一致：箭头16px + 间距4px = 20px */
    vertical-align: middle !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
    cursor: pointer !important;
    color: var(--color-gray-600) !important;
}

.on-this-page-link .toc-spacer {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin-right: 0.25rem !important; /* 与左侧一致：4px */
    margin-left: -20px !important; /* 与左侧一致：箭头16px + 间距4px = 20px */
    vertical-align: middle !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
}

.on-this-page-link:hover .toc-toggle {
    color: var(--color-secondary) !important;
}

/* Arrow direction: collapsed points right; expanded points down (like a tree) */
.on-this-page-item.expanded > .on-this-page-link .toc-toggle {
    transform: rotate(90deg);
}

/* Keep injected text span from shrinking weirdly */
.on-this-page-link-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* 悬停效果 - 白底红字（与左侧一致） */
.on-this-page-link:hover {
    background: var(--color-white);
    color: var(--color-secondary);
}

/* 悬停时显示完整文字的浮窗提示 - 使用 fixed 定位在页面最上层 */
.on-this-page-link[data-overflow="true"]:hover::after {
    content: attr(data-title);
    position: fixed; /* 固定定位，不受父容器限制 */
    /* 位置将通过 CSS 变量动态设置，或者使用默认值 */
    left: auto;
    right: calc(var(--on-this-page-width) + 8px); /* 默认在右侧边栏左边 */
    top: var(--tooltip-top, 100px); /* 通过 CSS 变量设置，默认 100px */
    background: var(--color-gray-500);
    color: var(--color-white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: normal;
    word-wrap: break-word;
    max-width: 220px;
    font-size: var(--font-size-small);
    line-height: 1.4;
    z-index: 99999; /* 最高层级 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* 当前激活项 - 白底红字（与左侧 `.quectel-toc a.current` 一致） */
.on-this-page-link.active {
    background: var(--color-white) !important;
    color: var(--color-secondary) !important;
    font-weight: var(--font-weight-medium);
}

/* 层级缩进：完全使用 margin-left 嵌套实现，与左侧一致 */
/* 所有链接使用统一的 padding: 6px var(--spacing-lg) */
/* 层级通过 .on-this-page-list ul { margin-left: 12px } 的嵌套自然体现 */


/* 取消右侧 TOC 自身滚动条，改为随内容自然展开 */
.on-this-page-content {
    overflow-y: visible;
    scrollbar-width: none;
}

.on-this-page-content::-webkit-scrollbar {
    display: none;
}

.on-this-page-content::-webkit-scrollbar-track {
    background: var(--color-gray-100); /* 使用浅灰色背景，与侧边栏背景一致 */
    border-radius: 4px;
}

.on-this-page-content::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 4px;
    border: 2px solid var(--color-gray-100); /* 添加边框使滚动条与背景有区分 */
}

.on-this-page-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
    border-color: var(--color-gray-200);
}

/* 移除右侧 TOC 旧的“左边框+位移”交互规则，保持与左侧一致的简单 hover/current */

/* 响应式设计 - 统一的响应式布局规则 */
@media (max-width: 1200px) {
    .on-this-page {
        display: none;
    }
    
    /* 调整内容头部在没有右侧边栏时的位置 */
    .quectel-content-header {
        right: 0;
    }
    
    /* 调整主内容区域 */
    .quectel-main {
        margin-right: 0;
    }
}

/* 当右侧边栏收缩时，调整主内容区域的右侧间距 */
/* 
   JavaScript需要在切换收缩状态时同步更新相关类名
*/
/* 方法1：通过body上的类名控制 */
body.on-this-page-collapsed .quectel-main {
    margin-right: 0; /* 侧边栏完全隐藏，不需要预留空间 */
}

/* 方法2：直接在main上添加类名 */
.quectel-main.collapsed {
    margin-right: 0; /* 侧边栏完全隐藏，不需要预留空间 */
}

/* 方法3：使用:has选择器（现代浏览器支持） */
body:has(.on-this-page.collapsed) .quectel-main {
    margin-right: 0; /* 侧边栏完全隐藏，不需要预留空间 */
}

/* 平板设备 */
@media (max-width: 768px) {
    /* 平板设备仍然隐藏右侧边栏 */
    .on-this-page {
        display: none;
    }
    
    .quectel-main {
        margin-right: 0;
    }
    
    /* 移动端左侧目录使用抽屉(off-canvas)模式：
       侧边栏默认 translateX(-100%) 隐藏，仅在 .open 时显示。
       因此这里不要再通过 margin-left 强行给侧边栏预留空间，否则会造成“看起来没隐藏”。 */
    .quectel-contents {
        width: calc(var(--contents-width) - 50px); /* 小屏稍微窄一点（不影响隐藏/显示机制） */
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .on-this-page {
        display: none;
    }
    
    .quectel-main {
        margin-right: 0;
    }
    
    /* 手机端仍然使用抽屉(off-canvas)模式，仅调整抽屉宽度 */
    .quectel-contents {
        width: 250px;
    }
}

/* 滚动条样式 */
.on-this-page-content::-webkit-scrollbar {
    display: none;
}

.on-this-page-content::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 2px;
}

.on-this-page-content::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 2px;
    transition: background var(--transition-fast);
}

.on-this-page-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* 页面内导航动画效果 */
.on-this-page {
    transition: width var(--transition-normal), opacity var(--transition-normal);
}

/* 收缩/展开动画 */
.on-this-page-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.on-this-page-title {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Video Preview Styling - 视频预览样式
   ======================================== */

/* 视频容器 */
.video-container {
    position: relative;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-gray-100);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow var(--transition-normal);
}

.video-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 视频元素 */
.video-container video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}

/* 视频控制栏自定义 */
.video-container video::-webkit-media-controls-panel {
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* 视频标题/说明 */
.video-caption {
    padding: 12px 16px;
    font-size: var(--font-size-small);
    color: var(--color-gray-400);
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    text-align: center;
}

.video-caption strong {
    color: var(--color-gray-500);
    font-weight: 500;
}

/* 视频预览框（用于嵌入的 HTML5 视频） */
.video-preview {
    position: relative;
    display: block;
    margin: 24px 0;
    border-radius: 12px;  /* 强制圆角 */
    overflow: hidden;
    background: transparent;  /* 透明背景，无边框效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);  /* 增强阴影 */
    transition: transform 600ms ease;  /* 只保留 transform 过渡用于播放时的放大 */
    text-decoration: none;
}

/* HTML5 video 元素样式 */
.video-preview video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    cursor: pointer;
    pointer-events: auto;
    border-radius: 12px;  /* 强制圆角 */
}

/* 禁用视频下载按钮 */
.video-preview video::-webkit-media-controls-download-button {
    display: none !important;  /* 隐藏下载按钮 */
}

.video-preview video::-moz-media-controls-download-button {
    display: none !important;  /* Firefox 下载按钮 */
}

/* 禁用画中画按钮 */
.video-preview video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;  /* 隐藏画中画按钮 */
}

.video-preview video::-moz-media-controls-picture-in-picture-button {
    display: none !important;  /* Firefox 画中画按钮 */
}

/* 通过 CSS 禁用画中画功能 */
.video-preview video {
    -webkit-appearance: none;
    appearance: none;
}

.video-preview video::-webkit-media-controls-enclosure {
    overflow: hidden !important;
}

.video-preview video::-webkit-media-controls {
    overflow: hidden !important;
}

/* 播放图标覆盖层（视频未播放时显示） */
.video-preview::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(227, 30, 36, 0.95);  /* Quectel 红色 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;  /* 默认显示播放按钮 */
    transition: opacity 400ms ease;
    z-index: 10;
}

/* 播放图标三角形 */
.video-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-42%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 26px;
    border-color: transparent transparent transparent #fff;
    pointer-events: none;
    opacity: 1;  /* 默认显示播放按钮 */
    transition: opacity 400ms ease;
    z-index: 11;
}

/* 视频播放时隐藏播放图标 */
.video-preview.playing::before,
.video-preview.playing::after {
    opacity: 0;
    visibility: hidden;  /* 确保完全不可见 */
}

/* 模态框视频播放器样式 */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.video-modal-overlay .video-preview {
    cursor: auto;
    margin: 0;
    max-width: 90vw;
    max-height: 90vh;
}

.video-modal-overlay .video-preview video {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
}

/* 模态框中的视频始终不显示播放按钮（因为自动播放） */
.video-modal-overlay .video-preview::before,
.video-modal-overlay .video-preview::after {
    display: none !important;
}

/* 视频说明文字 - 隐藏文件名底部显示 */
.video-caption {
    display: none;  /* 完全隐藏标题栏 */
}

/* 如果需要保留但隐藏文件名，使用以下替代方案 */
/*
.video-caption {
    padding: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}
*/


/* 视频预览图 */
.video-preview-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.video-preview-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 播放按钮覆盖层 */
.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background var(--transition-normal);
}

.video-preview:hover .video-preview-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* 播放按钮图标 */
.video-preview-play-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.video-preview:hover .video-preview-play-icon {
    background: var(--color-white);
    transform: scale(1.1);
}

.video-preview-play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent var(--color-primary);
    margin-left: 5px;
}

/* 视频信息栏 */
.video-preview-info {
    padding: 16px;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
}

.video-preview-title {
    margin: 0 0 8px 0;
    font-size: var(--font-size-body);
    font-weight: 500;
    color: var(--color-gray-500);
    line-height: 1.5;
}

.video-preview-description {
    margin: 0;
    font-size: var(--font-size-small);
    color: var(--color-gray-400);
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-container,
    .video-preview {
        margin: 16px 0;
        border-radius: 4px;
    }
    
    .video-caption,
    .video-preview-info {
        padding: 12px;
    }
    
    .video-preview-play-icon {
        width: 60px;
        height: 60px;
    }
    
    .video-preview-play-icon::before {
        border-width: 12px 0 12px 20px;
        margin-left: 4px;
    }
}

/* ========================================
   Grid Layout Card Styling - Quectel Official Style
   完全参考移远官网视频网格样式
   ======================================== */

/* Grid 容器 */
.sd-container-fluid .sd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 64px 0 32px 0;
}

/* ========================================
   Grid 布局样式 - 仅负责布局，不添加装饰
   ======================================== */

/* Grid 列宽控制 - 这是布局核心功能 */
/* 特定列宽 - 手动指定（考虑 gap: 24px）*/
/* 简化方案：所有列统一减去 gap 的一半 (24px / 2 = 12px) */
/* 对于特殊的 3 列布局(sd-col-4)，需要减 16px (48px / 3) */
.sd-col-1 { flex: 0 0 calc(8.333333% - 12px) !important; max-width: calc(8.333333% - 12px); }
.sd-col-2 { flex: 0 0 calc(16.666667% - 12px) !important; max-width: calc(16.666667% - 12px); }
.sd-col-3 { flex: 0 0 calc(25% - 12px) !important; max-width: calc(25% - 12px); }
.sd-col-4 { flex: 0 0 calc(33.333333% - 16px) !important; max-width: calc(33.333333% - 16px); }
.sd-col-5 { flex: 0 0 calc(41.666667% - 12px) !important; max-width: calc(41.666667% - 12px); }
.sd-col-6 { flex: 0 0 calc(50% - 12px) !important; max-width: calc(50% - 12px); }
.sd-col-7 { flex: 0 0 calc(58.333333% - 12px) !important; max-width: calc(58.333333% - 12px); }
.sd-col-8 { flex: 0 0 calc(66.666667% - 12px) !important; max-width: calc(66.666667% - 12px); }
.sd-col-9 { flex: 0 0 calc(75% - 12px) !important; max-width: calc(75% - 12px); }
.sd-col-10 { flex: 0 0 calc(83.333333% - 12px) !important; max-width: calc(83.333333% - 12px); }
.sd-col-11 { flex: 0 0 calc(91.666667% - 12px) !important; max-width: calc(91.666667% - 12px); }
.sd-col-12 { flex: 0 0 100% !important; max-width: 100%; }

/* Grid Item 列 - 仅布局 */
.sd-col {
    display: block; /* 改为 block，不使用 flex，避免影响内容布局 */
    /* 移除所有装饰性样式，只保留布局 */
}

/* 移除之前的卡片装饰样式 */
/* Grid 不应该有阴影、边框、背景等装饰 */
/* 如果需要卡片效果，应在内容中使用 sd-card 指令 */

/* 确保等高布局 - 这是布局功能，保留 */
.sd-row {
    align-items: stretch;
}

/* 移除这个规则，因为它会覆盖 .sd-col-{n} 的 flex 设置 */
/* .sd-row .sd-col {
    display: flex;
} */

/* 响应式设计 - 仅调整布局间距 */
@media (max-width: 768px) {
    .sd-container-fluid .sd-row {
        gap: 16px;
        margin: 32px 0 16px 0;
    }
}
