/* ==============================================
 * 阅读页面毛玻璃卡通美化样式 (Glassmorphism + Kawaii)
 * ============================================== */

/* ====== 底层图片背景（preview.png）+ 光斑叠加 ====== */
html {
    background:
        radial-gradient(at 15% 20%, rgba(255, 182, 193, 0.45) 0%, transparent 45%),
        radial-gradient(at 85% 15%, rgba(196, 226, 255, 0.45) 0%, transparent 45%),
        radial-gradient(at 75% 85%, rgba(225, 196, 255, 0.45) 0%, transparent 50%),
        radial-gradient(at 25% 75%, rgba(255, 220, 240, 0.35) 0%, transparent 50%),
        radial-gradient(at 50% 50%, rgba(186, 226, 255, 0.30) 0%, transparent 60%),
        linear-gradient(135deg, rgba(255,245,247,0.25) 0%, rgba(245,237,255,0.25) 35%, rgba(230,244,255,0.25) 70%, rgba(255,240,230,0.25) 100%),
        url('/static/mrdoc/preview.png') !important;
    background-size: cover, cover, cover, cover, cover, cover, cover !important;
    background-position: center, center, center, center, center, center, center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    min-height: 100vh;
}

body {
    background: transparent !important;
    position: relative;
}

/* darkmode-js 白色遮罩层透明化，避免遮挡背景图片 */
.darkmode-background {
    background: transparent !important;
}

/* 底层动态彩色气泡（毛玻璃的视觉层次） */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 154, 158, 0.35) 0%, transparent 18%),
        radial-gradient(circle at 70% 60%, rgba(196, 113, 245, 0.3) 0%, transparent 18%),
        radial-gradient(circle at 50% 80%, rgba(106, 214, 253, 0.3) 0%, transparent 20%),
        radial-gradient(circle at 20% 70%, rgba(255, 195, 232, 0.3) 0%, transparent 18%);
    filter: blur(40px);
    animation: glassBubbles 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes glassBubbles {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.85;
    }
    50% {
        transform: translate(40px, -30px) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-30px, 40px) scale(0.95);
        opacity: 0.9;
    }
}

/* ====== 顶部彩色波浪分隔条 ====== */
.cute-wave-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg,
        #ff9a9e 0%, #fad0c4 16%,
        #fbc2eb 32%, #a6c1ee 48%,
        #84fab0 64%, #8fd3f4 80%,
        #ff9a9e 100%);
    background-size: 200% 100%;
    animation: cuteWaveGradient 6s linear infinite;
    box-shadow: 0 2px 8px rgba(255, 154, 158, 0.25);
    z-index: 999;
}

@keyframes cuteWaveGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ====== 阅读进度条 ====== */
.cute-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b9d, #ffc371, #6ad6fd, #c471f5);
    background-size: 200% 100%;
    animation: cuteWaveGradient 4s linear infinite;
    z-index: 10000;
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 6px rgba(255, 107, 157, 0.4);
    border-radius: 0 4px 4px 0;
}

/* ====== 顶部工具栏 毛玻璃 ====== */
.doc-header {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 24px rgba(196, 113, 245, 0.08);
    position: relative;
    z-index: 10;
}

.doc-header .btn {
    border-radius: 8px !important;
    margin: 0 2px !important;
    transition: all 0.3s ease !important;
}

.doc-header .btn:hover {
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.2), rgba(196, 113, 245, 0.2)) !important;
    color: #c471f5 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 113, 245, 0.18);
}

/* ====== 左侧栏 毛玻璃 ====== */
#doc-container-sidebar {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 4px 0 24px rgba(196, 113, 245, 0.06);
    position: relative;
    z-index: 5;
}

/* 文集标题：渐变文字 + 毛玻璃底 */
.project-title {
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.45), rgba(196, 113, 245, 0.45), rgba(106, 214, 253, 0.45)) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    margin: 10px !important;
    text-align: center !important;
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.project-title::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
    animation: cuteShine 3s linear infinite;
    pointer-events: none;
}

