/* ================= 🌗 全站 CSS 变量主题色阶底座 ================= */
:root {
    --app-bg: #f9fafb;       /* bg-gray-50 */
    --card-bg: #ffffff;      /* 纯白 */
    --card-border: #f3f4f6;  /* border-gray-100 */
    --text-main: #1f2937;    /* text-gray-800 */
    --text-muted: #9ca3af;   /* text-gray-400 */
    --input-border: #e5e7eb; /* border-gray-200 */
}

/* 🌟 极致深邃黑——平替原本发亮的深蓝色阶 */
html.dark {
    --app-bg: #050505;       /* 极致极夜黑底 */
    --card-bg: #121212;      /* 黑耀石低亮卡片 */
    --card-border: #1C1C1C;  /* 暗夜细腻灰边 */
    --text-main: #d1d5db;    /* 温润月影白（稍微调柔和了一点，不刺眼） */
    --text-muted: #4b5563;   /* 幽暗沉寂灰 */
    --input-border: #1f2937; /* 输入框暗边 */
    color-scheme: dark;      /* 系统滚动条漆黑 */
}

/* 注入核心动态样式绑定 */
body { background-color: var(--app-bg) !important; color: var(--text-main) !important; -webkit-overflow-scrolling: touch; transition: background-color 0.3s, color 0.3s; }

/* 🚀 核心锁：当 body 挂载 no-transitions 时，瞬间剥离全局一切过渡，让拖拽 100% 跟手 */
body.no-transitions, 
body.no-transitions *, 
body.no-transitions *::before, 
body.no-transitions *::after {
    transition: none !important;
    transition-duration: 0s !important;
    animation: none !important;
}
.theme-card { background-color: var(--card-bg) !important; border-color: var(--card-border) !important; transition: background-color 0.3s, border-color 0.3s; }
.theme-text-muted { color: var(--text-muted) !important; }
.tag-node { margin-left: 8px; border-left: 1px dashed var(--card-border); padding-left: 4px; }


/* 🌟 Markdown 排版深度夜间美化补丁 */
#memoList p { margin-bottom: 0.25rem; }
#memoList p:last-child { margin-bottom: 0; }
#memoList strong { font-weight: 700; color: var(--text-main); }
#memoList em { font-style: italic; }
#memoList del { color: var(--text-muted); }

#memoList :not(pre) > code {
    background-color: #f3f4f6;
    color: #ef4444;
    padding: 0.15rem 0.35rem;
    border-radius: 0.375rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
}
html.dark #memoList :not(pre) > code {

    background-color: #1f2937; 
    color: #f87171;
}
/* 多行代码块（```）：和笔记（markdown-theme.css）一样的深色代码块、右上角「复制代码」、高亮行、diff 着色；
   语法高亮用笔记同一套 Prism（memo.js 有带语言的代码块时才加载） */
