:root {
    --blue: #0071e3;
    --text: #1d1d1f;
    --muted: #86868b;
    --glass-bg: rgba(255,255,255,0.65);
    --glass-border: rgba(255,255,255,0.8);
    --sidebar-w: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: #f4f5f7;
    overflow-x: hidden;
    margin: 0;
}

/* 背景 */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .7; animation: float 20s infinite ease-in-out alternate; }
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #e0f2fe; }
.blob-2 { bottom: -10%; right: -10%; width: 45vw; height: 45vw; background: #e0e7ff; animation-delay: -7s; }
.blob-3 { top: 40%; left: 35%; width: 40vw; height: 40vw; background: #fce7f3; animation-delay: -14s; }
@keyframes float { to { transform: translate(5%, 8%) scale(1.08); } }

/* 导航 */
.navbar-glass {
    background: rgba(255,255,255,0.6) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    padding: 10px 0;
    z-index: 1100;
}
.navbar-brand { font-weight: 700; color: var(--text) !important; font-size: 1.1rem; }

/* 布局 */
.layout {
    display: flex;
    padding-top: 60px;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    border-radius: 0;
    border-right: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 20px 0 40px;
    z-index: 1000;
    transition: transform .3s ease;
}
.sidebar:hover { transform: none !important; }
.sidebar-header { padding: 0 20px 12px; border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 8px; }
.nav-section { margin-bottom: 8px; }
.nav-section-title {
    font-size: 0.7rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
    padding: 12px 20px 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px; color: var(--text); text-decoration: none;
    font-size: 0.88rem; font-weight: 500; border-radius: 0;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(0,113,227,0.06); color: var(--blue); }
.nav-item.active { background: rgba(0,113,227,0.08); color: var(--blue); border-left-color: var(--blue); }
.nav-item i { font-size: 0.95rem; width: 18px; text-align: center; }

/* 折叠分组 */
.nav-group-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.nav-group-toggle:hover { color: var(--blue); }
.nav-chevron { transition: transform .2s; font-size: 0.75rem; }
.nav-group-toggle.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group-items { overflow: hidden; transition: max-height .25s ease; }
.nav-group-items.collapsed { max-height: 0 !important; }

/* 二级菜单 */
.nav-l1 { font-weight: 600; }
.nav-l2 { padding-left: 32px; font-size: 0.83rem; font-weight: 400; color: #555; }
.nav-l2:hover { color: var(--blue); }
.nav-l2.active { color: var(--blue); border-left-color: var(--blue); }

/* 主内容 */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px 24px 60px;
    min-width: 0;
}

/* 文档容器 */
.doc-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 48px;
    border-radius: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}
.doc-container:hover { transform: none; }

/* Markdown 内容样式 */
.doc-container h1 {
    font-size: 1.9rem; font-weight: 700; color: var(--text);
    padding-bottom: 16px; border-bottom: 2px solid rgba(0,113,227,0.15);
    margin-bottom: 28px;
}
.doc-container h2 {
    font-size: 1.3rem; font-weight: 700; color: var(--text);
    margin-top: 40px; margin-bottom: 16px;
    padding-left: 12px; border-left: 4px solid var(--blue);
}
.doc-container h3 {
    font-size: 1.05rem; font-weight: 600; color: #333;
    margin-top: 28px; margin-bottom: 12px;
}
.doc-container p { line-height: 1.8; color: #333; margin-bottom: 14px; }
.doc-container a { color: var(--blue); text-decoration: none; }
.doc-container a:hover { text-decoration: underline; }
.doc-container blockquote {
    margin: 16px 0; padding: 12px 20px;
    background: rgba(0,113,227,0.05); border-left: 4px solid var(--blue);
    border-radius: 0 8px 8px 0; color: #555;
}
.doc-container blockquote p { margin: 0; }
.doc-container code {
    background: rgba(0,0,0,0.05); padding: 2px 7px;
    border-radius: 5px; font-size: 0.85em; color: #c7254e;
    font-family: "SF Mono", Consolas, monospace;
}
.doc-container pre {
    background: rgba(29,29,31,0.88); border-radius: 12px;
    padding: 20px 24px; overflow-x: auto; margin: 20px 0;
}
.doc-container pre code { background: none; color: #e8e8e8; padding: 0; font-size: 0.85rem; }
.doc-container table {
    width: 100%; border-collapse: collapse; margin: 20px 0;
    font-size: 0.9rem; border-radius: 12px; overflow: hidden;
}
.doc-container th {
    background: rgba(0,113,227,0.08); color: var(--text);
    padding: 11px 16px; text-align: left; font-weight: 600;
    border-bottom: 2px solid rgba(0,113,227,0.15);
}
.doc-container td {
    padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: top;
}
.doc-container tr:last-child td { border-bottom: none; }
.doc-container tr:hover td { background: rgba(0,113,227,0.03); }
.doc-container ul, .doc-container ol { padding-left: 24px; line-height: 1.9; }
.doc-container li { margin-bottom: 4px; }
.doc-container hr { border: none; border-top: 1px solid rgba(0,0,0,0.08); margin: 32px 0; }
.doc-container strong { color: var(--text); }

/* 加载状态 */
.loading-state { text-align: center; padding: 80px 0; }

/* 回到顶部 */
.float-btn {
    position: fixed; bottom: 32px; right: 32px;
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.75); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08); cursor: pointer;
    color: var(--blue); font-size: 1.2rem; transition: .25s;
    opacity: 0; pointer-events: none; z-index: 999;
}
.float-btn.show { opacity: 1; pointer-events: auto; }
.float-btn:hover { transform: scale(1.1); background: #fff; }

/* 遮罩 */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.3); z-index: 999;
    backdrop-filter: blur(2px);
}

/* 移动端 */
@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; padding: 20px 16px 60px; }
    .doc-container { padding: 24px 20px; border-radius: 16px; }
    .doc-container h1 { font-size: 1.5rem; }
    .doc-container h2 { font-size: 1.15rem; }
    .doc-container table { font-size: 0.82rem; }
    .doc-container th, .doc-container td { padding: 8px 10px; }
    .float-btn { bottom: 20px; right: 20px; }
}