@keyframes cuteShine {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.project-title a {
    color: #5a3d7a !important;
    font-weight: 700 !important;
    position: relative;
    z-index: 1;
}

/* 搜索框毛玻璃 */
#doc-search-input {
    border-radius: 20px !important;
    margin: 10px !important;
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
    transition: all 0.3s ease !important;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(196, 113, 245, 0.08);
}

#doc-search-input:focus-within {
    border-color: rgba(196, 113, 245, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(196, 113, 245, 0.15),
                0 4px 16px rgba(196, 113, 245, 0.18) !important;
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.75) !important;
}

.doc-search-input {
    border: none !important;
    background: transparent !important;
    border-radius: 20px !important;
    color: #5a3d7a !important;
}

/* ====== 文档标题 毛玻璃徽章感 ====== */
.doc-info {
    position: relative;
    padding: 24px 0 14px 0;
}

.doc-info h1 {
    font-size: 30px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #ff6b9d 0%, #c471f5 50%, #6ad6fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    position: relative;
    display: inline-block;
    padding: 6px 24px;
    animation: cuteTitleBounce 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    text-shadow: 0 4px 12px rgba(196, 113, 245, 0.15);
}

/* 文档标题下方的毛玻璃徽章 */
.doc-info h1::before {
    content: "📖";
    margin-right: 12px;
    display: inline-block;
    animation: cuteBookWiggle 2.5s ease-in-out infinite;
    font-size: 0.85em;
    vertical-align: middle;
}

.doc-info h1::after {
    content: "✨";
    margin-left: 8px;
    display: inline-block;
    animation: cuteSparkle 1.5s ease-in-out infinite;
    font-size: 0.7em;
    vertical-align: middle;
}

@keyframes cuteTitleBounce {
    0% {
        transform: scale(0.5) translateY(-30px);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) translateY(5px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes cuteBookWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

@keyframes cuteSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 0.7; }
}

.doc-info hr {
    border: none !important;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffc1cc, #c4a6ff, #a6e3f4, transparent);
    margin: 12px 0 !important;
    border-radius: 2px;
}

/* ====== 文档卡通装饰标签 ====== */
.cute-doc-deco {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 14px 0 6px 0;
    animation: cuteFadeInUp 0.8s ease-out 0.2s both;
}

.cute-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 16px;
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    color: #7c4dff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 12px rgba(196, 113, 245, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    cursor: default;
}

.cute-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(196, 113, 245, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.85), rgba(196, 113, 245, 0.85), rgba(106, 214, 253, 0.85)) !important;
    color: white;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* ====== 文档主内容卡 毛玻璃 ====== */
.doc-content {
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0 !important;
    padding: 32px 20px !important;
    box-shadow: none !important;
    transition: none;
    position: relative;
    overflow: visible;
    border: none !important;
}

/* 顶部彩色描边（玻璃折射感） */
.doc-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        #ff9a9e 0%, #fbc2eb 25%,
        #a6c1ee 50%, #84fab0 75%,
        #ff9a9e 100%);
    background-size: 200% 100%;
    animation: cuteWaveGradient 5s linear infinite;
    border-radius: 20px 20px 0 0;
}

/* 高光斜线（玻璃感） */
.doc-content::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 50%;
    height: 200%;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: rotate(20deg);
    pointer-events: none;
    animation: glassShine 8s linear infinite;
}

@keyframes glassShine {
    0% { transform: translateX(-200%) rotate(20deg); }
    100% { transform: translateX(300%) rotate(20deg); }
}

.doc-content:hover {
    box-shadow:
        0 20px 60px rgba(196, 113, 245, 0.18),
        0 8px 20px rgba(255, 154, 158, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    transform: translateY(-2px);
}

/* ====== 文档内标题美化 ====== */
#content h1, #content h2, #content h3,
#content h4, #content h5, #content h6 {
    position: relative;
    padding-left: 0.5em;
    color: #4a3d7a;
}

