/* ==============================================================
   博客全局样式 - styles.css
   ==============================================================
   本文件定义博客前台页面的全局视觉样式，包括：
     - 全屏背景图片（响应式多分辨率）
     - 博客卡片流布局
     - 文章详情页样式（blog--article）
     - 评论区样式
     - 返回按钮（back-btn）和主题切换按钮（theme）
     - 社交按钮和底部栏
     - 卡片样式（card-article, card-quote, sidebar-card）
     - 博文排版系统（docs-layout）
     - 暗黑模式覆盖（MD1 Dark Theme）

   【引用方式】
   在所有博客页面的 <head> 中引入（必须在 MDL 主题 CSS 之后）：
     根目录页面: <link rel="stylesheet" href="styles.css">
     file/ 子页面: <link rel="stylesheet" href="../styles.css">

   【加载顺序要求】
     1. Google Fonts (Roboto, Material Icons)
     2. MDL 主题 CSS (lib/mdl/material-themes-xxx.css)
     3. 本文件 (styles.css)
   ============================================================== */

/* ==== 全屏背景图片 ==== */
/* 使用 body::before 伪元素实现全屏固定背景，不影响 body 内容层 */
body::before {
    background-size: cover;
    background-attachment: fixed;
    content: '';
    will-change: transform;
    z-index: -1;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    position: fixed;
}

/* 根据不同的屏幕尺寸和像素密度设置响应式背景图片 */
/* 小屏 (≤512px 1.5x / ≤1024px 1x) */
@media (max-width: 512px)  and (-webkit-min-device-pixel-ratio: 1.5),
       (max-width: 512px)  and (min-resolution: 1.5dppx),
       (max-width: 1024px) and (-webkit-max-device-pixel-ratio: 1.5),
       (max-width: 1024px) and (max-resolution: 1.5dppx) {
  body::before {
    background-image: url('images/mountain.jpg');
  }
}

/* 中屏 (513-1024px 1.5x / 1025-2048px 1x) */
@media (min-width: 513px)  and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 1.5),
       (min-width: 513px)  and (max-width: 1024px) and (min-resolution: 1.5dppx),
       (min-width: 1025px) and (max-width: 2048px) and (-webkit-max-device-pixel-ratio: 1.5),
       (min-width: 1025px) and (max-width: 2048px) and (max-resolution: 1.5dppx)  {
  body::before {
    background-image: url('images/mountain.jpg');
  }
}

/* 大屏 (≥1025px 1.5x / ≥2049px 1x) */
@media (min-width: 1025px) and (-webkit-min-device-pixel-ratio: 1.5),
       (min-width: 1025px) and (min-resolution: 1.5dppx),
       (min-width: 2049px) and (-webkit-max-device-pixel-ratio: 1.5),
       (min-width: 2049px) and (max-resolution: 1.5dppx) {
  body::before {
    background-image: url('images/mountain.jpg');
  }
}

/* ==== 博客容器基础 ==== */

/* 博客根容器：Roboto 字体族 */
body .blog {
  font-family: 'Roboto', 'Helvetica', sans-serif;
}

/* 博客文章流容器：最大 900px 居中、flex 行布局 */
.blog .blog__posts {
  max-width: 900px;
  padding: 0;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  margin: 0 auto;
  -webkit-flex-shrink: 0;
      -ms-flex-negative: 0;
          flex-shrink: 0;
}

