/* ==========================================================================
 * site-modern.css —— 站点现代化视觉改版（覆盖样式）
 * --------------------------------------------------------------------------
 * 用途：在不改动 Docsify 本体与书签插件的前提下，把 vue 主题的默认观感
 *       升级为简洁、现代的浅色风格，与品牌绿 #00c853 呼应。
 *
 * 引入要求（关键）：本文件必须在 index.html 中排在
 *       docsify vue.css 之后、bookmarks-plugin.css 之后引入，
 *       绝大多数覆盖靠「同等优先级 + 加载顺序靠后」生效；
 *       只有极少数与插件内联样式冲突的地方用了 !important（已逐处注释）。
 *
 * 维护方法：
 *   - 改配色：先改下面 :root 里的变量，再检查文件内少量硬编码的同色值。
 *   - 类名来源：Docsify 部分以官方 vue.css 4.13.1 实际选择器为准；
 *     书签插件部分以 bookmarks-plugin.css / 插件 JS 注入的类名为准
 *     （bm- 前缀全集：bm-root/bm-fabs/bm-btn/bm-btn-save/bm-btn-list/
 *       bm-btn-saved/bm-count/bm-banner/bm-banner-text/bm-banner-go/
 *       bm-banner-close/bm-toast/bm-overlay/bm-drawer/bm-open/
 *       bm-drawer-head/bm-drawer-close/bm-drawer-body/bm-drawer-foot/
 *       bm-auto-toggle/bm-empty/bm-item/bm-item-main/bm-item-title/
 *       bm-item-pos/bm-item-meta/bm-item-del）。
 *   - 插件的定位逻辑（fixed/top/bottom/transform/translateX 等）一律不动，
 *     本文件只调整颜色、圆角、阴影、间距、字体等外观属性；浮动按钮与
 *     横幅的 hover 位移是纯视觉效果，不影响定位。
 *   - 本样式按浅色主题调校；站点若切换 docsify-darklight 的深色模式，
 *     深色观感不在本文件覆盖范围内。
 * ========================================================================== */

:root {
  --sm-green: #00c853;         /* 品牌绿 */
  --sm-green-deep: #00a344;    /* 链接/强调文字用的深一号绿（白底对比度更好） */
  --sm-green-dark: #0a7d3b;     /* 行内 code 等小字绿 */
  --sm-green-soft: #e8f9ee;     /* 激活态浅绿底 */
  --sm-green-softer: #f0faf3;   /* 表头/hover 极浅绿底 */
  --sm-ink: #1f2328;            /* 正文主色 */
  --sm-ink-strong: #11181f;     /* 标题色 */
  --sm-ink-sub: #43505c;        /* 侧边栏/次级文字 */
  --sm-ink-mute: #8a94a0;       /* 弱化文字 */
  --sm-line: #eef1ee;           /* 浅分隔线 */
  --sm-line-2: #e3eae3;         /* 稍深的边框线 */
  --sm-shadow-img: 0 4px 18px rgba(16, 42, 24, 0.08);
  --sm-shadow-float: 0 8px 24px rgba(16, 42, 24, 0.13);
  --sm-shadow-pop: 0 12px 32px rgba(16, 42, 24, 0.16);
  --sm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans SC", sans-serif;
  --sm-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
    Menlo, Consolas, "Roboto Mono", monospace;
}

/* --------------------------------------------------------------------------
 * 1. 全局字体与质感
 * ------------------------------------------------------------------------ */

body {
  font-family: var(--sm-font);
  color: var(--sm-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(0, 200, 83, 0.22);
}

/* 键盘焦点：统一的绿色描边，低调但可见 */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(0, 200, 83, 0.55);
  outline-offset: 2px;
}

/* 顶部加载进度条：与品牌绿对齐（vue 主题默认取 --theme-color，此处兜底） */
.progress {
  background-color: var(--sm-green);
  height: 3px;
}