#content h2 {
    border-left: 5px solid;
    border-image: linear-gradient(180deg, #ff6b9d, #c471f5) 1;
    padding: 10px 0 10px 16px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: all 0.3s ease;
    color: #5a3d7a !important;
}

#content h2:hover {
    background: transparent;
    transform: translateX(4px);
}

#content h3 {
    color: #7c4dff !important;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.12), rgba(196, 113, 245, 0.12));
    padding: 4px 12px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

#content h3::before {
    content: "🌸";
    margin-right: 8px;
    font-size: 0.85em;
    display: inline-block;
    animation: cutePetal 2s ease-in-out infinite;
}

@keyframes cutePetal {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(15deg); }
}

/* ====== 引用块 毛玻璃 ====== */
.markdown-body blockquote {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-left: 4px solid #ff9a9e !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    position: relative;
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.markdown-body blockquote:hover {
    transform: translateX(4px);
    box-shadow: 0 10px 28px rgba(255, 154, 158, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.markdown-body blockquote::before {
    content: "💡";
    position: absolute;
    left: -14px;
    top: 14px;
    background: linear-gradient(135deg, #ff9a9e, #c471f5);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(255, 154, 158, 0.4);
}

/* ====== 代码块美化 ====== */
.markdown-body code {
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.7), rgba(240, 230, 255, 0.7)) !important;
    color: #d63384 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.markdown-body pre {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.markdown-body pre:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18) !important;
}

/* ====== 表格 毛玻璃 ====== */
.markdown-body table {
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.markdown-body table th {
    background: linear-gradient(135deg, #ffd1dc 0%, #e1c4ff 100%) !important;
    color: #5a3d7a !important;
    font-weight: 700 !important;
    border: none !important;
}

.markdown-body table tr:nth-child(even) {
    background-color: rgba(253, 247, 251, 0.7) !important;
}

.markdown-body table tr:hover {
    background: linear-gradient(90deg, rgba(255, 240, 245, 0.8), rgba(245, 237, 255, 0.8)) !important;
    transition: background 0.3s ease;
}

.markdown-body table td {
    border-color: rgba(255, 154, 158, 0.15) !important;
}

/* ====== 链接美化 ====== */
.markdown-body a {
    color: #c471f5 !important;
    text-decoration: none !important;
    border-bottom: 1.5px dashed #c471f5;
    transition: all 0.3s ease;
    position: relative;
    padding: 1px 2px;
}

.markdown-body a:hover {
    color: #ff6b9d !important;
    border-bottom-style: solid;
    border-bottom-color: #ff6b9d;
    background: linear-gradient(180deg, transparent 60%, rgba(255, 107, 157, 0.18) 60%);
    border-radius: 3px;
}

/* ====== 列表美化 ====== */
.markdown-body ul li::marker {
    color: #ff9a9e;
}
.markdown-body ol li::marker {
    color: #c471f5;
    font-weight: 700;
}

/* ====== 文档底部工具栏 毛玻璃 ====== */
#doc-content-bottom-toolbar {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 14px !important;
    padding: 16px 20px !important;
    margin-top: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 6px 20px rgba(196, 113, 245, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.doc-bottom-icon, .doc-bottom-btn {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px !important;
    padding: 6px 14px !important;
    margin-right: 8px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #5a3d7a !important;
    box-shadow: 0 2px 8px rgba(196, 113, 245, 0.08);
}

.doc-bottom-icon:hover, .doc-bottom-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.25);
    color: #ff6b9d !important;
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.7), rgba(196, 113, 245, 0.7)) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

#collect_doc:hover, .collected {
    animation: cuteStarPulse 1s ease-in-out infinite;
}

@keyframes cuteStarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

#doc-content-bottom-toolbar .doc-bottom-icon i,
#doc-content-bottom-toolbar .doc-bottom-btn i {
    color: #c471f5;
    transition: transform 0.3s ease, color 0.3s ease;
}