/* 博客布局内容区：顶部 230px 留白给背景图、相对定位 */
.blog.mdl-layout .mdl-layout__content {
  padding-top: 230px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* ==== 卡片通用样式 ==== */

/* MDL 卡片基础：flex 列布局、stretch 对齐、360dp 最小高度 */
.blog .mdl-card {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
  min-height: 360px;
}

/* 卡片标题区：16dp 内边距、flex-grow 填充剩余空间 */
.blog .mdl-card__title {
  padding: 16px;
  -webkit-flex-grow: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
}

/* 卡片封面图区：cover 填充、24dp 内边距、flex-grow、从底部对齐、可点击跳转 */
.blog .mdl-card__media {
  box-sizing: border-box;
  background-size: cover;
  padding: 24px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-grow: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-align-items: flex-end;
      -ms-flex-align: end;
          align-items: flex-end;
  cursor: pointer;
}

/* 卡片内链接继承父色 */
.blog .mdl-card__media a,
.blog .mdl-card__title a {
  color: inherit;
}

/* 卡片支撑文本区：全宽、16dp 内边距、64dp 最小高度、flex 居中
   注意：MDL 默认 .mdl-card__supporting-text 有 display:flex; align-items:center */
.blog .mdl-card__supporting-text {
  width: 100%;
  padding: 16px;
  min-height: 64px;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

/* 支撑文本内 strong 降为 400 粗细（视觉弱化） */
.blog .mdl-card__supporting-text strong {
  font-weight: 400;
}

/* 封面图下面紧邻的支撑区：64dp 最小高度 */
.blog .mdl-card__media ~ .mdl-card__supporting-text {
  min-height: 64px;
}

/* 非末尾支撑区：76dp 最小高度 + border-box */
.blog .mdl-card__supporting-text:not(:last-child) {
  box-sizing: border-box;
  min-height: 76px;
}

/* 首页卡片支撑区之间的分割线（不包括文章详情页） */
.blog:not(.blog--article) .mdl-card__supporting-text ~ .mdl-card__supporting-text {
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* ==== 卡片操作区 ==== */

/* 操作区首个元素无左 margin */
.blog .mdl-card__actions:first-child {
  margin-left: 0;
}

/* ==== Meta 信息行 ==== */
/* 卡片底部日期/分类等 meta 信息：flex 行、居中、16dp 内边距 */
.blog .meta {
  box-sizing: border-box;
  padding: 16px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: flex-start;
      -ms-flex-pack: start;
          justify-content: flex-start;
  height: auto;
}

/* 收藏夹按钮：行布局、8dp 左右 margin、13sp medium */
.blog .meta > .meta__favorites{
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  margin: 0 8px;
  font-size: 13px;
  font-weight: 500;
}

/* 收藏图标：2em（跟随父元素字号）、可点击、12dp 左间距 */
.blog .meta > .meta__favorites .material-icons {
  font-size: 2em;
  cursor: pointer;
  margin-left: 12px;
}

/* Meta 行两端对齐修饰符 */
.blog .mdl-card .meta.meta--fill {
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
}

/* Meta 子元素间距：首元素右侧 16dp */
.blog .meta > *:first-child {
  margin-right: 16px;
}

/* Meta 子元素：flex 列布局 */
.blog .meta > * {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
}

/* ==== 小屏适配 ==== */

/* 小屏文章卡片排序 =0 */
.blog.is-small-screen .blog__posts > .mdl-card.card-article {
  -webkit-order: 0;
      -ms-flex-order: 0;
          order: 0;
}

/* 小屏侧边卡片排序 -1（显示在文章上方） */
.blog.is-small-screen .blog__posts > .mdl-card.sidebar-card {
  -webkit-order: -1;
      -ms-flex-order: -1;
          order: -1;
}

/* ==== 文章卡片封面区 ==== */

/* 无封面图时的默认背景色 — blue-grey 800 (#37474f)
   硬编码而非用 MDL 主题色，因为某些主题的 primary-dark (如 grey) 效果差 */
.blog .card-article .mdl-card__media {
  background-color: rgb(55, 71, 79);
}

/* ==== 侧边栏卡片 ==== */

/* 侧边栏封面区：flex 列居中 */
.blog .sidebar-card .mdl-card__media {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

/* 侧边栏操作按钮（如分享）：绝对定位右上角、上移 28dp */
.blog .sidebar-card > button {
  position: absolute;
  top: 0;
  right: 28px;
  -webkit-transform: translate(0px, -28px);
          transform: translate(0px, -28px);
}

/* 侧边栏链接按钮（同上，a 标签版本） */
.blog .sidebar-card > a {
    position: absolute;
    top: 0;
    right: 28px;
    -webkit-transform: translate(0px, -28px);
            transform: translate(0px, -28px);
}

/* 侧边栏封面区文字：13sp medium、2dp 顶部圆角 */
.blog .sidebar-card .mdl-card__media {
  font-size: 13px;
  font-weight: 500;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
}

/* 侧边栏头像：64x64dp、10dp 底部间距 */
.blog .sidebar-card .mdl-card__media img {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
}

/* 侧边栏底部支撑区：浅灰背景、2dp 底部圆角 */
.blog .sidebar-card .mdl-card__supporting-text {
  background-color: #F5F5F5;
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

/* ==== 文章导航 ==== */
/* "前一篇/后一篇"导航栏：12+15dp margin、flex 行两端对齐、白色文字 */

.blog .blog__posts > .article-nav {
  margin: 12px 15px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  color: white;
  font-weight: 500;
}

/* 导航链接：白色、无下划线、flex 居中 */
.blog .blog__posts > .article-nav > .article-nav__btn {
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* 导航内 MDL 按钮：54% 黑字、白色背景 */
.blog .blog__posts > .article-nav .mdl-button {
  color: rgba(0,0,0,0.54);
  background-color: white;
}

/* 前一篇按钮右侧 16dp 间距 */
.blog .blog__posts > .article-nav > .article-nav__btn:first-child .mdl-button {
  margin-right: 16px;
}

/* 后一篇按钮左侧 16dp 间距 */
.blog .blog__posts > .article-nav > .article-nav__btn:last-child .mdl-button {
  margin-left: 16px;
}

/* 导航按钮 hover tooltip — 使用 CSS ::after 伪元素
   MD1 风格：黑色 87% 背景、白色 12sp 文字、2dp 圆角、上方偏移 8dp */
.article-nav__btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.87);
  color: #fff;
  padding: 6px 12px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  margin-bottom: 8px;
}

/* 导航按钮容器：relative 定位（tooltip 定位基准） */
.article-nav__btn {
  position: relative;
}

/* ==== 卡片内链接和标题 ==== */

/* 卡片内链接：继承颜色和粗细 */
.blog .mdl-card > a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

/* 卡片 h3 标题无外边距 */
.blog .mdl-card h3 {
  margin: 0;
}

/* 标题链接无下划线 */
.blog .mdl-card h3 a {
  text-decoration: none;
}

/* 引用卡片 h3.quote — 装饰引号
   大号引号（3em）、上方 0.5em 间距 */
.blog .mdl-card h3.quote:before, .blog .mdl-card h3.quote:after {
  display: block;
  font-size: 3em;
  margin-top: 0.5em;
}
.blog .mdl-card h3.quote:before {
  content: '\201C';   /* 左双引号 " */
}
.blog .mdl-card h3.quote:after {
  content: '\201D';   /* 右双引号 " */
}

/* ==== 文章详情页 (blog--article) ==== */

/* 文章详情页自定义 header 透明背景 */
.blog--article .custom-header {
  background-color: transparent;
}

/* 文章封面区：280dp 高、无封面时 blue-grey 800 默认背景 */
.blog--article .blog__posts > .mdl-card .mdl-card__media {
  background-color: rgb(55, 71, 79);
  height: 280px;
}

/* 评论区容器：灰色背景 */
.blog--article .comments {
  background-color: #EEE;
}

/* 文章 meta 子元素行对齐（而非列） */
.blog--article .meta > * {
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

/* 文章正文区容器（meta 下方的 supporting-text）
   覆盖 MDL 默认 flex 居中为 flex 列布局 */
.blog--article .meta + .mdl-card__supporting-text {
  border: 0;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
}

/* 文章正文段落：全宽、16dp 底部间距、15sp / 1.7 行高 */
.blog--article .meta + .mdl-card__supporting-text p {
  max-width: 100%;
  margin: 0 0 16px 0;
  font-size: 15px;
  line-height: 1.7;
}

/* ==== 评论区 ==== */

/* 评论区：flex 列布局、stretch 对齐、32dp 内边距 */
.blog--article .comments {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: flex-start;
      -ms-flex-pack: start;
          justify-content: flex-start;
  -webkit-align-items: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
  padding: 32px;
  box-sizing: border-box;
}

/* 评论表单：flex 行、16dp 底部间距 */
.blog--article .comments > form {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  margin-bottom: 16px;
}

/* 评论输入框：flex-grow 填充、16dp 右间距、灰色文字 */
.blog--article .comments > form .mdl-textfield {
  -webkit-flex-grow: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  margin-right: 16px;
  color: rgb(97, 97, 97);
}

/* Firefox 修复：强制评论输入框使用 Roboto 字体 */
.blog--article .comments > form .mdl-textfield .mdl-textfield__input {
  font-family: 'Roboto', 'Helvetica', sans-serif;
}

/* 评论输入框禁止拖拽调整大小 */
.blog--article .comments > form .mdl-textfield input,
.blog--article .comments > form .mdl-textfield textarea {
  resize: none;
}

/* 评论提交按钮：24% 黑背景、白色文字、20dp 顶部偏移 */
.blog--article .comments > form button {
  margin-top: 20px;
  background-color: rgba(0, 0, 0, 0.24);
  color: white;
}

/* 单条评论：flex 列布局 */
.blog--article .comments .comment {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
}

/* 评论头部：flex 行对齐、16dp 底部间距 */
.blog--article .comments .comment > .comment__header {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  margin-bottom: 16px;
}

/* 评论头像：48x48dp、24dp 圆角(圆形)、16dp 右间距 */
.blog--article .comments .comment > .comment__header > .comment__avatar {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  margin-right: 16px;
}

/* 评论作者信息：flex-grow + 列布局 */
.blog--article .comments .comment > .comment__header > .comment__author {
  -webkit-flex-grow: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
}

/* 评论文本：1.5 行高 */
.blog--article .comments .comment > .comment__text {
  line-height: 1.5em;
}

/* 评论操作按钮行：flex 行左对齐、0.8em 字号、16dp 顶部间距 */
.blog--article .comments .comment > .comment__actions {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-justify-content: flex-start;
      -ms-flex-pack: start;
          justify-content: flex-start;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  font-size: 0.8em;
  margin-top: 16px;
}

/* 评论操作按钮：16dp 右间距、24% 黑颜色 */
.blog--article .comments .comment > .comment__actions button {
  margin-right: 16px;
  color: rgba(0, 0, 0, 0.24);
}

/* 评论回复区：32dp 顶部间距、48dp 左缩进 */
.blog--article .comments .comment > .comment__answers {
  padding-top: 32px;
  padding-left: 48px;
}

/* ==== 返回按钮 ==== */
/* 文章详情页左上角返回按钮：绝对定位、白色、最高层级 */
.blog--article .back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  color: white;
  z-index: 9999;
}

/* ==== 主题切换按钮 (已移除，保留 CSS 可能被旧页面引用) ==== */
.blog .theme {
    position: absolute;
    top: 16px;
    left: 16px;
    color: white;
    z-index: 9999;
}

/* 弹性空间填充 */
.blog .section-spacer {
  -webkit-flex-grow: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
}

/* 侧边栏卡片：overflow visible 允许弹窗/菜单溢出、z-index 10 */
.blog .sidebar-card {
  overflow: visible;
  z-index: 10;
}

/* 引用卡片标题区：blue-grey 900 背景 */
.blog .card-quote .mdl-card__title {
  background-color: #263238;
}

/* 迷你 logo 头像：44x44dp 圆形、默认 logo.png 背景、浅灰底色
   内联 style 覆盖 background-image 用于自定义头像 */
.blog .minilogo {
  width: 44px;
  height: 44px;
  background-image: url('images/logo.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 50%;
  border-radius: 22px;
  background-color: #F5F5F5;
}

/* IE10 修复：强制 flex 布局 */
.mdl-grid {
  display: -webkit-flex !important;
  display: -ms-flexbox !important;
  display: flex !important;
}

/* ==== 页脚图标按钮 ==== */
/* MD1 Icon Toggle Button 规范:
   46% 黑图标、36x36dp 触摸区域、hover 12% 黑背景、
   暗色模式下 70% 白图标、hover 8% 白背景 */
.footer-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: rgba(0,0,0,0.46);
    transition: background 0.15s ease, color 0.15s ease;
}
.footer-icon-btn:hover {
    background: rgba(0,0,0,0.12);
    color: rgba(0,0,0,0.74);
}
.footer-icon-btn:active {
    background: rgba(0,0,0,0.18);
}
.footer-icon-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ==== 页脚 ==== */
/* MD1 mini footer：80dp 顶部间距、120dp 高、40dp 内边距、白色背景 */
.blog .mdl-mini-footer {
    margin-top: 80px;
    height: 120px;
    padding: 40px;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    background-color: white;
    box-sizing: border-box;
}
/* 页脚左右区域垂直居中对齐 */
.blog .mdl-mini-footer--left-section,
.blog .mdl-mini-footer--right-section {
    display: flex;
    align-items: center;
    gap: 4px;
}


/* ==== code-with-text 内 inline code 样式 ==== */
/* 语法高亮容器内的行内 code：等宽字体、7% 黑背景、2dp 圆角、13sp */
.code-with-text code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background: rgba(0,0,0,0.07);
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 13px;
}

/* ==== 博文内容区 h4 间距优化 ==== */
.docs-layout h4 {
    margin-top: 0;
    margin-bottom: 12px
}

/* ==============================================================
   博文排版系统 — 现代化阅读体验
   作用于 .docs-layout (文章正文区)，影响所有文章
   ============================================================== */

/* 文章正文内容区
   特异性 0-3-0: 必须高于 .blog--article .meta + .mdl-card__supporting-text (0-3-0)
   覆盖 MDL .mdl-card__supporting-text 的 display:flex; align-items:center
   以及 .blog--article 的 flex-direction:column — 正文用 block 流式布局
   必须 box-sizing:border-box — 否则 width:100%(继承) + padding 会导致溢出父容器 */
.blog--article .mdl-card__supporting-text.docs-layout {
    padding: 24px 32px 32px;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}

/* 段落：16dp 底部间距、15sp / 1.75 行高、76% 黑 */
.blog--article .docs-layout p {
    margin: 0 0 16px 0;
    font-size: 15px;
    line-height: 1.75;
    color: rgba(0,0,0,0.76);
}

/* ---- 标题体系 — 左对齐 + 层级分明 ---- */

/* h1: 28sp bold、40dp 顶部 / 16dp 底部、2dp 底部分割线 */
.blog--article .docs-layout h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 40px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0,0,0,0.08);
    color: rgba(0,0,0,0.87);
}

/* h2: 22sp semibold、32dp 顶部 / 12dp 底部 */
.blog--article .docs-layout h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 32px 0 12px 0;
    color: rgba(0,0,0,0.87);
}

