/* ================================================================
   Google Antigravity 官方风格中文文档中心样式表
   ================================================================ */

.ag-docs-shell {
    --ag-bg: #121317;
    --ag-surface: #18191d;
    --ag-surface-elevated: #1e2027;
    --ag-surface-hover: rgba(255, 255, 255, 0.05);
    --ag-border: rgba(255, 255, 255, 0.1);
    --ag-border-subtle: rgba(255, 255, 255, 0.06);
    --ag-text: #e8eaed;
    --ag-text-body: #cdd4dc;
    --ag-text-muted: #9aa0a6;
    --ag-accent: #8ab4f8;
    --ag-accent-strong: #3279f9;
    --ag-accent-bg: rgba(50, 121, 249, 0.14);
    --ag-code-bg: #181a20;
    --ag-nav-offset: 73px;
    --ag-subnav-height: 52px;

    background: var(--ag-bg);
    color: var(--ag-text);
    min-height: 100vh;
    padding-top: var(--ag-nav-offset);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 覆盖 site.css 全局标签样式泄漏 */
.ag-docs-shell h1,
.ag-docs-shell h2,
.ag-docs-shell h3,
.ag-docs-shell h4 {
    background: none !important;
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: currentColor !important;
    background-clip: border-box !important;
    color: var(--ag-text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ag-docs-shell p {
    color: var(--ag-text-body);
}

.ag-docs-shell a {
    color: var(--ag-accent);
    text-decoration: none;
}

/* ==================== 顶部文档二级菜单栏 ==================== */
.ag-docs-subnav {
    position: sticky;
    top: var(--ag-nav-offset);
    z-index: 90;
    height: var(--ag-subnav-height);
    background: rgba(18, 19, 23, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ag-border);
}

.ag-docs-subnav-inner {
    max-width: 1480px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ag-docs-subnav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    height: 100%;
    flex: 1;
}

.ag-mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--ag-border);
    background: var(--ag-surface);
    color: var(--ag-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
}

.ag-docs-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.ag-docs-tabs::-webkit-scrollbar {
    display: none;
}

.ag-docs-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ag-text-muted) !important;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.ag-docs-tab:hover {
    color: var(--ag-text) !important;
}

.ag-docs-tab.is-active {
    color: var(--ag-text) !important;
    font-weight: 600;
}

.ag-docs-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0;
    height: 2px;
    background: var(--ag-accent-strong);
    border-radius: 2px 2px 0 0;
}

.ag-docs-tab.is-secondary {
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--ag-border-subtle);
}

/* 搜索框 */
.ag-docs-search-wrap {
    position: relative;
    width: 260px;
    flex-shrink: 0;
}

.ag-docs-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ag-docs-search-box:focus-within {
    border-color: var(--ag-accent-strong);
    box-shadow: 0 0 0 3px rgba(50, 121, 249, 0.18);
}

.ag-docs-search-icon {
    color: var(--ag-text-muted);
    flex-shrink: 0;
}

.ag-docs-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ag-text);
    font-size: 0.85rem;
}

.ag-docs-search-input::placeholder {
    color: var(--ag-text-muted);
}

.ag-docs-search-kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    color: var(--ag-text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ag-border);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    flex-shrink: 0;
}

.ag-docs-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    max-height: 440px;
    overflow-y: auto;
    background: #1b1d23;
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    padding: 0.4rem;
    z-index: 120;
    display: none;
}

.ag-docs-search-results.is-open {
    display: block;
}

.ag-search-item {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.ag-search-item:hover {
    background: var(--ag-accent-bg);
}

.ag-search-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ag-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ag-search-item-sec {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ag-accent);
    background: rgba(138, 180, 248, 0.12);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.ag-search-item-desc {
    font-size: 0.78rem;
    color: var(--ag-text-muted);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-search-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ag-text-muted);
}

/* ==================== 三栏主体网格 ==================== */
.ag-docs-grid {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr) 232px;
    gap: 2.25rem;
    align-items: start;
}