/* --------------------------------------------------------------------------
 * 2. 正文区（.markdown-section）
 * ------------------------------------------------------------------------ */

.markdown-section {
  max-width: 860px;
  padding: 38px 28px 72px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--sm-ink);
}

/* 标题层级：克制的字重与间距，h2 用一条浅色发丝线收尾 */
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section h6 {
  color: var(--sm-ink-strong);
  font-family: var(--sm-font);
}

.markdown-section h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 1.1rem;
}

.markdown-section h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin: 2.4em 0 0.9em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--sm-line);
}

.markdown-section h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  margin: 2em 0 0.7em;
}

.markdown-section h4 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 1.7em 0 0.6em;
}

.markdown-section strong {
  color: var(--sm-ink-strong);
  font-weight: 700;
}

.markdown-section p,
.markdown-section ul,
.markdown-section ol {
  line-height: 1.75;
}

/* 链接：默认无下划线，hover 时带自然的偏移下划线 */
.markdown-section a {
  color: var(--sm-green-deep);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.markdown-section a:hover {
  color: var(--sm-green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* 标题里的锚点链接继承标题颜色，别被上面的链接绿带偏 */
.markdown-section h1 a,
.markdown-section h2 a,
.markdown-section h3 a,
.markdown-section h4 a {
  color: inherit;
  font-weight: inherit;
}

.markdown-section h1 a:hover,
.markdown-section h2 a:hover,
.markdown-section h3 a:hover,
.markdown-section h4 a:hover {
  color: var(--sm-green-deep);
  text-decoration: none;
}

.markdown-section hr {
  border-bottom-color: var(--sm-line);
  margin: 2.4em 0;
}

/* 图片：圆角 + 轻阴影 + 浅边框；emoji 是行内小图，不套卡片感 */
.markdown-section img:not(.emoji) {
  border-radius: 10px;
  border: 1px solid var(--sm-line);
  box-shadow: var(--sm-shadow-img);
}

/* 引用块：浅绿底 + 左侧 3px 绿条 + 圆角（vue 默认是 4px 纯色边、无底色） */
.markdown-section blockquote {
  background: #f4fbf6;
  border-left: 3px solid var(--sm-green);
  border-radius: 0 10px 10px 0;
  color: #3d4752;
  margin: 1.6em 0;
  padding: 0.9em 1.2em;
}

.markdown-section blockquote p {
  font-weight: 400;
  margin: 0.4em 0;
}

/* Docsify 的 warn 提示段落顺手现代化（tip 的红色语义保持不动） */
.markdown-section p.warn {
  background: var(--sm-green-softer);
  border-radius: 10px;
  padding: 1em 1.2em;
}

/* 表格：圆角外框（table 自身 display:block + overflow:auto，圆角可裁切），
 * 表头浅绿底，斑马纹压到极浅，字号略收 */
.markdown-section table {
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--sm-line-2);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(16, 42, 24, 0.04);
}

.markdown-section th {
  background: var(--sm-green-softer);
  color: var(--sm-ink-strong);
  font-weight: 700;
  text-align: left;
}

.markdown-section td,
.markdown-section th {
  border-color: #e9efe9;
  padding: 8px 14px;
}

.markdown-section tr {
  border-top-color: #e9efe9;
}

.markdown-section tr:nth-child(2n) {
  background-color: #fbfdfb;
}

/* 代码：行内 code 换掉 vue 主题的橙字，改浅绿底 + 深绿字 */
.markdown-section code {
  font-family: var(--sm-mono);
  background-color: #edf7f0;
  color: var(--sm-green-dark);
  border-radius: 5px;
  padding: 2px 6px;
  margin: 0 1px;
}

/* 代码块：底色与语法高亮沿用主题，只做圆角、边框、阴影与内边距 */
.markdown-section pre {
  border-radius: 12px;
  border: 1px solid #edf0ed;
  box-shadow: 0 2px 12px rgba(16, 42, 24, 0.05);
  padding: 6px 10px;
  margin: 1.4em 0;
}

.markdown-section pre > code {
  font-family: var(--sm-mono);
  background: transparent;
  border-radius: 0;
  margin: 0;
}

/* pre 右上角的语言标签（vue 主题用 pre:after 显示 data-lang）弱化一点 */
.markdown-section pre:after {
  color: #b6bfb8;
  font-family: var(--sm-mono);
}

/* 键盘按键与任务列表复选框的小现代化 */
.markdown-section kbd {
  border-color: var(--sm-line-2);
  border-radius: 6px;
  box-shadow: 0 1px 0 var(--sm-line-2);
  background: #fbfcfb;
}

.markdown-section input[type="checkbox"] {
  accent-color: var(--sm-green);
}

/* --------------------------------------------------------------------------
 * 3. 侧边栏
 * ------------------------------------------------------------------------ */

.sidebar {
  background: #fbfcfb;
  border-right: 1px solid var(--sm-line);
  color: var(--sm-ink-sub);
  padding-top: 30px;
}

/* 站点名（vue 主题里是 .sidebar > h1，字重 300，这里收紧为现代标题感） */
.sidebar > h1,
.sidebar .app-name {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--sm-ink-strong);
  margin-bottom: 1.2rem;
}

.sidebar > h1 a,
.sidebar .app-name .app-name-link {
  color: inherit;
}

/* 细滚动条：默认就可见但很浅（vue 默认藏起来 hover 才显形） */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #d9e3da;
  border-radius: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: #c3d2c5;
}