/* h3: 18sp semibold、28dp 顶部 / 10dp 底部 */
.blog--article .docs-layout h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 10px 0;
    color: rgba(0,0,0,0.8);
}

/* h4: 16sp semibold、24dp 顶部 / 8dp 底部、左对齐 */
.blog--article .docs-layout h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 8px 0;
    color: rgba(0,0,0,0.72);
    text-align: left;
}

/* h5: 15sp semibold、20dp 顶部 / 6dp 底部 */
.blog--article .docs-layout h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 6px 0;
    color: rgba(0,0,0,0.66);
}

/* h6: 14sp semibold、16dp 顶部 / 6dp 底部、大写 + 字间距 */
.blog--article .docs-layout h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 6px 0;
    color: rgba(0,0,0,0.56);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- 行内 code — 等宽字体 + 紧凑背景 ---- */
/* 1px 4dp 内边距、3dp 圆角、6% 黑背景、0.9em 字号
   line-height:1.6 + box-decoration-break:clone 防止多行 code 底框重叠 */
.blog--article .docs-layout code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Monaco, monospace;
    background: rgba(0,0,0,0.06);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.9em;
    line-height: 1.6;
    color: #d73a49;
    word-break: break-word;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* code-with-text 内的 <code> 覆盖 — 语法高亮不需要红色和背景 */