/* ==================== 左侧边栏 ==================== */
.ag-docs-sidebar {
    position: sticky;
    top: calc(var(--ag-nav-offset) + var(--ag-subnav-height) + 1px);
    height: calc(100vh - var(--ag-nav-offset) - var(--ag-subnav-height) - 1px);
    overflow-y: auto;
    padding: 1.5rem 0.75rem 3rem 0;
    border-right: 1px solid var(--ag-border-subtle);
}

.ag-docs-sidebar::-webkit-scrollbar {
    width: 5px;
}

.ag-docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.ag-sidebar-section-switch {
    display: none;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ag-border-subtle);
}

.ag-sidebar-group {
    margin-bottom: 1.35rem;
}

.ag-sidebar-heading {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ag-text-muted) !important;
    padding: 0 0.75rem;
    margin-bottom: 0.45rem !important;
}

.ag-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ag-sidebar-item {
    margin: 0.12rem 0;
}

.ag-sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.42rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--ag-text-body) !important;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.ag-sidebar-link:hover {
    background: var(--ag-surface-hover);
    color: var(--ag-text) !important;
}

.ag-sidebar-link.is-active {
    background: var(--ag-accent-bg);
    color: var(--ag-accent) !important;
    border-left-color: var(--ag-accent-strong);
    font-weight: 600;
}

/* 可折叠子分组 */
.ag-sidebar-details {
    margin: 0.25rem 0;
}

.ag-sidebar-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.42rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ag-text);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

.ag-sidebar-summary::-webkit-details-marker {
    display: none;
}

.ag-sidebar-summary:hover {
    background: var(--ag-surface-hover);
}

.ag-sidebar-chevron {
    width: 15px;
    height: 15px;
    color: var(--ag-text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ag-sidebar-details[open] > .ag-sidebar-summary .ag-sidebar-chevron {
    transform: rotate(90deg);
    color: var(--ag-accent);
}

.ag-sidebar-sublist {
    list-style: none;
    margin: 0.15rem 0 0.35rem 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--ag-border-subtle);
}

/* ==================== 中间正文区域 ==================== */
.ag-docs-main {
    min-width: 0;
    padding: 1.75rem 0 4.5rem;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

.ag-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--ag-text-muted);
    margin-bottom: 1rem;
}

.ag-breadcrumbs a {
    color: var(--ag-text-muted);
}

.ag-breadcrumbs a:hover {
    color: var(--ag-accent);
}

.ag-breadcrumbs-sep {
    opacity: 0.55;
    font-size: 0.8rem;
}

.ag-breadcrumbs-current {
    color: var(--ag-text);
    font-weight: 500;
}

.ag-doc-title {
    font-size: clamp(1.75rem, 2.6vw, 2.35rem) !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 1rem !important;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ag-border-subtle);
}

.ag-mobile-toc {
    display: none;
    margin-bottom: 1.5rem;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 10px;
}

.ag-mobile-toc summary {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ag-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
}

.ag-mobile-toc summary::-webkit-details-marker {
    display: none;
}

.ag-mobile-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 1rem 0.85rem;
    border-top: 1px solid var(--ag-border-subtle);
}

.ag-mobile-toc-list li {
    margin-top: 0.4rem;
}

.ag-mobile-toc-list a {
    font-size: 0.85rem;
    color: var(--ag-text-muted);
}

/* ==================== 官方 Starlight Markdown 排版与组件 ==================== */
.sl-markdown-content {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--ag-text-body);
    overflow-wrap: anywhere;
}

.sl-markdown-content > :first-child {
    margin-top: 0;
}

.sl-markdown-content h2 {
    font-size: 1.48rem !important;
    font-weight: 600 !important;
    margin-top: 2.4rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--ag-border-subtle);
    scroll-margin-top: calc(var(--ag-nav-offset) + var(--ag-subnav-height) + 20px);
}