.code-block-wrapper { position: relative; margin: 0.75rem 0; white-space: normal; }
.code-block-wrapper pre,
.code-block-wrapper pre[class*=language-] {
    background: #111827; color: #f9fafb; margin: 0;
    padding: 2.4em 1.2em 1.2em; border-radius: 8px;  /* 上边留出「复制代码」按钮的位置，窄屏不压字 */
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: calc(13px * var(--ap-scale, 1)); line-height: 1.6;
    white-space: pre-wrap; word-break: break-all; max-width: 100%; overflow-x: hidden;
}
.code-block-wrapper pre code,
.code-block-wrapper code[class*=language-] {
    background: none !important; color: inherit !important; padding: 0 !important; border: none; border-radius: 0;
    font-family: inherit; font-size: inherit; line-height: inherit; white-space: pre-wrap; word-break: break-all;
}
.code-block-wrapper .copy-code-btn {
    position: absolute; top: 0.6em; right: 0.6em; z-index: 1;
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: #9ca3af;
    border-radius: 4px; padding: 0.2em 0.6em; font-size: calc(11px * var(--ap-scale, 1)); line-height: 1.5;
    cursor: pointer; transition: all 0.2s; user-select: none;
}
.code-block-wrapper .copy-code-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.code-block-wrapper mark.line-highlight { display: block; min-height: 1.6em; background: rgba(255, 255, 255, 0.15); color: inherit; margin: 0 -1.2em; padding: 0 1.2em; }
.code-block-wrapper .diff-line { display: block; min-height: 1.6em; }
.code-block-wrapper .diff-line.diff-add { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.code-block-wrapper .diff-line.diff-remove { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* 媒体嵌入（同笔记）：![[音视频]]、!(B站 / YouTube / 链接卡片) */
.md-video { display: block; width: 100%; max-height: 70vh; margin: 0.5rem 0; border-radius: 8px; background: #000; }
.md-audio { display: block; width: 100%; margin: 0.5rem 0; }
.embed-responsive { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; margin: 0.75rem 0; background: #000; white-space: normal; }
.embed-responsive iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.link-card-mini {
    display: inline-flex; align-items: center; gap: 0.4em; max-width: 100%; vertical-align: middle;
    padding: 0.2em 0.6em; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;
    font-size: calc(13px * var(--ap-scale, 1)); color: #15803d; text-decoration: none;
}
.link-card-mini:hover { border-color: #16a34a; }
.link-card-mini .link-card-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
html.dark .link-card-mini { background: #111827; border-color: #1f2937; color: #4ade80; }

/* 📊 黑夜模式专属的低亮度热力图未打卡空格子 */
html.dark .bg-gray-100 { background-color: #1f2937 !important; }

#purePreviewModal {
    background-color: var(--card-bg) !important; border-color: var(--card-border) !important; 
}

/* 💡 极简动态命令提示框 */
.cmd-preview-tip { font-size: 0.82rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 8px; background: #fbfcb54d; padding: 10px 12px; border-radius: var(--radius); border: 1px dashed #cfb22a; overflow-x: auto; font-family: monospace; transition: all 0.3s; }
.cmd-preview-tip.active { background: #f0fdf4; border-color: var(--accent-green); color: #111; }

/* <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-black"><path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" /></svg> 半透明浮动通知 */
#toast-container { position: fixed; top: 15px; right: 15px; z-index: 1000; max-width: calc(100% - 30px); }
.toast { padding: 10px 16px; margin-bottom: 8px; border-radius: var(--radius); color: var(--text-main); font-size: 0.88rem; font-weight: 500; background: #fff; border: 1px solid var(--border-color); box-shadow: 0 6px 16px rgba(140,149,159,0.15); opacity: 0.98; transition: all 0.3s; border-left: 4px solid var(--accent-blue); }
.toast-success { border-left-color: var(--accent-green); }
.toast-error { border-left-color: var(--accent-red); }

/* 🚀 极其关键：将画廊大图放入独立的合成图层，强制开启 3D 渲染加速 */
#previewCanvasOuter img,
#purePreviewModal img,
[id^="gallery-slide-"] img {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;

    touch-action: none !important; 
}

/* ========================================================
   ⚡ 极简硬核流：全站动画/过渡绝对切除
   ======================================================== */

/* 1. 锁死全站一切元素的过渡动画、关键帧动画与变色渐变 */
*, *::before, *::after {
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation: none !important;
    animation-duration: 0s !important;
}

/* 2. 彻底干掉移动端下拉屏幕时的“橡皮筋回弹”和“阻尼粘滞感” */
html, body {
    overscroll-behavior-y: none !important; /* 锁死上下拉网页时的系统回弹抖动 */
    -webkit-overflow-scrolling: auto !important; /* 切回普通滚动，禁用 iOS 极其吃内存的弹性平滑滚动 */
}

/* 3. 锁死大图弹窗、预览弹窗的淡入淡出、缩放效果 */
#themeModal, 
#purePreviewModal, 
[id^="action-dropdown-"],
.modal, 
.fade, 
.show {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    opacity: 1 !important; /* 让弹窗和下拉菜单瞬间出现，不走渐变 */
}

/* 4. 彻底禁掉所有图片在悬停时的 opacity 渐变，瞬间亮起 */
#memoList img, 
#imagePreQueue img, 
.preview-canvas-img {
    transition: none !important;
    opacity: 1 !important;
}


/* ========================================================
   🚫 隐藏全站原生上下滚动条，同时保持滚轮/触控滚动功能
   ======================================================== */

/* 1. 隐藏 PC 端浏览器（Chrome, Safari, Edge, 移动端 iOS/Android）的原生滚动条 */
*::-webkit-scrollbar {
    display: none !important; /* 核心：直接不渲染滚动条轨道和滑块 */
    width: 0 !important;      /* 宽度归零 */
    height: 0 !important;     /* 高度归零 */
}

/* 2. 针对 Firefox 浏览器的兼容隐藏方案 */
* {
    scrollbar-width: none !important; /* 强行关闭火狐的滚动条 */
}

/* 3. 针对旧版 IE 和 Edge 浏览器的兼容隐藏方案 */
* {
    -ms-overflow-style: none !important; 
}
/* 📖 阅览模式：正文 + 配图连续阅读 */
.pure-reader { font-size: calc(16px * var(--ap-scale, 1)); line-height: 1.85; }
.pure-reader p { margin: 0 0 .8em; }
.pure-reader img { max-width: 100%; height: auto; border-radius: 10px; }
.pure-reader-images { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pure-reader-images:empty { display: none; }
.pure-reader-images img { display: block; width: 100%; height: auto; border-radius: 12px; cursor: zoom-in;
    background: rgba(148, 163, 184, .12); }