.blog--article .docs-layout .code-with-text code {
    color: inherit;
    background: none;
    padding: 0;
    font-size: 13px;
}

/* 行内 code 在 <strong> 内保持粗体 */
.blog--article .docs-layout strong code {
    font-weight: 600;
}

/* ---- 列表 — 现代博客风格 ---- */
/* 无序列表：去除默认样式、32dp 左缩进、6dp 上下内边距 */
.blog--article .docs-layout ul {
    list-style: none;
    margin: 8px 0 20px 32px;
    padding: 6px 0 6px 0;
}

/* 列表项：20dp 左 padding 给圆点留空间、15sp / 1.75 行高 */
.blog--article .docs-layout ul > li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 8px;
    color: rgba(0,0,0,0.76);
}

/* 无序列表圆点：7x7dp 实心圆、绝对定位左侧、40% 黑 */
.blog--article .docs-layout ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
}

/* 有序列表：CSS counter 自增编号、32dp 左缩进 */
.blog--article .docs-layout ol {
    list-style: none;
    margin: 8px 0 20px 32px;
    padding: 6px 0 6px 0;
    counter-reset: ol-counter;
}

/* 有序列表项：26dp 左 padding 给编号留空间、counter 自增 */
.blog--article .docs-layout ol > li {
    position: relative;
    padding-left: 26px;
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 8px;
    color: rgba(0,0,0,0.76);
    counter-increment: ol-counter;
}

/* 有序列表编号：counter + "." 格式、绝对定位、14sp semibold、48% 黑 */
.blog--article .docs-layout ol > li::before {
    content: counter(ol-counter) '.';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(0,0,0,0.48);
}

/* 通用 li 样式兜底 */
.blog--article .docs-layout li {
    font-size: 15px;
    line-height: 1.75;
    color: rgba(0,0,0,0.76);
}

/* 嵌套列表更紧凑：4dp 顶部 / 2dp 底部、8dp 左缩进 */
.blog--article .docs-layout li > ul,
.blog--article .docs-layout li > ol {
    margin: 4px 0 2px 8px;
    padding: 2px 0;
}

/* 嵌套无序列表圆点更小：5x5dp、24% 黑 */
.blog--article .docs-layout li > ul > li::before {
    width: 5px;
    height: 5px;
    top: 11px;
    background: rgba(0,0,0,0.24);
}

/* ---- 链接 ---- */
/* 靛蓝色文字、下划线半透明、hover 下划线变实 */
.blog--article .docs-layout a {
    color: #3f51b5;
    text-decoration: none;
    border-bottom: 1px solid rgba(63,81,181,0.3);
    transition: border-color 0.2s;
}

.blog--article .docs-layout a:hover {
    border-bottom-color: #3f51b5;
}

/* ---- 引用块 ---- */
/* 覆盖 MDL 全局 blockquote 样式 (material.min.css):
 *   MDL 默认: 24px/italic + 装饰引号 :before/:after
 *   博客正文: 15px/normal + 左边线, 无装饰引号
 */
.blog--article .docs-layout blockquote {
    margin: 0 0 16px 0;
    padding: 12px 16px 12px 20px;
    border-left: 3px solid #3f51b5;
    background: rgba(63,81,181,0.04);
    color: rgba(0,0,0,0.66);
    font-size: 15px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.75;
    letter-spacing: normal;
    position: relative;
}

/* 隐藏 MDL 全局装饰引号 */
.blog--article .docs-layout blockquote:before,
.blog--article .docs-layout blockquote:after {
    display: none;
}

