/* ========================================
   SrbillHub v8.9 - 终极色彩流动 & 移动端适配版
   ======================================== */

:root {
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-glass: rgba(255, 255, 255, 0.2); 
  
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #8b8ba7;
    
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.1);
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    --purple: #8b5cf6;
    --pink: #ec4899;
    --blue: #3b82f6;
    --cyan: #06b6d4;
    --green: #10b981;
    --orange: #f59e0b;
    --red: #ef4444;
    
    /* 🔥 增强渐变色：蓝 -> 紫 -> 粉 -> 红 -> 蓝 */
    --gradient-text: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 25%, #ec4899 50%, #ef4444 75%, #3b82f6 100%);
    --gradient-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(236, 72, 153, 0.1) 100%);
    --gradient-button: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 📱 iPhone 安全区域适配变量 */
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --nav-height: calc(64px + var(--safe-top));
    
    --sidebar-width: 280px;
    --blur: blur(30px);
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --bg-glass: rgba(15, 15, 26, 0.3);
    --text-primary: #eaeaff;
    --text-secondary: #a5a5c0;
    --text-muted: #6b6b8a;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
    /* 📱 防止 iPhone 横屏左右晃动 */
    width: 100vw;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
::selection { background: rgba(99, 102, 241, 0.3); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }

/* ========================================
   Canvas 层
   ======================================== */
#confetti-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; }
#sparks-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99998; overflow: hidden; }
.spark { position: absolute; border-radius: 50%; pointer-events: none; will-change: transform, opacity; }

/* ========================================
   自定义光标
   ======================================== */
.cursor, .cursor-follower { position: fixed; pointer-events: none; z-index: 100000; border-radius: 50%; opacity: 0; transition: opacity 0.3s; }
body.cursor-ready .cursor, body.cursor-ready .cursor-follower { opacity: 1; }
.cursor { width: 8px; height: 8px; background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 0 10px var(--accent-glow); }
.cursor-follower { width: 36px; height: 36px; border: 2px solid var(--accent); transform: translate(-50%, -50%); transition: width 0.2s, height 0.2s, background 0.2s; }
.cursor-follower.hover { width: 50px; height: 50px; background: var(--accent-light); }
.cursor-follower.clicking { width: 28px; height: 28px; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-follower { display: none !important; } }

/* ========================================
   导航栏 (完美适配 iPhone 刘海)
   ======================================== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) var(--blur);
    -webkit-backdrop-filter: saturate(180%) var(--blur);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    /* 📱 关键：让导航栏内容避开刘海 */
    padding-top: var(--safe-top); 
}

.nav-container {
    max-width: 1400px;
    height: 100%; /* 自动填满剩余高度 */
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   Logo & 标题 (终极流动版 v8.9)
   ======================================== */

/* 1. 颜色流动动画 (加大色相旋转幅度 60deg，保证看到变色) */
@keyframes color-flow {
    0% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(60deg) brightness(1.1); } 
    100% { filter: hue-rotate(0deg) brightness(1); }
}

/* 2. 上下漂浮动画 (8px 幅度) */
@keyframes float-y-large {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); } 
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    /* 整体应用漂浮 */
    animation: float-y-large 5s ease-in-out infinite;
}

/* 3. Logo 图片 (Mask 变色，无背景圆) */
.my-custom-icon {
    width: 52px; /* ✅ 加大 */
    height: 52px;
    object-fit: contain;
    margin-right: 8px;
    
    /* 核心：把 PNG 变渐变色 */
    background: var(--gradient-text); 
    -webkit-mask: url('/static/my-heart.png') no-repeat center / contain;
    mask: url('/static/my-heart.png') no-repeat center / contain;
    
    /* 颜色流动 */
    animation: color-flow 8s linear infinite;
    
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-brand:hover .my-custom-icon { transform: scale(1.2) rotate(-15deg); }

/* 4. 标题文字 (同步流动) */
.nav-title-text {
    font-size: 26px; /* ✅ 加大 */
    font-weight: 800;
    letter-spacing: -0.5px;
    
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* 同步颜色流动 */
    animation: color-flow 8s linear infinite;
}

/* ========================================
   导航菜单
   ======================================== */
.nav-menu { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 8px 16px; color: var(--text-secondary); font-size: 15px; font-weight: 500; border-radius: 8px; transition: var(--transition); }
.nav-link:hover { color: var(--text-primary); background: var(--bg-secondary); }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: 24px; }