.sl-markdown-content h3 {
    font-size: 1.18rem !important;
    font-weight: 600 !important;
    margin-top: 1.75rem;
    margin-bottom: 0.65rem;
    scroll-margin-top: calc(var(--ag-nav-offset) + var(--ag-subnav-height) + 20px);
}

.sl-markdown-content h4 {
    font-size: 1.02rem !important;
    font-weight: 600 !important;
    margin-top: 1.35rem;
    margin-bottom: 0.5rem;
}

.sl-markdown-content p {
    margin: 0 0 1rem;
    color: var(--ag-text-body);
    line-height: 1.75;
}

.sl-markdown-content a {
    color: var(--ag-accent);
    text-decoration: underline;
    text-decoration-color: rgba(138, 180, 248, 0.35);
    text-underline-offset: 3px;
}

.sl-markdown-content a:hover {
    color: #aecbfa;
    text-decoration-color: currentColor;
}

.sl-markdown-content ul,
.sl-markdown-content ol {
    margin: 0 0 1.15rem;
    padding-left: 1.5rem;
}

.sl-markdown-content li {
    margin-bottom: 0.45rem;
}

.sl-markdown-content li > ul,
.sl-markdown-content li > ol {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}

.sl-markdown-content strong {
    color: #ffffff;
    font-weight: 600;
}

.sl-markdown-content hr {
    border: none;
    border-top: 1px solid var(--ag-border-subtle);
    margin: 2rem 0;
}

/* 图片与视频（绝不溢出） */
.sl-markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--ag-border);
    margin: 1.25rem 0;
    display: block;
    background: var(--ag-surface);
    cursor: zoom-in;
}

.sl-markdown-content video {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--ag-border);
    margin: 1.25rem 0;
    background: #0d0e12;
}

.sl-markdown-content figure {
    margin: 1.5rem 0;
}

.sl-markdown-content figcaption {
    font-size: 0.85rem;
    color: var(--ag-text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* 行内代码与代码块 */
.sl-markdown-content code:not(pre code) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.86em;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eaed;
    padding: 0.14rem 0.4rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sl-markdown-content .expressive-code {
    margin: 1.25rem 0;
}

.sl-markdown-content .expressive-code figure {
    margin: 0;
    background: var(--ag-code-bg);
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    overflow: hidden;
}

.sl-markdown-content .expressive-code .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--ag-border-subtle);
    font-size: 0.78rem;
    color: var(--ag-text-muted);
}

.sl-markdown-content .expressive-code .header:empty {
    display: none;
}

.sl-markdown-content pre {
    position: relative;
    background: var(--ag-code-bg);
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin: 1.25rem 0;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.sl-markdown-content .expressive-code pre {
    margin: 0;
    border: none;
    border-radius: 0;
}

.sl-markdown-content pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #e8eaed;
    background: transparent;
    border: none;
    padding: 0;
    white-space: pre;
}

/* expressive-code 自带 copy 区域保留或注入统一复制按钮 */
.sl-markdown-content .expressive-code .copy {
    display: none;
}

.ag-copy-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--ag-border);
    background: rgba(24, 25, 29, 0.9);
    color: var(--ag-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sl-markdown-content pre:hover .ag-copy-btn,
.ag-copy-btn:focus-visible {
    opacity: 1;
}

.ag-copy-btn:hover {
    color: var(--ag-accent);
    border-color: var(--ag-accent-strong);
}

/* Starlight Aside 提示框 */
.starlight-aside {
    margin: 1.35rem 0;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    border: 1px solid var(--ag-border);
    border-left-width: 4px;
    background: var(--ag-surface);
}

.starlight-aside--note {
    border-left-color: #3279f9;
    background: rgba(50, 121, 249, 0.08);
}

.starlight-aside--tip {
    border-left-color: #34a853;
    background: rgba(52, 168, 83, 0.08);
}

.starlight-aside--caution {
    border-left-color: #fbbc04;
    background: rgba(251, 188, 4, 0.08);
}

.starlight-aside--danger {
    border-left-color: #ea4335;
    background: rgba(234, 67, 53, 0.08);
}

.starlight-aside__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff !important;
    margin-bottom: 0.45rem !important;
}