/* 引用块内段落：8dp 底部间距 */
.blog--article .docs-layout blockquote p {
    margin: 0 0 8px 0;
}

/* 引用块末段无底部间距 */
.blog--article .docs-layout blockquote p:last-child {
    margin-bottom: 0;
}

/* ---- 图片 ---- */
/* 全宽上限、自适应高度、4dp 圆角、居中显示、8dp 上下间距 */
.blog--article .docs-layout img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px auto;
    display: block;
}

/* ---- 表格 ---- */
/* 全宽、边框合并、14sp */
.blog--article .docs-layout table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px 0;
    font-size: 14px;
}

/* 表头/单元格：8+12dp 内边距、1dp 边框、左对齐 */
.blog--article .docs-layout th,
.blog--article .docs-layout td {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    text-align: left;
}

/* 表头：3% 黑背景、粗体 */
.blog--article .docs-layout th {
    background: rgba(0,0,0,0.03);
    font-weight: 600;
}

/* 偶数行：2% 黑背景斑马纹 */
.blog--article .docs-layout tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

/* ---- 水平分割线 ---- */
/* 1dp 灰色顶边框、24dp 上下间距 */
.blog--article .docs-layout hr {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 24px 0;
}

/* ---- code-with-text 代码块排版 ---- */
/* 居中显示、最大 85% 宽、等宽字体、8dp 上 + 15dp 左右内边距、13sp */

.blog--article .docs-layout .code-with-text {
    margin: 12px auto 20px;
    max-width: 85%;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Monaco, monospace;
    padding: 8px 15px 0;
    font-size: 13px;
}

/* 代码区 <pre> 与标题文字左对齐 — 负 margin 消除容器 padding */
.blog--article .docs-layout .code-with-text pre {
    margin: 6px -15px 0;
}

/* 代码内容内边距 — 与标题文字对齐（15dp） */
.blog--article .docs-layout .code-with-text pre[class*=language-] code {
    padding: 12px 15px;
}

/* 文章首个标题不需要上边距 */
.blog--article .docs-layout > h1:first-child,
.blog--article .docs-layout > h2:first-child,
.blog--article .docs-layout > h3:first-child,
.blog--article .docs-layout > h4:first-child {
    margin-top: 0;
}

/* ==============================================================
   暗黑模式 — MD1 Dark Theme 规范
   ==============================================================
   触发方式:
     html[data-mode="dark"] — 手动暗黑模式
     html[data-mode="auto"] + @media (prefers-color-scheme: dark) — 跟随系统

   MD1 调色板:
     背景 #303030, 卡片 #424242
     白文字: primary 100%, secondary 70%, hint 50%, divider 12%
   ============================================================== */

/* ---- 手动暗黑模式 ---- */

/* 背景 → #303030 纯色，去除背景图
   暗色模式下全屏背景图过于明亮，直接用纯色深灰替代 */
html[data-mode="dark"] body::before {
    background-image: none !important;
    background-color: #303030;
}

/* 卡片 → #424242 */
html[data-mode="dark"] .mdl-card {
    background: #424242;
}

/* 卡片封面灰色文字 → 100% 白 */
html[data-mode="dark"] .mdl-card__media.mdl-color-text--grey-50 {
    color: rgba(255,255,255,1);
}

/* 卡片封面白色背景 → #424242 */
html[data-mode="dark"] .mdl-card__media.mdl-color--white {
    background: #424242 !important;
}

/* 侧边栏封面区灰色文字 (如 "发现生活中的美") → 87% 白
   MDL .mdl-color-text--grey-600 强制设置 #757575，需 !important 覆盖
   原值 70% 在 #424242 背景上对比度不足，提高至 87% */
html[data-mode="dark"] .mdl-card__media.mdl-color-text--grey-600 {
    color: rgba(255,255,255,0.87) !important;
}

/* 卡片支撑文本/摘要 → 80% 白
   MDL .mdl-color-text--grey-600 强制设置 #757575，需 !important 覆盖
   同时覆盖 .blog:not(.blog--article) 下的首页卡片摘要和 meta 区
   原值 70% 在 #424242 背景上对比度不足，提高至 80% */
html[data-mode="dark"] .mdl-card__supporting-text,
html[data-mode="dark"] .mdl-card__supporting-text.meta,
html[data-mode="dark"] .mdl-card__supporting-text.meta.mdl-color-text--grey-600,
html[data-mode="dark"] .mdl-card__supporting-text.mdl-color-text--grey-600 {
    color: rgba(255,255,255,0.80) !important;
}

/* 侧边栏导航菜单 → 暗色模式适配 */
html[data-mode="dark"] .sidebar-card .mdl-menu {
    background-color: #424242;
}
html[data-mode="dark"] .sidebar-card .mdl-menu__item {
    color: rgba(255,255,255,0.87);
}
html[data-mode="dark"] .sidebar-card .mdl-menu__item:hover {
    background-color: rgba(255,255,255,0.08);
}
html[data-mode="dark"] .sidebar-card .mdl-menu__item .mdl-menu__item::after {
    background-color: rgba(255,255,255,0.06);
}

/* 首页卡片摘要区之间的分割线 → 12% 白 */
html[data-mode="dark"] .blog:not(.blog--article) .mdl-card__supporting-text ~ .mdl-card__supporting-text {
    border-top-color: rgba(255,255,255,0.12);
}

/* 侧边栏底部支撑区背景 → 深色 */
html[data-mode="dark"] .blog .sidebar-card .mdl-card__supporting-text {
    background-color: #353535;
}

/* 迷你 logo 底色 → 深色 */
html[data-mode="dark"] .blog .minilogo {
    background-color: #353535;
}

/* 文章 meta → 50% 白 */
html[data-mode="dark"] .blog--article .meta {
    color: rgba(255,255,255,0.50);
}

/* 文章正文区 → 100% 白 */
html[data-mode="dark"] .blog--article .docs-layout {
    color: rgba(255,255,255,1);
}