#doc-content-bottom-toolbar .doc-bottom-icon:hover i,
#doc-content-bottom-toolbar .doc-bottom-btn:hover i {
    transform: scale(1.2) rotate(10deg);
    color: white !important;
}

/* ====== 翻页按钮 毛玻璃 ====== */
.page-flip {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 14px !important;
    margin-top: 22px !important;
    padding: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 6px 20px rgba(196, 113, 245, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.page-flip a, .page-flip button {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
    color: #5a3d7a !important;
    border-radius: 20px !important;
    padding: 6px 18px !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) !important;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(196, 113, 245, 0.08);
}

.page-flip a:hover {
    transform: translateY(-2px) scale(1.05);
    background: linear-gradient(135deg, #ff9a9e, #c471f5) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 24px rgba(196, 113, 245, 0.4);
}

.page-flip a:first-child:hover i {
    animation: cuteArrowLeft 0.6s ease infinite;
}
.page-flip a:last-child:hover i {
    animation: cuteArrowRight 0.6s ease infinite;
}

@keyframes cuteArrowLeft {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
}
@keyframes cuteArrowRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* ====== 右侧悬浮工具按钮 毛玻璃 ====== */
.fixed-tool-bar > div {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 24px rgba(196, 113, 245, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) !important;
    color: #c471f5 !important;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.fixed-tool-bar > div::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, #ff9a9e, #c471f5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    opacity: 0;
    z-index: 0;
}

.fixed-tool-bar > div:hover::before {
    width: 100%;
    height: 100%;
    opacity: 1;
}

.fixed-tool-bar > div:hover {
    transform: translateY(-4px) scale(1.08);
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 12px 32px rgba(196, 113, 245, 0.4) !important;
}

.fixed-tool-bar > div i {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.fixed-tool-bar > div:hover i {
    color: white !important;
}

/* ====== 浮动装饰元素（毛玻璃气泡） ====== */
.cute-floating-deco {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    font-size: 28px;
    opacity: 0.5;
    filter: drop-shadow(0 4px 8px rgba(196, 113, 245, 0.2));
    animation: cuteFloatAround 15s ease-in-out infinite;
}

.cute-floating-deco.d1 { top: 15%; right: 5%; animation-delay: 0s; }
.cute-floating-deco.d2 { top: 35%; left: 2%; animation-delay: -3s; animation-duration: 18s; }
.cute-floating-deco.d3 { top: 55%; right: 3%; animation-delay: -6s; animation-duration: 20s; }
.cute-floating-deco.d4 { top: 75%; left: 4%; animation-delay: -9s; animation-duration: 22s; }

@keyframes cuteFloatAround {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(15deg);
    }
    50% {
        transform: translate(-15px, -20px) rotate(-10deg);
    }
    75% {
        transform: translate(-25px, 20px) rotate(20deg);
    }
}

/* ====== 文档目录（左侧边栏）毛玻璃 ====== */
#doc-container-sidebar .sidebar {
    position: relative !important;
    width: 100% !important;
    right: auto !important;
    top: auto !important;
    max-height: none !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none !important;
    padding: 10px 10px 14px !important;
    font-size: 14px !important;
    margin: 0;
    border-top: 1px solid rgba(196, 113, 245, 0.18) !important;
    border-radius: 10px !important;
    animation: cuteFadeInUp 0.6s ease-out 0.4s both;
}

#doc-container-sidebar .sidebar .markdown-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#doc-container-sidebar .sidebar .markdown-toc-list li {
    list-style: none !important;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 5px 8px;
    border-radius: 8px;
    transition: all 0.25s ease;
}

#doc-container-sidebar .sidebar .markdown-toc-list li:hover {
    background: linear-gradient(90deg, rgba(255, 154, 158, 0.18), rgba(196, 113, 245, 0.18));
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(196, 113, 245, 0.15);
}