.search-box { position: relative; }
.search-box input { width: 200px; padding: 8px 12px 8px 36px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-primary); font-size: 14px; outline: none; transition: var(--transition); }
.search-box input:focus { width: 260px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; }

.theme-group { display: flex; background: var(--bg-secondary); border-radius: 8px; padding: 4px; }
.theme-btn { padding: 6px 10px; background: none; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; opacity: 0.6; color: var(--text-primary); transition: var(--transition); }
.theme-btn:hover { opacity: 1; background: var(--bg-tertiary); }
.theme-btn.active { background: var(--bg-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); opacity: 1; color: var(--accent); }

/* ========================================
   按钮
   ======================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-size: 14px; font-weight: 500; border-radius: 8px; border: none; cursor: pointer; transition: var(--transition); font-family: var(--font-sans); }
.btn-primary { background: var(--gradient-button); color: #fff; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px var(--accent-glow); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); } .btn-secondary:hover { background: var(--bg-tertiary); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); } .btn-outline:hover { background: var(--bg-secondary); border-color: var(--accent); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; } .btn-block { width: 100%; } .btn-danger { background: var(--red); color: #fff; }

/* ========================================
   浮动菜单
   ======================================== */
.float-menu { position: fixed; right: 24px; bottom: 100px; z-index: 900; padding-bottom: var(--safe-bottom); }
.float-menu-toggle { width: 56px; height: 56px; background: var(--gradient-button); border: none; border-radius: 50%; cursor: pointer; box-shadow: var(--shadow-lg), var(--shadow-glow); transition: var(--transition); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.float-menu-toggle:hover { transform: scale(1.1) rotate(15deg); }
.float-menu-items { position: absolute; bottom: 70px; right: 0; display: flex; flex-direction: column; gap: 12px; opacity: 0; visibility: hidden; transform: translateY(20px); transition: var(--transition); }
.float-menu.open .float-menu-items { opacity: 1; visibility: visible; transform: translateY(0); }
.float-menu-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg-glass); backdrop-filter: var(--blur); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; white-space: nowrap; transition: var(--transition); font-size: 14px; color: var(--text-primary); }
.float-menu-item:hover { background: var(--bg-secondary); border-color: var(--accent); transform: translateX(-4px); }