/* 文章段落 → 87% 白 */
html[data-mode="dark"] .blog--article .docs-layout p {
    color: rgba(255,255,255,0.87);
}

/* 文章标题 h1-h6 → 白色系 */
html[data-mode="dark"] .blog--article .docs-layout h1,
html[data-mode="dark"] .blog--article .docs-layout h2,
html[data-mode="dark"] .blog--article .docs-layout h3,
html[data-mode="dark"] .blog--article .docs-layout h4 {
    color: rgba(255,255,255,1);
}
html[data-mode="dark"] .blog--article .docs-layout h5 {
    color: rgba(255,255,255,0.80);
}
html[data-mode="dark"] .blog--article .docs-layout h6 {
    color: rgba(255,255,255,0.65);
}

/* h1 底部分割线 → 12% 白 */
html[data-mode="dark"] .blog--article .docs-layout h1 {
    border-bottom-color: rgba(255,255,255,0.12);
}

/* 文章链接 → MD1 dark 链接蓝色 #82b1ff + 半透明下划线 */
html[data-mode="dark"] .blog--article .docs-layout a {
    color: #82b1ff;
    border-bottom-color: rgba(130,177,255,0.3);
}

/* 行内 code → 深色背景 + 浅红色文字 */
html[data-mode="dark"] .blog--article .docs-layout code {
    background: rgba(255,255,255,0.10);
    color: #f97583;
}

/* 列表项文字 → 80% 白 */
html[data-mode="dark"] .blog--article .docs-layout li {
    color: rgba(255,255,255,0.80);
}
html[data-mode="dark"] .blog--article .docs-layout ul > li,
html[data-mode="dark"] .blog--article .docs-layout ol > li {
    color: rgba(255,255,255,0.80);
}

/* 无序列表圆点 → 40% 白 / 嵌套 24% 白 */
html[data-mode="dark"] .blog--article .docs-layout ul > li::before {
    background: rgba(255,255,255,0.40);
}
html[data-mode="dark"] .blog--article .docs-layout li > ul > li::before {
    background: rgba(255,255,255,0.24);
}

/* 有序列表编号 → 50% 白 */
html[data-mode="dark"] .blog--article .docs-layout ol > li::before {
    color: rgba(255,255,255,0.50);
}

/* 引用块 → 加强背景 + 30% 白左边框、70% 白文字 */
html[data-mode="dark"] .blog--article blockquote {
    border-left-color: rgba(255,255,255,0.30);
    background: rgba(63,81,181,0.12);
    color: rgba(255,255,255,0.70);
}

/* 表格 → 12% 白边框、5% 白表头、3% 白斑马纹 */
html[data-mode="dark"] .blog--article .docs-layout th,
html[data-mode="dark"] .blog--article .docs-layout td {
    border-color: rgba(255,255,255,0.12);
}
html[data-mode="dark"] .blog--article .docs-layout th {
    background: rgba(255,255,255,0.05);
}
html[data-mode="dark"] .blog--article .docs-layout tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

/* 水平分割线 → 12% 白 */
html[data-mode="dark"] .blog--article .docs-layout hr {
    border-top-color: rgba(255,255,255,0.12);
}

/* code-with-text 代码块：#1e1e1e 背景、87% 白文字、12% 白边框 */
html[data-mode="dark"] .blog--article .code-with-text {
    background: #1e1e1e;
    color: rgba(255,255,255,0.87);
    border-color: rgba(255,255,255,0.12);
}

/* 代码标签：54% 白、12% 白底部分割线 */
html[data-mode="dark"] .blog--article .code-with-text .code-label {
    color: rgba(255,255,255,0.54);
    border-bottom-color: rgba(255,255,255,0.12);
}

/* 代码区 pre：#1e1e1e 背景 */
html[data-mode="dark"] .blog--article .code-with-text pre {
    background: #1e1e1e;
}

/* 文章导航按钮：70% 白 / hover 95% 白 */
html[data-mode="dark"] .article-nav__btn {
    color: rgba(255,255,255,0.70);
}
html[data-mode="dark"] .article-nav__btn:hover {
    color: rgba(255,255,255,0.95);
}

/* 返回按钮：纯白 */
html[data-mode="dark"] .back-btn {
    color: #fff;
}

/* 页脚：#212121 深灰背景 + 70% 白文字 */
html[data-mode="dark"] .mdl-mini-footer {
    background: #212121;
    color: rgba(255,255,255,0.70);
}
}

/* 侧边栏头像：85% 不透明度 */
html[data-mode="dark"] .sidebar-card img {
    opacity: 0.85;
}

/* 文章卡片封面：保持 #37474f 背景色 */
html[data-mode="dark"] .card-article .mdl-card__media {
    background-color: #37474f;
}

/* 封面标题链接：95% 白 */
html[data-mode="dark"] .card-article .mdl-card__media h3 a {
    color: rgba(255,255,255,0.95);
}

