* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #60a5fa;
    --accent-color: #8b5cf6;
    --accent-hover: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #ffffff;
    --bg-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --bg-gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --sidebar-bg: #fafbfc;
    --sidebar-border: #e5e7eb;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    --code-bg: #f9fafb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* 顶部导航栏 - 玻璃态效果 */
.top-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 0 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.top-navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: opacity 0.2s ease;
    font-weight: 600;
}

.top-navbar-brand:hover {
    opacity: 0.8;
}

.top-navbar-brand img {
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
    border-radius: 4px;
}

.top-navbar-brand span {
    font-size: 1.1em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-navbar-menu li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 500;
}

.top-navbar-menu li a:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--text-color);
}

.top-navbar-menu li a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 主容器布局调整 */
.main-container {
    margin-top: 64px;
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Sidebar - Apifox 风格 */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 0;
    z-index: 100;
}

.nav-menu {
    padding: 12px 0;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section h3 {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-light);
    padding: 8px 24px;
    margin: 8px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-section h3:hover {
    color: var(--text-secondary);
}

.nav-section h3::after {
    content: '▼';
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.nav-section h3.collapsed::after {
    transform: rotate(-90deg);
}

.nav-section ul {
    list-style: none;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.nav-section ul.collapsed {
    max-height: 0 !important;
    opacity: 0;
}

.nav-section ul li {
    margin: 0;
}

.nav-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 8px 24px 8px 40px;
    font-size: 0.85em;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.nav-section ul li a:hover {
    background: var(--hover-bg);
    color: var(--text-color);
    border-left-color: var(--primary-color);
}

.nav-section ul li a.active {
    background: linear-gradient(90deg, #eff6ff 0%, #e0e7ff 100%);
    color: var(--primary-color);
    font-weight: 500;
    border-left-color: var(--primary-color);
}

/* 嵌套菜单 */
.nav-section .nav-section {
    margin-left: 0;
}

.nav-section .nav-section h3 {
    font-size: 0.8em;
    padding-left: 40px;
    color: var(--text-secondary);
    text-transform: none;
}

.nav-section .nav-section ul li a {
    padding-left: 56px;
    font-size: 0.8em;
}

/* Main Content - 现代化风格 */
.main-content {
    margin-left: 260px;
    flex: 1;
    background: #ffffff;
    min-height: calc(100vh - 64px);
    width: calc(100% - 260px);
}

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-bottom: none;
    padding: 60px 48px;
    margin: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.page-header h1 {
    font-size: 2.5em;
    margin-bottom: 12px;
    color: white;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-header p {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 1;
}

/* Content Sections */
.content-section {
    padding: 48px;
    max-width: 1000px;
    background: white;
}

.content-section h2 {
    font-size: 1.75em;
    color: var(--text-color);
    margin-bottom: 24px;
    font-weight: 600;
    position: relative;
    padding-left: 16px;
}

.content-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 2px;
}

/* Doc Grid - 多彩卡片 */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.doc-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.doc-card:hover::before {
    transform: scaleX(1);
}

.doc-card:nth-child(4n+1)::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.doc-card:nth-child(4n+2)::before {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.doc-card:nth-child(4n+3)::before {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.doc-card:nth-child(4n+4)::before {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

.doc-card:hover {
    border-color: transparent;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    transform: translateY(-8px);
}

.doc-card h3 {
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.doc-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
}

/* API List - 彩色标签 */
.api-list {
    margin-top: 24px;
}

.api-item {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    margin-bottom: 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.api-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.api-item:hover::before {
    transform: scaleY(1);
}

.api-item:hover {
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
    transform: translateX(8px);
}

.method {
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75em;
    margin-right: 16px;
    min-width: 55px;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.method.post {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.method.get {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.method.put {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.method.delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.endpoint {
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9em;
    margin-right: 16px;
    flex: 1;
}

.desc {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Code Example - 现代化深色主题 */
.code-example {
    margin-top: 24px;
}

.code-example pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875em;
    line-height: 1.6;
    border: 1px solid #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.code-example code {
    color: #e2e8f0;
}

/* Plugin Grid - 多彩卡片 */
.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.plugin-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.plugin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.plugin-card:hover::before {
    transform: scaleX(1);
}

.plugin-card:nth-child(6n+1)::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.plugin-card:nth-child(6n+2)::before {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.plugin-card:nth-child(6n+3)::before {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.plugin-card:nth-child(6n+4)::before {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

.plugin-card:nth-child(6n+5)::before {
    background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
}

.plugin-card:nth-child(6n+6)::before {
    background: linear-gradient(90deg, #30cfd0 0%, #330867 100%);
}

.plugin-card:hover {
    border-color: transparent;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    transform: translateY(-8px);
}

.plugin-card h3 {
    font-size: 1.15em;
    color: var(--text-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.plugin-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    margin-top: 64px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
}

/* Scrollbar - 更简洁的样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .top-navbar {
        padding: 0 16px;
        height: 56px;
    }
    
    .top-navbar-menu {
        gap: 12px;
    }
    
    .top-navbar-menu li a {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .top-navbar-brand span {
        display: none;
    }
    
    .main-container {
        flex-direction: column;
        margin-top: 56px;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
        max-height: 400px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-header {
        padding: 24px 20px;
    }
    
    .page-header h1 {
        font-size: 1.5em;
    }
    
    .page-header p {
        font-size: 0.9em;
    }
    
    .content-section {
        padding: 24px 20px;
    }
    
    .doc-grid,
    .plugin-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .api-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
    }
    
    .method,
    .endpoint,
    .desc {
        margin-bottom: 8px;
    }
}

/* Markdown 内容样式 - 现代化风格 */
#content {
    line-height: 1.75;
    color: var(--text-color);
}

#content h1 {
    font-size: 2em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
}

#content h1:first-child {
    margin-top: 0;
}

#content h2 {
    font-size: 1.5em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    padding-left: 16px;
}

#content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

#content h3 {
    font-size: 1.25em;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

#content h4 {
    font-size: 1.1em;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

#content p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

#content code {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875em;
    border: 1px solid #fcd34d;
    font-weight: 500;
}

#content pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
    font-size: 0.875em;
}

#content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9em;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#content table th,
#content table td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}

#content table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
    color: white;
}

#content table tr:hover {
    background: var(--hover-bg);
}

#content ul, #content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

#content li {
    margin: 0.5rem 0;
    color: var(--text-color);
}

#content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

#content a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

#content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 4px;
}

#content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

#content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 50%, transparent 100%);
    margin: 2rem 0;
}

#content strong {
    font-weight: 600;
    color: var(--text-color);
}

#content em {
    font-style: italic;
}

.nav-menu a.active {
    background: linear-gradient(90deg, #eff6ff 0%, #e0e7ff 100%);
    color: var(--primary-color);
    font-weight: 500;
    border-left-color: var(--primary-color);
}

.error {
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    margin: 1rem 0;
    border-left: 4px solid #ef4444;
}

.error h2 {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

/* 搜索框样式（如果需要） */
.search-box {
    padding: 16px 24px;
    border-bottom: 1px solid var(--sidebar-border);
    background: #fff;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--text-color);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

/* 夜间模式 */
body.dark-mode {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-border: #334155;
    --text-color: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
    --hover-bg: #334155;
    --code-bg: #1e293b;
}

body.dark-mode .top-navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

body.dark-mode .page-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
}

body.dark-mode .doc-card,
body.dark-mode .plugin-card,
body.dark-mode .api-item {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .doc-card:hover,
body.dark-mode .plugin-card:hover,
body.dark-mode .api-item:hover {
    background: #334155;
}

body.dark-mode .main-content {
    background: #0f172a;
}

body.dark-mode .content-section {
    background: #0f172a;
}

body.dark-mode .nav-section ul li a.active {
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
}

body.dark-mode .theme-toggle .sun-icon {
    display: none;
}

body.dark-mode .theme-toggle .moon-icon {
    display: block;
}

body.dark-mode #content code {
    background: linear-gradient(135deg, #422006 0%, #713f12 100%);
    color: #fbbf24;
    border-color: #92400e;
}

body.dark-mode #content table th {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

body.dark-mode .search-box {
    background: #1e293b;
}

body.dark-mode .search-box input {
    background: #0f172a;
    border-color: #334155;
    color: var(--text-color);
}

body.dark-mode .page-footer {
    border-top-color: #334155;
}