/* ========================================
   Hero 区域 (强制居中修复版)
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
    width: 100%;
    z-index: 1;
    /* 📱 适配 iPhone 底部 */
    padding-bottom: calc(80px + var(--safe-bottom));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========================================
   Hero 背景 (极光边缘版)
   ======================================== */
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; background: var(--bg-primary); }
.hero-orbs { position: absolute; top: 0; left: 0; width: 100%; height: 100%; filter: blur(120px); opacity: 0.4; }
.orb { position: absolute; border-radius: 50%; animation: aurora-float 20s infinite ease-in-out alternate; }
.orb-1 { top: -40%; left: -30%; width: 80vw; height: 80vw; background: #6366f1; animation-duration: 25s; }
.orb-2 { bottom: -40%; right: -30%; width: 80vw; height: 80vw; background: #ec4899; animation-duration: 30s; animation-delay: -5s; }
.orb-3 { top: -30%; right: -30%; width: 60vw; height: 60vw; background: #3b82f6; animation-duration: 28s; opacity: 0.5; }
.orb-4 { bottom: -30%; left: -30%; width: 60vw; height: 60vw; background: #06b6d4; animation-duration: 32s; opacity: 0.4; }
@keyframes aurora-float { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, 20px) scale(1.05); } 100% { transform: translate(-20px, -30px) scale(0.95); } }

.hero-badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; background: var(--accent-light); border: 1px solid var(--accent); border-radius: 50px; font-size: 15px; font-weight: 500; color: var(--accent); margin-bottom: 32px; cursor: pointer; transition: var(--transition); user-select: none; }
.hero-badge:hover { background: var(--accent); color: #fff; transform: scale(1.05); } .hero-badge:active { transform: scale(0.98); }
.hero-badge-dot { width: 10px; height: 10px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }

.hero-title { font-size: clamp(3rem, 10vw, 5.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 28px; letter-spacing: -0.02em; }
/* 标题颜色流动 */
.hero-title .gradient { background: var(--gradient-text); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: color-flow 8s linear infinite; }

.hero-desc { font-size: clamp(1.15rem, 3vw, 1.5rem); color: var(--text-secondary); margin-bottom: 48px; max-width: 700px; margin-left: auto; margin-right: auto; line-height: 1.7; }
.hero-actions { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { padding: 16px 36px; font-size: 17px; font-weight: 600; }

/* ========================================
   Features 区域
   ======================================== */
.features { padding: 100px 24px; background: var(--bg-secondary); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.section-desc { text-align: center; color: var(--text-secondary); font-size: 1.15rem; margin-bottom: 60px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

/* 液态玻璃卡片 (覆盖原有的 feature-card) */
.feature-card { position: relative; background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.4); border-bottom: 1px solid rgba(255, 255, 255, 0.05); border-radius: 24px; padding: 32px; overflow: hidden; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.05); }
[data-theme="dark"] .feature-card { background: rgba(30, 30, 40, 0.2); border-color: rgba(255, 255, 255, 0.08); border-top-color: rgba(255, 255, 255, 0.15); }
.feature-card:hover { transform: translateY(-8px) scale(1.01); background: rgba(255, 255, 255, 0.08); box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--accent); }
.feature-card::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%); transform: translateX(-100%); transition: transform 0.6s; z-index: 1; pointer-events: none; }
.feature-card:hover::after { transform: translateX(100%); transition: transform 0.8s ease-in-out; }

.feature-icon { width: 56px; height: 56px; background: var(--bg-secondary); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: var(--accent); border: 1px solid var(--border); transition: all 0.3s; }
.feature-card:hover .feature-icon { background: var(--accent); color: #fff; transform: scale(1.1) rotate(5deg); border-color: transparent; box-shadow: 0 10px 20px var(--accent-light); }
.feature-title { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.feature-desc { color: var(--text-secondary); font-size: 15px; line-height: 1.7; }

/* ========================================
   文档目录
   ======================================== */
.docs-catalog { padding: 100px 24px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.doc-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; cursor: pointer; transition: var(--transition); position: relative; overflow: hidden; }
.doc-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--gradient-button); transform: scaleX(0); transition: transform var(--transition); }
.doc-card:hover { border-color: var(--accent); background: var(--bg-primary); transform: translateY(-4px); box-shadow: var(--shadow); }
.doc-card:hover::before { transform: scaleX(1); }
.doc-card-icon { font-size: 42px; margin-bottom: 16px; }
.doc-card-title { font-weight: 600; margin-bottom: 6px; font-size: 20px; }
.doc-card-count { font-size: 14px; color: var(--text-muted); }

/* ========================================
   文档布局 (修复版)
   ======================================== */
.docs-layout { display: flex; padding-top: var(--nav-height); min-height: 100vh; position: relative; z-index: 10; background: var(--bg-primary); }
.sidebar { position: fixed; top: var(--nav-height); left: 0; width: var(--sidebar-width); height: calc(100vh - var(--nav-height)); background: var(--bg-glass); backdrop-filter: var(--blur); border-right: 1px solid var(--border); overflow-y: auto; z-index: 100; transition: transform var(--transition); display: flex; flex-direction: column; padding-bottom: var(--safe-bottom); }
.sidebar-header { padding: 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-glass); backdrop-filter: var(--blur); z-index: 10; }
.search-input { width: 100%; padding: 10px 14px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 14px; outline: none; transition: var(--transition); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.sidebar-nav { padding: 16px; flex: 1; overflow-y: auto; }
.quick-actions { display: flex; gap: 8px; padding: 12px 16px; background: var(--gradient-bg); border-bottom: 1px solid var(--border); }
.nav-folder { margin-bottom: 4px; }
.folder-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-secondary); transition: var(--transition); }
.folder-header:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.folder-icon { font-size: 10px; transition: transform 0.2s; }
.nav-folder.open .folder-icon { transform: rotate(90deg); }
.folder-children { display: none; margin-left: 16px; padding-left: 12px; border-left: 1px solid var(--border); }
.nav-folder.open .folder-children { display: block; }
.nav-file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-secondary); transition: var(--transition); }
.nav-file:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-file.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.doc-main { flex: 1; margin-left: var(--sidebar-width); display: flex; }
.doc-content { flex: 1; max-width: 900px; padding: 40px; margin: 0 auto; padding-bottom: calc(40px + var(--safe-bottom)); }
.doc-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.doc-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--text-muted); font-size: 14px; }
.doc-actions { display: flex; gap: 8px; margin-left: auto; }
.doc-stats { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 20px; background: var(--gradient-bg); border-radius: var(--radius); margin-bottom: 24px; }
.doc-stat { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.doc-stat-value { font-weight: 600; color: var(--text-primary); }
.doc-toc { width: 220px; padding: 40px 20px; position: sticky; top: var(--nav-height); height: calc(100vh - var(--nav-height)); overflow-y: auto; border-left: 1px solid var(--border); padding-bottom: var(--safe-bottom); }
.toc-title { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }
.toc-list { list-style: none; } .toc-item { margin-bottom: 8px; }
.toc-link { display: block; padding: 4px 12px; font-size: 13px; color: var(--text-muted); border-left: 2px solid transparent; transition: var(--transition); }
.toc-link:hover { color: var(--text-primary); } .toc-link.active { color: var(--accent); border-left-color: var(--accent); }
.toc-link.level-2 { padding-left: 12px; } .toc-link.level-3 { padding-left: 24px; font-size: 12px; }
.sidebar-toggle { display: none; position: fixed; bottom: calc(24px + var(--safe-bottom)); left: 24px; width: 56px; height: 56px; background: var(--gradient-button); color: #fff; border: none; border-radius: 50%; font-size: 24px; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 1000; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90; }

/* ========================================
   Markdown 渲染
   ======================================== */
.markdown-body { font-size: 16px; line-height: 1.8; color: var(--text-primary); }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin-top: 2em; margin-bottom: 1em; font-weight: 600; }
.markdown-body h1 { font-size: 2em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body p { margin: 1em 0; }
.markdown-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.markdown-body code { background: var(--bg-tertiary); padding: 0.2em 0.4em; border-radius: 4px; font-family: var(--font-mono); font-size: 0.9em; color: var(--pink); }
.markdown-body pre { position: relative; background: #1e1e2e; border-radius: var(--radius); padding: 16px; padding-top: 40px; overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); }
.markdown-body pre code { background: none; padding: 0; color: #cdd6f4; font-size: 14px; }
.code-copy-btn { position: absolute; top: 8px; right: 8px; padding: 4px 10px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; color: #a5a5c0; font-size: 12px; cursor: pointer; transition: var(--transition); }
.code-copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; } .code-copy-btn.copied { background: var(--green); color: #fff; }
.markdown-body blockquote { border-left: 4px solid var(--accent); padding: 12px 20px; margin: 1.5em 0; background: var(--gradient-bg); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-secondary); }
.markdown-body ul, .markdown-body ol { margin: 1em 0; padding-left: 2em; } .markdown-body li { margin: 0.5em 0; }
.markdown-body img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; } .markdown-body th { background: var(--bg-secondary); font-weight: 600; }
.wikilink { color: var(--purple); cursor: pointer; font-weight: 500; border-bottom: 2px solid var(--purple); transition: var(--transition); }
.wikilink:hover { color: var(--pink); border-bottom-color: var(--pink); }

/* ========================================
   Callouts / 反向链接 / 图谱 / 弹窗 ... (省略部分通用样式，保持原样即可)
   ======================================== */
.callout { margin: 1.5em 0; padding: 16px 20px; border-radius: var(--radius); border-left: 4px solid; font-size: 16px; line-height: 1.6; }
.callout-header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 8px; opacity: 0.9; }
.callout-content { color: var(--text-secondary); font-size: 15px; } .callout-content p { margin: 0.5em 0; } .callout-content p:last-child { margin-bottom: 0; }
.callout-tip { background: rgba(16, 185, 129, 0.1); border-color: var(--green); } .callout-tip .callout-header { color: var(--green); }
.callout-note { background: rgba(59, 130, 246, 0.1); border-color: var(--blue); } .callout-note .callout-header { color: var(--blue); }
.callout-warning { background: rgba(245, 158, 11, 0.1); border-color: var(--orange); } .callout-warning .callout-header { color: var(--orange); }
.callout-danger { background: rgba(239, 68, 68, 0.1); border-color: var(--red); } .callout-danger .callout-header { color: var(--red); }

.backlinks-section { margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--border); }
.backlinks-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.backlinks-list { display: flex; flex-wrap: wrap; gap: 10px; }
.backlink-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.backlink-item:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

.graph-controls { display: flex; gap: 8px; margin-right: auto; margin-left: 16px; }
.modal-graph-box { max-width: 95vw; width: 1000px; height: 85vh; }
.modal-graph-box .modal-header { display: flex; align-items: center; }
.modal-graph-box .modal-close { margin-left: auto; }
.graph-body { padding: 0 !important; height: calc(100% - 60px); }
#graph-canvas { width: 100%; height: 100%; display: block; background: var(--bg-secondary); touch-action: none; }

.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: var(--transition); }
.modal.show { opacity: 1; visibility: visible; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-box { position: relative; background: var(--bg-primary); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-lg); transform: scale(0.95) translateY(10px); transition: transform var(--transition); }
.modal.show .modal-box { transform: scale(1) translateY(0); }
.modal-lg .modal-box { max-width: 1000px; height: 85vh; display: flex; flex-direction: column; }
.modal-search-box { max-width: 600px; max-height: 70vh; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; background: var(--bg-secondary); border: none; border-radius: 8px; font-size: 20px; cursor: pointer; color: var(--text-muted); transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* Lucide 图标通用样式 */
.lucide { vertical-align: middle; stroke-width: 2px; }
.icon-sm { width: 16px; height: 16px; opacity: 0.8; }
.icon-xs { width: 14px; height: 14px; }
.float-menu-toggle svg { width: 24px; height: 24px; }
.float-menu-item svg { width: 18px; height: 18px; color: var(--accent); }

/* ========================================
   响应式 (iPhone 适配增强)
   ======================================== */
@media (max-width: 1024px) { .doc-toc { display: none; } }
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu { 
        position: fixed; top: var(--nav-height); left: 0; right: 0; 
        background: var(--bg-glass); backdrop-filter: var(--blur); 
        flex-direction: column; padding: 16px; gap: 8px; 
        transform: translateY(-100%); opacity: 0; pointer-events: none; 
        transition: var(--transition); 
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-right { flex-direction: column; width: 100%; margin-left: 0; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
    .search-box { width: 100%; } .search-box input { width: 100%; } .search-box input:focus { width: 100%; }
    .theme-group { width: 100%; justify-content: center; }
    .sidebar { transform: translateX(-100%); } .sidebar.show { transform: translateX(0); } .sidebar-toggle { display: flex; align-items: center; justify-content: center; } .sidebar-overlay.show { display: block; }
    .doc-main { margin-left: 0; } .doc-content { padding: 24px 16px; } .doc-title { font-size: 1.75rem; }
    .hero { padding: 100px 20px 60px; padding-bottom: calc(60px + var(--safe-bottom)); }
    .hero-title { font-size: 2.5rem; } .hero-desc { font-size: 1.1rem; } .hero-actions { flex-direction: column; } .hero-actions .btn { width: 100%; }
    .features-grid { grid-template-columns: 1fr; }
    .editor-container { flex-direction: column; } .editor-pane textarea { border-right: none; border-bottom: 1px solid var(--border); min-height: 200px; }
    .float-menu { right: 16px; bottom: calc(80px + var(--safe-bottom)); }
}
@media print { .navbar, .sidebar, .sidebar-toggle, .doc-toc, .doc-actions, .cursor, .cursor-follower, #confetti-canvas, #sparks-container, .float-menu { display: none !important; } .doc-main { margin: 0 !important; } .doc-content { max-width: none !important; padding: 0 !important; } }