.sidebar .sidebar-nav {
  line-height: 1.55;
  padding-bottom: 48px;
}

/* 分组小标题 */
.sidebar li > p {
  color: var(--sm-ink-strong);
  font-weight: 700;
  font-size: 14.5px;
  margin-top: 16px;
  padding-left: 10px;
}

/* 导航链接：胶囊化，hover 浅绿底，激活项绿字 + 浅绿底（去掉 vue 的右侧竖线） */
.sidebar ul li a {
  font-size: 14.5px;
  color: var(--sm-ink-sub);
  padding: 4px 10px;
  margin-right: 14px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar ul li a:hover {
  background: #eef8f1;
  color: var(--sm-green-dark);
  text-decoration: none;
}

.sidebar ul li.active > a {
  background: var(--sm-green-soft);
  color: var(--sm-green-deep);
  font-weight: 600;
  border-right: none;
}

/* 子目录前面的 "-" 引导符弱化 */
.app-sub-sidebar li:before {
  color: #bcc8bd;
}

/* 侧边栏折叠按钮：从整条半透明长条改成左下角白色圆形浮动按钮。
 * vue 主题桌面宽 284px、收起（body.close）时 width:auto、移动端另有规则，
 * 这里逐一同名覆盖；不改它的 position/bottom/left 定位方式。 */
.sidebar-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 0 14px 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: var(--sm-shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.close .sidebar-toggle {
  width: 44px;
}

.sidebar-toggle span {
  background-color: var(--sm-green);
}

.sidebar-toggle span:last-child {
  margin-bottom: 0;
}

.sidebar-toggle:hover .sidebar-toggle-button {
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
 * 4. 搜索框（Docsify search 插件，位于侧边栏顶部）
 * ------------------------------------------------------------------------ */

.sidebar .search {
  border-bottom: 1px solid var(--sm-line);
  padding: 4px 16px 14px;
  margin-bottom: 6px;
}

.sidebar .search .input-wrap {
  display: flex;
  align-items: center;
}

.sidebar .search input {
  width: 100%;
  border: 1px solid var(--sm-line-2);
  border-radius: 10px;
  background: #ffffff;
  padding: 9px 12px;
  font-family: var(--sm-font);
  font-size: 14px;
  color: var(--sm-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar .search input::placeholder {
  color: var(--sm-ink-mute);
}

.sidebar .search input:focus {
  border-color: var(--sm-green);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

.sidebar .search .results-panel {
  padding-top: 6px;
}

.sidebar .search .matching-post {
  border-bottom: 1px solid #f0f3f0;
  padding: 10px 2px;
}

.sidebar .search .matching-post h2 {
  font-size: 15px;
  color: var(--sm-ink-strong);
  margin: 0 0 4px;
}

.sidebar .search .matching-post p {
  font-size: 13px;
  color: #6b7684;
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------------------------------
 * 5. 顶部导航与分页
 * ------------------------------------------------------------------------ */

.app-nav a {
  font-size: 15px;
  color: var(--sm-ink-sub);
}

.app-nav a:hover,
.app-nav a.active {
  color: var(--sm-green-deep);
}

.app-nav li ul {
  border-color: var(--sm-line-2);
  border-radius: 12px;
  box-shadow: var(--sm-shadow-float);
  padding: 8px 0;
}

/* 上一篇/下一篇：胶囊按钮（类名来自 docsify-pagination 插件） */
.docsify-pagination-container {
  gap: 14px;
  flex-wrap: wrap;
}

.docsify-pagination-container .pagination-item {
  border: 1px solid var(--sm-line-2);
  border-radius: 999px;
  background: #ffffff;
  padding: 10px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docsify-pagination-container .pagination-item:hover {
  border-color: var(--sm-green);
  box-shadow: var(--sm-shadow-img);
}

.docsify-pagination-container .pagination-item-label {
  color: var(--sm-ink-mute);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.docsify-pagination-container .pagination-item-title {
  color: var(--sm-ink-strong);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
 * 6. 书签插件现代化（类名已逐一核对插件 CSS 与 JS 注入的 DOM）
 *    只改外观；fixed 定位、transform 滑入逻辑等一律不动。
 * ------------------------------------------------------------------------ */

.bm-root {
  font-family: var(--sm-font);
  color: var(--sm-ink);
}

/* 右下角浮动按钮：主操作（收藏）绿底白字胶囊，次操作（书签列表）白底绿字 */
.bm-fabs {
  gap: 10px;
}

.bm-btn {
  border: 1px solid var(--sm-line-2);
  border-radius: 999px;
  background: #ffffff;
  color: var(--sm-ink);
  font-family: var(--sm-font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  box-shadow: var(--sm-shadow-float);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease, border-color 0.18s ease;
}

.bm-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--sm-shadow-pop);
  background: #ffffff;
  border-color: var(--sm-green);
}

.bm-btn.bm-btn-save {
  background: var(--sm-green);
  border-color: var(--sm-green);
  color: #ffffff;
}

.bm-btn.bm-btn-save:hover {
  background: #00b34a;
  border-color: #00b34a;
}

/* 已收藏状态：插件给保存按钮加 .bm-btn-saved，改回浅绿底深绿字以便区分 */
.bm-btn.bm-btn-saved {
  background: var(--sm-green-soft);
  border-color: #bfe9cd;
  color: var(--sm-green-dark);
}

.bm-btn.bm-btn-list {
  color: var(--sm-green-deep);
}

.bm-count {
  font-weight: 700;
}

/* 顶部横幅：插件本就是居中浮动定位，这里把深色整条改成白底胶囊 + 阴影 */
.bm-banner {
  background: #ffffff;
  color: var(--sm-ink);
  border: 1px solid var(--sm-line);
  border-radius: 999px;
  padding: 7px 8px 7px 18px;
  box-shadow: var(--sm-shadow-pop);
  font-size: 14px;
}

.bm-banner-go {
  background: var(--sm-green);
  color: #ffffff;
  font-family: var(--sm-font);
  font-weight: 600;
  padding: 7px 16px;
  transition: background-color 0.15s ease;
}

.bm-banner-go:hover {
  background: #00b34a;
}

.bm-banner-close {
  color: var(--sm-ink-mute);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.bm-banner-close:hover {
  background: #f2f5f2;
  color: var(--sm-ink);
}

/* 自动恢复 toast：样式由插件 JS 内联写死（深色底），
 * 这里用少量 !important 把它翻成与横幅一致的白底胶囊。 */
.bm-toast {
  background: #ffffff !important;
  color: var(--sm-ink) !important;
  border: 1px solid var(--sm-line);
  border-radius: 999px !important;
  box-shadow: var(--sm-shadow-pop) !important;
  padding: 9px 20px !important;
  font-family: var(--sm-font);
}

/* 遮罩：轻微加深 + 一点模糊，抽屉浮起感更强（仅外观） */
.bm-overlay {
  background: rgba(17, 24, 20, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* 抽屉：左侧大圆角 + 更柔和的投影，内部三段式排版收紧 */
.bm-drawer {
  border-radius: 20px 0 0 20px;
  box-shadow: -12px 0 40px rgba(16, 42, 24, 0.18);
  overflow: hidden;
  font-family: var(--sm-font);
}

.bm-drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--sm-line);
  font-size: 16px;
  color: var(--sm-ink-strong);
}

.bm-drawer-close {
  color: #57606a;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.bm-drawer-close:hover {
  background: #f2f5f2;
  color: var(--sm-ink);
}

.bm-drawer-body {
  padding: 14px 16px 24px;
}

.bm-drawer-body::-webkit-scrollbar {
  width: 6px;
}

.bm-drawer-body::-webkit-scrollbar-thumb {
  background: #d9e3da;
  border-radius: 6px;
}

.bm-drawer-foot {
  background: #fbfcfb;
}

.bm-auto-toggle {
  accent-color: var(--sm-green);
  width: 16px;
  height: 16px;
}

.bm-empty {
  color: var(--sm-ink-mute);
  text-align: center;
  padding: 30px 12px;
  font-size: 14px;
}

/* 书签列表项：卡片化（浅边框、圆角、极轻投影，hover 绿边 + 浮起阴影） */
.bm-item {
  border: 1px solid #e9efe9;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(16, 42, 24, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bm-item:hover {
  border-color: var(--sm-green);
  box-shadow: 0 6px 16px rgba(16, 42, 24, 0.08);
}

.bm-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sm-ink-strong);
}

.bm-item-pos {
  font-size: 13px;
  font-weight: 500;
  color: var(--sm-green-deep);
}

.bm-item-meta {
  font-size: 12px;
  color: #9aa4ad;
}

.bm-item-del {
  color: #c4ccd2;
  transition: color 0.15s ease;
}

.bm-item-del:hover {
  color: #e5484d;
}

/* --------------------------------------------------------------------------
 * 7. 移动端（<=768px，与 vue 主题的断点保持一致）
 * ------------------------------------------------------------------------ */

@media (max-width: 768px) {
  .markdown-section {
    max-width: 100%;
    padding: 24px 18px 56px;
    font-size: 15.5px;
  }

  .markdown-section h1 {
    font-size: 26px;
  }

  .markdown-section h2 {
    font-size: 21px;
  }

  .markdown-section h3 {
    font-size: 17px;
  }

  .markdown-section table {
    font-size: 13.5px;
  }

  .markdown-section pre {
    padding: 4px 6px;
    border-radius: 10px;
  }

  /* 折叠按钮：压过 vue 移动端 body.close 时的 284px 宽长条规则 */
  .sidebar-toggle,
  body.close .sidebar-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0 0 12px 12px;
    background: #ffffff;
  }

  /* 书签浮动按钮略收紧，避免遮挡正文（定位仍由插件控制） */
  .bm-btn {
    padding: 9px 15px;
    font-size: 13.5px;
  }

  .bm-banner {
    font-size: 13px;
    padding-left: 14px;
  }

  /* 窄屏抽屉接近全宽，左侧圆角收小更协调 */
  .bm-drawer {
    border-radius: 16px 0 0 16px;
  }
}