/* ---- 跟随系统自动暗黑模式 ---- */
/* 与手动暗黑相同的样式，选择器改为 html[data-mode="auto"] */
@media (prefers-color-scheme: dark) {
    html[data-mode="auto"] body::before {
        background-image: none !important;
        background-color: #303030;
    }
    html[data-mode="auto"] .mdl-card {
        background: #424242;
    }
    html[data-mode="auto"] .mdl-card__media.mdl-color-text--grey-50 {
        color: rgba(255,255,255,1);
    }
    html[data-mode="auto"] .mdl-card__media.mdl-color--white {
        background: #424242 !important;
    }
    html[data-mode="auto"] .mdl-card__media.mdl-color-text--grey-600 {
        color: rgba(255,255,255,0.87) !important;
    }
    html[data-mode="auto"] .mdl-card__supporting-text,
    html[data-mode="auto"] .mdl-card__supporting-text.meta,
    html[data-mode="auto"] .mdl-card__supporting-text.meta.mdl-color-text--grey-600,
    html[data-mode="auto"] .mdl-card__supporting-text.mdl-color-text--grey-600 {
        color: rgba(255,255,255,0.80) !important;
    }
    html[data-mode="auto"] .blog:not(.blog--article) .mdl-card__supporting-text ~ .mdl-card__supporting-text {
        border-top-color: rgba(255,255,255,0.12);
    }
    /* 侧边栏导航菜单暗色适配 */
    html[data-mode="auto"] .sidebar-card .mdl-menu {
        background-color: #424242;
    }
    html[data-mode="auto"] .sidebar-card .mdl-menu__item {
        color: rgba(255,255,255,0.87);
    }
    html[data-mode="auto"] .sidebar-card .mdl-menu__item:hover {
        background-color: rgba(255,255,255,0.08);
    }
    html[data-mode="auto"] .blog .sidebar-card .mdl-card__supporting-text {
        background-color: #353535;
    }
    html[data-mode="auto"] .blog .minilogo {
        background-color: #353535;
    }
    html[data-mode="auto"] .blog--article .meta {
        color: rgba(255,255,255,0.50);
    }
    html[data-mode="auto"] .blog--article .docs-layout {
        color: rgba(255,255,255,1);
    }
    html[data-mode="auto"] .blog--article .docs-layout p {
        color: rgba(255,255,255,0.87);
    }
    html[data-mode="auto"] .blog--article .docs-layout h1,
    html[data-mode="auto"] .blog--article .docs-layout h2,
    html[data-mode="auto"] .blog--article .docs-layout h3,
    html[data-mode="auto"] .blog--article .docs-layout h4 {
        color: rgba(255,255,255,1);
    }
    html[data-mode="auto"] .blog--article .docs-layout h5 {
        color: rgba(255,255,255,0.80);
    }
    html[data-mode="auto"] .blog--article .docs-layout h6 {
        color: rgba(255,255,255,0.65);
    }
    html[data-mode="auto"] .blog--article .docs-layout h1 {
        border-bottom-color: rgba(255,255,255,0.12);
    }
    html[data-mode="auto"] .blog--article .docs-layout a {
        color: #82b1ff;
        border-bottom-color: rgba(130,177,255,0.3);
    }
    html[data-mode="auto"] .blog--article .docs-layout code {
        background: rgba(255,255,255,0.10);
        color: #f97583;
    }
    html[data-mode="auto"] .blog--article .docs-layout li {
        color: rgba(255,255,255,0.80);
    }
    html[data-mode="auto"] .blog--article .docs-layout ul > li,
    html[data-mode="auto"] .blog--article .docs-layout ol > li {
        color: rgba(255,255,255,0.80);
    }
    html[data-mode="auto"] .blog--article .docs-layout ul > li::before {
        background: rgba(255,255,255,0.40);
    }
    html[data-mode="auto"] .blog--article .docs-layout li > ul > li::before {
        background: rgba(255,255,255,0.24);
    }
    html[data-mode="auto"] .blog--article .docs-layout ol > li::before {
        color: rgba(255,255,255,0.50);
    }
    html[data-mode="auto"] .blog--article blockquote {
        border-left-color: rgba(255,255,255,0.30);
        background: rgba(63,81,181,0.12);
        color: rgba(255,255,255,0.70);
    }
    html[data-mode="auto"] .blog--article .docs-layout th,
    html[data-mode="auto"] .blog--article .docs-layout td {
        border-color: rgba(255,255,255,0.12);
    }
    html[data-mode="auto"] .blog--article .docs-layout th {
        background: rgba(255,255,255,0.05);
    }
    html[data-mode="auto"] .blog--article .docs-layout tr:nth-child(even) {
        background: rgba(255,255,255,0.03);
    }
    html[data-mode="auto"] .blog--article .docs-layout hr {
        border-top-color: rgba(255,255,255,0.12);
    }
    html[data-mode="auto"] .blog--article .code-with-text {
        background: #1e1e1e;
        color: rgba(255,255,255,0.87);
        border-color: rgba(255,255,255,0.12);
    }
    html[data-mode="auto"] .blog--article .code-with-text .code-label {
        color: rgba(255,255,255,0.54);
        border-bottom-color: rgba(255,255,255,0.12);
    }
    html[data-mode="auto"] .blog--article .code-with-text pre {
        background: #1e1e1e;
    }
    html[data-mode="auto"] .article-nav__btn {
        color: rgba(255,255,255,0.70);
    }
    html[data-mode="auto"] .article-nav__btn:hover {
        color: rgba(255,255,255,0.95);
    }
    html[data-mode="auto"] .back-btn {
        color: #fff;
    }
    html[data-mode="auto"] .mdl-mini-footer {
        background: #212121;
        color: rgba(255,255,255,0.70);
    }
    html[data-mode="auto"] .sidebar-card img {
        opacity: 0.85;
    }
    html[data-mode="auto"] .card-article .mdl-card__media {
        background-color: #37474f;
    }
    html[data-mode="auto"] .card-article .mdl-card__media h3 a {
        color: rgba(255,255,255,0.95);
    }
}

/* ==============================================================
   MD1 Switch — 页脚暗色模式切换
   ==============================================================
   规范: MD1 Light Switch
   Thumb On: Swatch 500 100%; Track On: Swatch 500 50%
   Thumb Off: #FAFAFA + 2dp border; Track Off: #000 38% opacity
   颜色跟随 --md-primary 变量，随主题切换动态调整
   ============================================================== */

/* Switch 外层容器 — 与 footer-icon-btn 同高 36dp，垂直居中 */
.blog-dark-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    height: 36px;
    padding: 0 8px;
    border-radius: 18px;
    transition: background 0.15s ease;
}
.blog-dark-switch:hover {
    background: rgba(0,0,0,0.04);
}