.starlight-aside__title svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.starlight-aside__content > :last-child {
    margin-bottom: 0;
}

/* Blockquote */
.sl-markdown-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1.15rem;
    border-left: 3px solid var(--ag-accent-strong);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 8px 8px 0;
    color: var(--ag-text-muted);
}

.sl-markdown-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 表格防溢出 */
.sl-markdown-content .table-scroll,
.sl-markdown-content .table-container {
    width: 100%;
    overflow-x: auto;
    margin: 1.35rem 0;
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    background: var(--ag-surface);
}

.sl-markdown-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.25rem 0;
    display: block;
    overflow-x: auto;
}

.sl-markdown-content .table-scroll table,
.sl-markdown-content .table-container table {
    margin: 0;
    display: table;
}

.sl-markdown-content thead th {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid var(--ag-border);
}

.sl-markdown-content td,
.sl-markdown-content tbody th {
    padding: 0.65rem 0.95rem;
    border-bottom: 1px solid var(--ag-border-subtle);
    vertical-align: top;
}

.sl-markdown-content tbody tr:last-child td {
    border-bottom: none;
}

/* Starlight Tabs 切换组件 */
.sl-markdown-content starlight-tabs {
    display: block;
    margin: 1.35rem 0;
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    background: var(--ag-surface);
    overflow: hidden;
}

.sl-markdown-content starlight-tabs .tablist-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--ag-border);
    overflow-x: auto;
}

.sl-markdown-content starlight-tabs ul[role="tablist"] {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 0.5rem;
    gap: 0.25rem;
}

.sl-markdown-content starlight-tabs li.tab {
    margin: 0;
}

.sl-markdown-content starlight-tabs a[role="tab"] {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ag-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.sl-markdown-content starlight-tabs a[role="tab"][aria-selected="true"] {
    color: #ffffff;
    border-bottom-color: var(--ag-accent-strong);
}

.sl-markdown-content starlight-tabs [role="tabpanel"] {
    padding: 1.1rem 1.25rem;
}

.sl-markdown-content starlight-tabs [role="tabpanel"][hidden] {
    display: none;
}

/* 官方卡片网格、LinkCard、Steps、Pillar 等组件 */
.sl-markdown-content .card-grid,
.sl-markdown-content .pillars-grid,
.sl-markdown-content .surface-grid,
.sl-markdown-content .resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.35rem 0;
}

.sl-markdown-content .card,
.sl-markdown-content .sl-link-card,
.sl-markdown-content .pillar-card,
.sl-markdown-content .surface-card,
.sl-markdown-content .resource-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.15rem 1.25rem;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sl-markdown-content .sl-link-card:hover,
.sl-markdown-content .pillar-card:hover,
.sl-markdown-content .surface-card:hover,
.sl-markdown-content .resource-card:hover {
    border-color: var(--ag-accent-strong);
    background: var(--ag-surface-elevated);
    transform: translateY(-2px);
}

.sl-markdown-content .card .title,
.sl-markdown-content .sl-link-card .title,
.sl-markdown-content .pillar-title,
.sl-markdown-content .resource-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sl-markdown-content .sl-link-card .description,
.sl-markdown-content .pillar-desc,
.sl-markdown-content .resource-desc {
    font-size: 0.875rem;
    color: var(--ag-text-muted);
    line-height: 1.55;
}

.sl-markdown-content .sl-steps {
    list-style: none !important;
    counter-reset: sl-step;
    padding-left: 0 !important;
    margin: 1.35rem 0;
}

.sl-markdown-content .sl-steps > li {
    counter-increment: sl-step;
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 1.25rem;
    margin-bottom: 0;
}

.sl-markdown-content .sl-steps > li::before {
    content: counter(sl-step);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--ag-surface-elevated);
    border: 1px solid var(--ag-border);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sl-markdown-content .sl-steps > li::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    top: 2rem;
    bottom: 0.2rem;
    width: 1px;
    background: var(--ag-border);
}