#doc-container-sidebar .sidebar .markdown-toc-list li.active {
    background: linear-gradient(90deg, rgba(255, 154, 158, 0.25), rgba(196, 113, 245, 0.25));
    border-left: 3px solid #ff6b9d;
    padding-left: 5px;
}

#doc-container-sidebar .sidebar .markdown-toc-list a {
    color: #5a3d7a;
    text-decoration: none;
    display: block;
    font-size: 13px;
}

#doc-container-sidebar .sidebar .markdown-toc-list li.active a {
    color: #ff6b9d;
    font-weight: 700;
}

#doc-container-sidebar .sidebar .markdown-toc-list a.h1-link,
#doc-container-sidebar .sidebar .markdown-toc-list a.h2-link {
    font-weight: 600;
}

#doc-container-sidebar .sidebar .markdown-toc-list a.h3-link,
#doc-container-sidebar .sidebar .markdown-toc-list a.h4-link,
#doc-container-sidebar .sidebar .markdown-toc-list a.h5-link,
#doc-container-sidebar .sidebar .markdown-toc-list a.h6-link {
    padding-left: 10px;
    color: #7c4dff;
    font-size: 12.5px;
}

#doc-container-sidebar .sidebar .markdown-toc-list a.h4-link,
#doc-container-sidebar .sidebar .markdown-toc-list a.h5-link,
#doc-container-sidebar .sidebar .markdown-toc-list a.h6-link {
    padding-left: 22px;
    color: #9575cd;
    font-size: 12px;
}

/* ====== HR 彩虹线 ====== */
.markdown-body hr {
    border: none !important;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffc1cc, #c4a6ff, #a6e3f4, transparent);
    margin: 30px 0 !important;
    border-radius: 2px;
    position: relative;
}

.markdown-body hr::after {
    content: "🌈";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    padding: 0 12px;
    font-size: 18px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(196, 113, 245, 0.2);
}

/* ====== 子文档列表美化 ====== */
.markdown-body li a {
    color: #c471f5 !important;
    transition: all 0.3s ease;
    border-bottom: 1px dashed transparent !important;
}

.markdown-body li a:hover {
    color: #ff6b9d !important;
    border-bottom-color: #ff6b9d !important;
    padding-left: 4px;
}

/* ====== 入场动画 ====== */
@keyframes cuteFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-content {
    animation: cuteFadeInUp 0.6s ease-out;
}

#doc-content-bottom-toolbar {
    animation: cuteFadeInUp 0.8s ease-out;
}

/* ====== 响应式适配 ====== */
@media screen and (max-width: 768px) {
    .doc-info h1 {
        font-size: 24px !important;
    }
    .doc-info h1::before, .doc-info h1::after {
        font-size: 0.8em;
    }
    .doc-content {
        padding: 20px 18px !important;
        border-radius: 14px !important;
    }
    .cute-floating-deco {
        font-size: 20px;
    }
    body::before {
        filter: blur(25px);
    }
}

/* ====== 浏览器降级（不支持 backdrop-filter） ====== */
@supports not (backdrop-filter: blur(10px)) {
    .doc-content,
    .doc-header,
    #doc-container-sidebar,
    #doc-content-bottom-toolbar,
    .page-flip,
    .fixed-tool-bar > div,
    .project-title,
    #doc-search-input,
    .cute-tag,
    .doc-bottom-icon,
    .doc-bottom-btn,
    .page-flip a,
    .page-flip button,
    #doc-container-sidebar .sidebar,
    .markdown-body blockquote,
    .markdown-body table {
        background: rgba(255, 255, 255, 0.92) !important;
    }
}

/* ====== 打印优化 ====== */
@media print {
    body::before, body::after {
        display: none !important;
    }
    .cute-wave-bar,
    .cute-progress-bar,
    .cute-floating-deco,
    #doc-container-sidebar {
        display: none !important;
    }
    .doc-content,
    #doc-content-bottom-toolbar,
    .page-flip {
        background: white !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }
}