/* Switch 标签文字 — 12sp 54% 黑 */
.blog-dark-switch__label {
    font-size: 12px;
    color: rgba(0,0,0,0.54);
    line-height: 1;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

/* Switch 轨道 — MD1 spec: 36×14dp、7dp 圆角 */
.blog-dark-switch__track {
    position: relative;
    width: 36px;
    height: 14px;
    border-radius: 7px;
    background: rgba(0,0,0,0.38);
    transition: background 0.15s ease;
    flex-shrink: 0;
}

/* Switch 滑块 (thumb) — MD1 spec: Off/On resting 20dp, 无 border
   定位：left=0 贴 track 左边缘, top=-3dp 垂直居中于 14dp track
   travel 距离 = 36 - 20 = 16dp */
.blog-dark-switch__thumb {
    position: absolute;
    top: -3px;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fafafa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.26);
    transition: transform 0.15s ease, background 0.15s ease;
}

/* === On 状态 — MD1 spec: thumb 20dp 右移 16dp 到 track 右端 === */
.blog-dark-switch input:checked + .blog-dark-switch__track {
    background: color-mix(in srgb, var(--md-primary) 50%, transparent);       /* Swatch 500 × 50% */
}
.blog-dark-switch input:checked + .blog-dark-switch__track .blog-dark-switch__thumb {
    transform: translateX(16px);
    background: var(--md-primary);       /* Swatch 500 100% */
}

/* === Ripple 容器 — MDL 规范：48x48dp 圆形，跟随 thumb 位置 === */
/* Off: 以 thumb 中心为圆心 (thumb left=0, width=20, 中心=10)
   48dp 圆的 top = thumb中心(10-3) - 24 = -17dp, left = 10-24 = -14dp */
.blog-dark-switch__ripple-container {
    position: absolute;
    z-index: 2;
    top: -17px;
    left: -14px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    -webkit-mask-image: -webkit-radial-gradient(circle, #fff, #000);
    transition: left 0.4s step-end;
}
/* On: ripple 跟随 thumb 右移 — thumb 中心 = 16+10=26dp, 26-24=2dp */
.blog-dark-switch input:checked + .blog-dark-switch__track .blog-dark-switch__ripple-container {
    left: 2px;
}
/* Ripple 背景色跟随主题 */
.blog-dark-switch__ripple-container .mdl-ripple {
    background: var(--md-primary);
}

/* 隐藏原生 checkbox */
.blog-dark-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* === 暗色模式下的 Switch + 图标按钮适配 === */
/* Switch Off 文字 → 70% 白 */
html[data-mode="dark"] .blog-dark-switch__label {
    color: rgba(255,255,255,0.70);
}
.blog-dark-switch:hover {
    background: rgba(255,255,255,0.04);
}
/* Switch Off Track → 30% 白（仅 unchecked） */
html[data-mode="dark"] .blog-dark-switch:not(:has(input:checked)) .blog-dark-switch__track {
    background: rgba(255,255,255,0.30);
}
/* Switch Off Thumb → #bdbdbd（仅 unchecked，MD1 无 border） */
html[data-mode="dark"] .blog-dark-switch:not(:has(input:checked)) .blog-dark-switch__thumb {
    background: #bdbdbd;
}
/* Switch On Track 暗色模式 — primary 50%（覆盖 Off 规则） */
html[data-mode="dark"] .blog-dark-switch:has(input:checked) .blog-dark-switch__track {
    background: color-mix(in srgb, var(--md-primary) 50%, transparent);
}
/* Switch On Thumb 暗色模式 — primary 100% */
html[data-mode="dark"] .blog-dark-switch:has(input:checked) .blog-dark-switch__thumb {
    background: var(--md-primary);
}

/* 图标按钮暗色适配 */
html[data-mode="dark"] .footer-icon-btn {
    color: rgba(255,255,255,0.70);
}
html[data-mode="dark"] .footer-icon-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}

/* === auto 模式 — 同 dark 逻辑 === */
html[data-mode="auto"] .blog-dark-switch__label {
    color: rgba(255,255,255,0.70);
}
html[data-mode="auto"] .blog-dark-switch:not(:has(input:checked)) .blog-dark-switch__track {
    background: rgba(255,255,255,0.30);
}
html[data-mode="auto"] .blog-dark-switch:not(:has(input:checked)) .blog-dark-switch__thumb {
    background: #bdbdbd;
}
/* Switch On Track/Thumb auto 模式 — primary 色跟随 */
html[data-mode="auto"] .blog-dark-switch:has(input:checked) .blog-dark-switch__track {
    background: color-mix(in srgb, var(--md-primary) 50%, transparent);
}
html[data-mode="auto"] .blog-dark-switch:has(input:checked) .blog-dark-switch__thumb {
    background: var(--md-primary);
}
html[data-mode="auto"] .footer-icon-btn {
    color: rgba(255,255,255,0.70);
}
html[data-mode="auto"] .footer-icon-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}

@media (prefers-color-scheme: dark) {
    html[data-mode="auto"] .blog-dark-switch__label {
        color: rgba(255,255,255,0.70);
    }
    html[data-mode="auto"] .blog-dark-switch:not(:has(input:checked)) .blog-dark-switch__track {
        background: rgba(255,255,255,0.30);
    }
    html[data-mode="auto"] .blog-dark-switch:not(:has(input:checked)) .blog-dark-switch__thumb {
        background: #bdbdbd;
    }
    /* Switch On Track/Thumb auto 模式 @media dark — primary 色跟随 */
    html[data-mode="auto"] .blog-dark-switch:has(input:checked) .blog-dark-switch__track {
        background: color-mix(in srgb, var(--md-primary) 50%, transparent);
    }
    html[data-mode="auto"] .blog-dark-switch:has(input:checked) .blog-dark-switch__thumb {
        background: var(--md-primary);
    }
    html[data-mode="auto"] .footer-icon-btn {
        color: rgba(255,255,255,0.70);
    }
    html[data-mode="auto"] .footer-icon-btn:hover {
        background: rgba(255,255,255,0.08);
        color: rgba(255,255,255,0.95);
    }
}