.sl-markdown-content .sl-steps > li:last-child::after {
    display: none;
}

.sl-markdown-content kbd {
    display: inline-block;
    padding: 0.12rem 0.42rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78em;
    color: #ffffff;
    background: #23262f;
    border: 1px solid var(--ag-border);
    border-bottom-width: 2px;
    border-radius: 5px;
}

.sl-markdown-content .chip {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(138, 180, 248, 0.14);
    color: var(--ag-accent);
    border: 1px solid rgba(138, 180, 248, 0.25);
    text-decoration: none;
}

.sl-markdown-content details {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 10px;
}

.sl-markdown-content details > summary {
    cursor: pointer;
    font-weight: 600;
    color: #ffffff;
}

.sl-markdown-content .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;
}

/* ==================== 底部上一页 / 下一页 ==================== */
.ag-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ag-border-subtle);
}

.ag-page-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.ag-page-card:hover {
    border-color: var(--ag-accent-strong);
    background: var(--ag-surface-elevated);
}

.ag-page-card--next {
    text-align: right;
    grid-column: 2;
}

.ag-page-card-label {
    font-size: 0.78rem;
    color: var(--ag-text-muted);
}

.ag-page-card-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ag-text);
}

/* ==================== 右侧本页目录 (TOC) ==================== */
.ag-docs-toc {
    position: sticky;
    top: calc(var(--ag-nav-offset) + var(--ag-subnav-height) + 1px);
    max-height: calc(100vh - var(--ag-nav-offset) - var(--ag-subnav-height) - 20px);
    overflow-y: auto;
    padding: 1.75rem 0 2.5rem;
}

.ag-toc-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ag-text) !important;
    margin-bottom: 0.75rem !important;
}

.ag-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--ag-border-subtle);
}

.ag-toc-item a {
    display: block;
    padding: 0.28rem 0 0.28rem 0.85rem;
    margin-left: -1px;
    font-size: 0.81rem;
    line-height: 1.4;
    color: var(--ag-text-muted) !important;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ag-toc-item--h3 a {
    padding-left: 1.55rem;
    font-size: 0.78rem;
}

.ag-toc-item a:hover {
    color: var(--ag-text) !important;
}

.ag-toc-item a.is-active {
    color: var(--ag-accent) !important;
    border-left-color: var(--ag-accent-strong);
    font-weight: 500;
}

/* ==================== 图片灯箱与移动端抽屉遮罩 ==================== */
.ag-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 95;
}

.ag-sidebar-backdrop.is-open {
    display: block;
}

.ag-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 10, 14, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.ag-lightbox.is-open {
    display: flex;
}

.ag-lightbox img {
    max-width: 95vw;
    max-height: 92vh;
    border-radius: 10px;
    border: 1px solid var(--ag-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 1279px) {
    .ag-docs-grid {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 1.75rem;
    }

    .ag-docs-toc {
        display: none;
    }

    .ag-mobile-toc {
        display: block;
    }
}

@media (max-width: 1023px) {
    .ag-mobile-menu-btn {
        display: inline-flex;
    }

    .ag-docs-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 1rem;
    }

    .ag-docs-sidebar {
        position: fixed;
        top: calc(var(--ag-nav-offset) + var(--ag-subnav-height));
        left: 0;
        width: 290px;
        max-width: 85vw;
        height: calc(100vh - var(--ag-nav-offset) - var(--ag-subnav-height));
        background: var(--ag-surface);
        z-index: 100;
        padding: 1.25rem 0.9rem 3rem;
        border-right: 1px solid var(--ag-border);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }

    .ag-docs-sidebar.is-open {
        transform: translateX(0);
    }

    .ag-docs-search-wrap {
        width: 180px;
    }

    .ag-pagination {
        grid-template-columns: 1fr;
    }

    .ag-page-card--next {
        grid-column: 1;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .ag-docs-subnav-inner {
        padding: 0 0.85rem;
    }

    .ag-docs-search-wrap {
        width: 135px;
    }

    .ag-docs-search-kbd {
        display: none;
    }
}

/* ==================== 更新日志 (/docs/changelog) 官方样式 ==================== */
.rn-wrapper {
    margin-top: 1.5rem;
}

.rn-tab-bar {
    border-bottom: 1px solid var(--ag-border);
    margin-bottom: 1rem;
    overflow-x: auto;
}

.rn-tabs {
    display: flex;
    gap: 0.35rem;
    min-width: max-content;
}

.rn-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ag-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.rn-tab-btn:hover {
    color: var(--ag-text);
}

.rn-tab-btn.active {
    color: var(--ag-accent);
    border-bottom-color: var(--ag-accent-strong);
    font-weight: 600;
}

.rn-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border-subtle);
    border-radius: 10px;
}

