/* ============================================================
   手册阅读页 · Soft UI / Glassmorphism 适配
   —— 保留纸感长文阅读，只把"硬边、硬阴影、硬对比"柔化为玻璃层次
   引入位置：须在内联 <style> 之后
   ============================================================ */

/* ---------- 1. 背景：与官网同一套浅色渐变 + 光斑 ---------- */
body {
    background: linear-gradient(165deg, #f9fbff 0%, #f1f6fc 45%, #faf8ff 100%) !important;
    padding-top: 86px !important;
}

/* ---------- 2. 工具条：玻璃化 ---------- */
.tc-sitebar {
    background: rgba(255, 255, 255, .58) !important;
    backdrop-filter: blur(26px) saturate(175%);
    -webkit-backdrop-filter: blur(26px) saturate(175%);
    border-bottom: 1px solid rgba(255, 255, 255, .72) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.tc-sitebar-btn {
    background: linear-gradient(135deg, #1a5c9e 0%, #0284c7 100%) !important;
    border-radius: 999px !important;
    padding: 8px 20px !important;
    box-shadow: 0 6px 18px rgba(2, 132, 199, .22), inset 0 1px 0 rgba(255, 255, 255, .22) !important;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease;
}

.tc-sitebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(2, 132, 199, .26), inset 0 1px 0 rgba(255, 255, 255, .22) !important;
    text-decoration: none !important;
}

/* 第二个下载按钮：玻璃次按钮，避免两个实心蓝并重 */
.tc-sitebar .tc-sitebar-btn ~ .tc-sitebar-btn {
    background: rgba(255, 255, 255, .55) !important;
    color: #1a5c9e !important;
    border: 1px solid rgba(26, 92, 158, .22) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06) !important;
}

.tc-sitebar .tc-sitebar-btn ~ .tc-sitebar-btn:hover {
    background: rgba(255, 255, 255, .82) !important;
    border-color: rgba(26, 92, 158, .34) !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08) !important;
}

/* ---------- 3. 模式标签：玻璃胶囊 ---------- */
.tc-modetabs {
    background: rgba(255, 255, 255, .46) !important;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(255, 255, 255, .60) !important;
}

.tc-modetab {
    background: rgba(255, 255, 255, .55) !important;
    border: 1px solid rgba(255, 255, 255, .75) !important;
    border-radius: 999px !important;
    padding: 8px 20px !important;
    color: #4a5a72 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04) !important;
    transition: background .3s ease, color .3s ease, transform .3s cubic-bezier(.4, 0, .2, 1);
}

.tc-modetab:hover {
    background: rgba(255, 255, 255, .82) !important;
    color: #163a5f !important;
}

.tc-modetab.active {
    background: linear-gradient(135deg, #1a5c9e 0%, #0284c7 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(2, 132, 199, .24) !important;
}

/* ---------- 4. 目录侧栏：悬浮玻璃卡 ---------- */
#sidebar {
    background: rgba(255, 255, 255, .52) !important;
    backdrop-filter: blur(26px) saturate(175%);
    -webkit-backdrop-filter: blur(26px) saturate(175%);
    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-right: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: 26px !important;
    margin: 16px 12px 24px 16px !important;
    padding: 22px 18px 40px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05), 0 16px 40px rgba(15, 23, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .88) !important;
    top: 96px !important;
    height: calc(100vh - 118px) !important;
}

#sidebar::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(26, 92, 158, .18);
    border-radius: 8px;
}

.toc-children {
    border-left: 2px solid rgba(26, 92, 158, .12) !important;
}

.toc-2 {
    border-radius: 10px !important;
    transition: background .25s ease, color .25s ease;
}

.toc-2:hover {
    background: rgba(26, 92, 158, .08) !important;
    color: #163a5f !important;
}

/* ---------- 5. 正文纸面：柔和玻璃（保持阅读白度） ---------- */
#paper {
    background: rgba(255, 255, 255, .84) !important;
    backdrop-filter: blur(30px) saturate(170%);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .75) !important;
    border-radius: 30px !important;
    padding: 48px 46px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05), 0 28px 68px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .90) !important;
}

/* 标题：降低硬对比 */
#main h1 {
    color: #163a5f !important;
    border-bottom: 3px solid rgba(26, 92, 158, .14) !important;
}

#main h2 {
    color: #1c3f63 !important;
}

#main h3 {
    color: #4a5a72 !important;
}

#main strong {
    color: #163a5f !important;
}

/* 引用块：浅蓝玻璃 */
#main blockquote {
    background: rgba(26, 92, 158, .05) !important;
    border-left: 3px solid rgba(26, 92, 158, .55) !important;
    border-radius: 0 16px 16px 0 !important;
    color: #4a5a72 !important;
}

/* 表格：圆角柔和、弱边框 */
#main table {
    border-radius: 16px !important;
}

#main th {
    background: rgba(26, 92, 158, .06) !important;
    color: #163a5f !important;
    border: 1px solid rgba(15, 23, 42, .06) !important;
}

#main td {
    border: 1px solid rgba(15, 23, 42, .06) !important;
}

#main tr:nth-child(even) td {
    background: rgba(255, 255, 255, .52) !important;
}

/* 代码块 */
#main pre {
    background: rgba(15, 23, 42, .03) !important;
    border: 1px solid rgba(255, 255, 255, .70) !important;
    border-radius: 16px !important;
}

#main code {
    background: rgba(26, 92, 158, .07) !important;
    border-radius: 6px !important;
}

/* 分隔线 */
#main hr {
    border-top: 1px dashed rgba(15, 23, 42, .10) !important;
}

/* ---------- 6. 移动端目录开关：玻璃按钮 ---------- */
#toggle {
    background: rgba(255, 255, 255, .72) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .80) !important;
    border-radius: 999px !important;
    top: 88px !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .10) !important;
}

/* ---------- 7. 表单册面板：与正文同一质感 ---------- */
#formsPanel {
    background: transparent !important;
}

#formsPanel .paper {
    background: rgba(255, 255, 255, .84) !important;
    backdrop-filter: blur(30px) saturate(170%);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .75) !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05), 0 28px 68px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .90) !important;
}

#formsPanel th {
    background: rgba(26, 92, 158, .06) !important;
    color: #163a5f !important;
}

#formsPanel blockquote {
    background: rgba(26, 92, 158, .05) !important;
    border-left: 3px solid rgba(26, 92, 158, .55) !important;
    border-radius: 0 16px 16px 0 !important;
}

/* ---------- 8. 响应式 ---------- */
@media (max-width: 960px) {
    body {
        padding-top: 80px !important;
    }

    #sidebar {
        position: fixed !important;
        margin: 0 !important;
        border-radius: 0 26px 26px 0 !important;
        top: 0 !important;
        height: 100vh !important;
    }

    #paper {
        padding: 26px 18px !important;
        border-radius: 24px !important;
    }
}

@media (max-width: 900px) {
    #sidebar {
        position: static !important;
        width: auto !important;
        flex: none;
        margin: 12px 14px !important;
        border-radius: 24px !important;
        height: auto !important;
        border-bottom: 1px solid rgba(255, 255, 255, .72) !important;
    }
}

/* ---------- 9. 打印：还原纯白纸面 ---------- */
@media print {
    body {
        background: #fff !important;
        padding-top: 0 !important;
    }

    #paper,
    #formsPanel .paper {
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    #sidebar,
    #toggle,
    .tc-sitebar,
    .tc-modetabs,
    .header,
    .footer {
        display: none !important;
    }
}
