/*
 * api-docs.css
 * 来源: api-docs.php
 */

:root {
            --bg-deep: #050508;
            --bg-panel: rgba(12, 12, 18, 0.95);
            --bg-card: rgba(20, 20, 30, 0.8);
            --bg-code: #0d0d14;
            --text-main: #e4e4e7;
            --text-muted: #71717a;
            --accent-primary: #00ff9d;
            --accent-secondary: #00d4ff;
            --border-color: rgba(0, 255, 157, 0.15);
        }
        [data-theme="light"] {
            --bg-deep: #ffffff;
            --bg-panel: rgba(255, 255, 255, 0.98);
            --bg-card: rgba(248, 250, 252, 0.9);
            --bg-code: #f1f5f9;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --accent-primary: #059669;
            --accent-secondary: #0284c7;
            --border-color: rgba(5, 150, 105, 0.15);
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Noto Sans SC', sans-serif; background: var(--bg-deep); color: var(--text-main); min-height: 100vh; font-size: 14px; }
        .font-mono { font-family: 'JetBrains Mono', monospace; }
        
        #shader-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
        
        .nav-bar { position: fixed; top: 0; width: 100%; z-index: 100; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; background: var(--bg-panel); border-bottom: 1px solid var(--border-color); backdrop-filter: blur(12px); height: 60px; }
        
        .menu-btn { display: none; padding: 0.5rem; background: transparent; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); cursor: pointer; }
        
        .btn-geek { background: transparent; border: 1px solid var(--accent-primary); color: var(--accent-primary); padding: 0.5rem 1rem; font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.3s; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); text-decoration: none; display: inline-block; }
        .btn-geek:hover { background: var(--accent-primary); color: var(--bg-deep); }
        
        .sidebar-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 199; opacity: 0; visibility: hidden; transition: all 0.3s; }
        .sidebar-overlay.active { opacity: 1; visibility: visible; }
        
        .mobile-sidebar { position: fixed; top: 0; right: -280px; width: 280px; height: 100%; background: var(--bg-panel); border-left: 1px solid var(--border-color); z-index: 200; padding: 1.5rem; transition: right 0.3s; display: flex; flex-direction: column; }
        .mobile-sidebar.open { right: 0; }
        
        @media (max-width: 768px) {
            .menu-btn { display: flex; align-items: center; gap: 0.5rem; }
        }
        
        .main-wrapper { position: relative; z-index: 10; display: flex; padding-top: 60px; min-height: 0; flex: 1; }
        
        /* 桌面端侧边栏 - 使用fixed但不覆盖底部栏 */
        .sidebar { width: 260px; background: var(--bg-panel); border-right: 1px solid var(--border-color); position: fixed; left: 0; top: 60px; bottom: 0; overflow: hidden; padding: 0.75rem; z-index: 50; display: flex; flex-direction: column; padding-bottom: 350px; }
        .sidebar .search-box { flex-shrink: 0; }
        .sidebar .sidebar-title { flex-shrink: 0; }
        .sidebar .api-list { flex: 1; overflow-y: auto; min-height: 0; }
        
        .sidebar-title { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; padding-left: 0.5rem; }
        .api-list { list-style: none; }
        .api-item { padding: 0.5rem 0.6rem; border-radius: 6px; cursor: pointer; transition: all 0.2s; margin-bottom: 0.2rem; font-size: 0.8rem; border: 1px solid transparent; display: flex; align-items: center; gap: 0.4rem; }
        .api-item:hover { background: rgba(0, 255, 157, 0.05); }
        .api-item.active { background: rgba(0, 255, 157, 0.1); border-color: var(--accent-primary); }
        .api-item .method-tags { display: flex; gap: 2px; flex-shrink: 0; }
        .api-item .method { font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
        .api-item .method.get { background: rgba(16, 185, 129, 0.2); color: #10b981; }
        .api-item .method.post { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
        .api-item .api-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        
        .content { flex: 1; margin-left: 260px; padding: 1rem; max-width: 100%; overflow-x: hidden; }
        
        /* 搜索框 */
        .search-box { margin-bottom: 0.75rem; position: relative; }
        .search-input { width: 100%; padding: 0.5rem 0.6rem 0.5rem 2rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); font-size: 0.8rem; }
        .search-input:focus { outline: none; border-color: var(--accent-primary); }
        .search-icon { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 14px; height: 14px; }
        
        /* 移动端API选择器 */
        .mobile-api-selector { display: none; position: relative; margin-bottom: 0.75rem; }
        .mobile-select-btn { width: 100%; padding: 0.6rem 0.8rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); font-size: 0.8rem; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
        
        .api-dropdown { position: relative; background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 6px; display: none; box-shadow: 0 10px 40px rgba(0,0,0,0.3); z-index: 1000; flex-direction: column; margin-top: 0.3rem; }
        .api-dropdown.open { display: flex; }
        .api-dropdown-search { padding: 0.5rem; border-bottom: 1px solid var(--border-color); background: var(--bg-panel); flex-shrink: 0; }
        .api-dropdown-search input { width: 100%; padding: 0.4rem 0.6rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-main); font-size: 0.75rem; }
        .api-dropdown-list { padding: 0.3rem; overflow-y: auto; flex: 1; min-height: 0; max-height: 200px; }
        .api-dropdown-item { padding: 0.5rem 0.6rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; gap: 0.4rem; }
        .api-dropdown-item:hover { background: rgba(0, 255, 157, 0.05); }
        .api-dropdown-item.active { background: rgba(0, 255, 157, 0.1); }
        .api-dropdown-item .method-tags { display: flex; gap: 2px; flex-shrink: 0; }
        .api-dropdown-item .method { font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
        .api-dropdown-item .method.get { background: rgba(16, 185, 129, 0.2); color: #10b981; }
        .api-dropdown-item .method.post { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
        
        @media (max-width: 768px) {
            .sidebar { display: none; }
            .content { margin-left: 0; padding: 0.75rem; }
            .mobile-api-selector { display: block; }
        }
        
        /* 文档样式 - 未选API时区域紧凑，便于底部露出 */
        .doc-container { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; overflow-x: hidden; min-height: 0; }
        .doc-header { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-color); }
        .doc-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
        .doc-endpoint { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; background: rgba(0, 255, 157, 0.08); border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; word-break: break-all; }
        
        /* Markdown样式 - 移动端适配 */
        .markdown-body { line-height: 1.7; color: var(--text-muted); font-size: 0.85rem; overflow-x: hidden; }
        .markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--text-main); margin: 1rem 0 0.5rem; }
        .markdown-body h2 { font-size: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; }
        .markdown-body h3 { font-size: 0.9rem; }
        .markdown-body p { margin-bottom: 0.75rem; }
        .markdown-body pre { background: var(--bg-code); padding: 0.75rem; border-radius: 6px; overflow-x: auto; margin: 0.75rem 0; border: 1px solid var(--border-color); font-size: 0.75rem; position: relative; }
        .markdown-body code { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }
        .markdown-body pre code { background: none; padding: 0; }
        
        /* 代码复制按钮 */
        .code-block-wrapper { position: relative; }
        .copy-code-btn {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            padding: 0.3rem 0.6rem;
            background: rgba(0, 255, 157, 0.1);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            color: var(--accent-primary);
            font-size: 0.7rem;
            cursor: pointer;
            opacity: 0;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            z-index: 10;
        }
        .markdown-body pre:hover .copy-code-btn,
        .copy-code-btn:hover {
            opacity: 1;
        }
        .copy-code-btn:hover {
            background: rgba(0, 255, 157, 0.2);
        }
        .copy-code-btn.copied {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
            opacity: 1;
        }
        .markdown-body :not(pre) > code { background: rgba(0, 255, 157, 0.1); padding: 0.1rem 0.3rem; border-radius: 3px; color: var(--accent-secondary); }
        .markdown-body table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.75rem; display: block; overflow-x: auto; }
        .markdown-body th, .markdown-body td { border: 1px solid var(--border-color); padding: 0.4rem; text-align: left; min-width: 80px; }
        .markdown-body th { background: var(--bg-code); color: var(--text-main); }
        .markdown-body ul, .markdown-body ol { padding-left: 1.2rem; margin: 0.5rem 0; }
        .markdown-body blockquote { border-left: 3px solid var(--accent-primary); padding-left: 0.75rem; margin: 0.75rem 0; color: var(--text-muted); }
        
        /* 代码高亮增强 */
        .hljs { background: transparent !important; padding: 0 !important; }
        .hljs-keyword { color: #c678dd; }
        .hljs-string { color: #98c379; }
        .hljs-number { color: #d19a66; }
        .hljs-function { color: #61afef; }
        .hljs-comment { color: #5c6370; font-style: italic; }
        .hljs-variable { color: #e06c75; }
        .hljs-built_in { color: #e6c07b; }
        .hljs-title { color: #61afef; }
        .hljs-params { color: #abb2bf; }
        .hljs-attr { color: #d19a66; }
        .hljs-literal { color: #56b6c2; }
        
        .no-api { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
        
        .theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color); background: transparent; color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; flex-shrink: 0; }
        .theme-toggle:hover { background: rgba(255,255,255,0.1); color: var(--accent-primary); border-color: var(--accent-primary); }
        
        footer { border-top: 1px solid var(--border-color); background: var(--bg-panel); padding-top: 3rem; padding-bottom: 1.5rem; margin-top: auto; position: relative; z-index: 10; flex-shrink: 0; width: 100%; }
        
        /* 底部栏贴底布局 - 全端通用 */
        body { display: flex; flex-direction: column; min-height: 100vh; }
        .main-wrapper { flex: 1; display: flex; }
        
        /* 友情链接样式 */
        .footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
        .footer-links a:hover { color: var(--accent-primary); }
        .beian-link { color: var(--text-muted); text-decoration: none; transition: color 0.2s; display: inline-flex; align-items: center; gap: 0.25rem; }
        .beian-link:hover { color: var(--text-main); }
        
        /* 小尺寸二维码样式 */
        .qrcode-box-small { width: 70px; height: 70px; padding: 4px; background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
        .qrcode-img-small { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
        
        /* 自定义底部栏样式 */
        .footer-custom-wrapper { width: 100%; }
        .footer-custom-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
        .footer-custom-left { flex: 1; text-align: left; min-width: 100px; }
        .footer-custom-center { flex: 1; text-align: center; min-width: 100px; }
        .footer-custom-right { flex: 1; text-align: right; min-width: 100px; }
        @media (max-width: 768px) {
            .footer-custom-grid { flex-direction: column; align-items: center; }
            .footer-custom-left, .footer-custom-center, .footer-custom-right { text-align: center; }
        }
        .footer-custom-wrapper img, .footer-custom-wrapper svg { max-height: 24px; vertical-align: middle; }
        .footer-custom-wrapper a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
        .footer-custom-wrapper a:hover { color: var(--accent-primary); }