.rn-rollout-text {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 !important;
    font-size: 0.84rem;
    color: var(--ag-text-muted) !important;
}

.rn-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--ag-border);
    background: var(--ag-surface-elevated);
    color: var(--ag-text);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rn-toggle-btn:hover {
    border-color: var(--ag-accent-strong);
    color: var(--ag-accent);
}

.rn-panel,
.rn-ext-panel {
    display: none;
}

.rn-panel.active,
.rn-ext-panel.active {
    display: block;
}

.rn-panel-heading {
    margin-top: 0.5rem !important;
    margin-bottom: 1.25rem !important;
}

.rn-ext-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}

.rn-ext-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rn-ext-pill {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--ag-border);
    background: var(--ag-surface);
    color: var(--ag-text-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rn-ext-pill:hover {
    border-color: var(--ag-accent);
    color: var(--ag-text);
}

.rn-ext-pill.active {
    background: var(--ag-accent-bg);
    border-color: var(--ag-accent-strong);
    color: var(--ag-accent);
    font-weight: 600;
}

.rn-ext-docs-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.84rem;
    color: var(--ag-accent);
}

.rn-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rn-row {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ag-border-subtle);
    scroll-margin-top: calc(var(--ag-nav-offset) + var(--ag-subnav-height) + 20px);
}

.rn-row:last-child {
    border-bottom: none;
}

.rn-version-col {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.rn-version-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rn-version-heading {
    margin: 0 !important;
    font-size: 1rem !important;
}

.rn-version-tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    background: rgba(138, 180, 248, 0.12);
    border: 1px solid rgba(138, 180, 248, 0.28);
    color: var(--ag-accent) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none !important;
}

.rn-latest-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(52, 168, 83, 0.16);
    border: 1px solid rgba(52, 168, 83, 0.4);
    color: #81c995;
}

.rn-date-text {
    font-size: 0.8rem;
    color: var(--ag-text-muted);
}

.rn-card {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    padding: 1.15rem 1.35rem;
}

.rn-headline {
    font-size: 1.08rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-top: 0 !important;
    margin-bottom: 0.6rem !important;
}

.rn-summary p {
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
}

.rn-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sl-markdown-content details.rn-accordion {
    margin: 0 !important;
    padding: 0.55rem 0.85rem !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid var(--ag-border-subtle) !important;
    border-radius: 8px !important;
}

.rn-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ag-text);
    cursor: pointer;
    list-style: none;
}

.rn-accordion-summary::-webkit-details-marker {
    display: none;
}

.rn-cat-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.rn-count {
    font-weight: 500;
    color: var(--ag-text-muted);
}

.rn-chevron {
    transition: transform 0.2s ease;
    color: var(--ag-text-muted);
}

details.rn-accordion[open] .rn-chevron {
    transform: rotate(180deg);
    color: var(--ag-accent);
}

.rn-list {
    margin: 0.65rem 0 0.2rem !important;
    padding-left: 1.25rem !important;
}

.rn-item {
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 0.45rem;
}

@media (max-width: 768px) {
    .rn-row {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
}


