/**
 * 整页滚动条（页面最右侧那一条）：细、半透明、没有轨道底色，鼠标移上去才稍微亮一点。
 * 与工作台（includes/home_workbench.css）的滚动条同一个样子：6px，深色主题白 14%、浅色主题墨色 14%。
 *
 * 用在：文章（blog.php）、创作者（creators.php）、无限画布首页（ai_canvas_hub.php）、热门应用（ai_create_apps_hub.php）。
 * 宽度和颜色只定整页那一条（html / body）。要放在页面其它样式表之后引入。
 *
 * 为什么之前是粗的：
 *   · 文章 / 创作者没有引入全站的深色样式，整页滚动条是浏览器默认的（约 15px）；
 *   · 无限画布 / 热门应用引入了 design-dark*.css，那里给 [data-theme="dark"] 设了 scrollbar-color。
 *     新版 Chrome / Edge（121 起）只要元素上有 scrollbar-color / scrollbar-width，就不再理会 ::-webkit-scrollbar，
 *     而 scrollbar-color 只能改颜色、改不了宽度，所以也是粗的。
 * 做法：在支持 ::-webkit-scrollbar 的浏览器里，把整页这一条的两个标准属性还原成 auto，再用伪元素定宽度和颜色；
 *       不支持的浏览器（Firefox）用标准属性的 thin。
 */
@supports selector(::-webkit-scrollbar) {
    /* scrollbar-color 会继承：还原之后，页面里没有自己单独设过标准属性的滚动区域也回到 ::-webkit-scrollbar 那一套，
       也就是 design-dark*.css 里本来写好的 4px 细滚动条（之前同样因为上面的原因没有生效） */
    html,
    html > body {
        scrollbar-width: auto !important;
        scrollbar-color: auto !important;
    }
}

html::-webkit-scrollbar,
html > body::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

html::-webkit-scrollbar-track,
html > body::-webkit-scrollbar-track,
html::-webkit-scrollbar-corner,
html > body::-webkit-scrollbar-corner {
    background: transparent !important;
}

html::-webkit-scrollbar-button,
html > body::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* 没标主题时用一个深浅底色上都看得见的中性灰 */
html::-webkit-scrollbar-thumb,
html > body::-webkit-scrollbar-thumb {
    border-radius: 3px !important;
    background: rgba(140, 144, 165, 0.36) !important;
}

html::-webkit-scrollbar-thumb:hover,
html > body::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 144, 165, 0.6) !important;
}

html[data-theme="dark"]::-webkit-scrollbar-thumb,
html[data-theme="dark"] > body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"]::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] > body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

html[data-theme="light"]::-webkit-scrollbar-thumb,
html[data-theme="light"] > body::-webkit-scrollbar-thumb {
    background: rgba(15, 18, 40, 0.14) !important;
}

html[data-theme="light"]::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] > body::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 18, 40, 0.3) !important;
}

/* Firefox 没有上面那组伪元素：用标准属性（细 + 同样的颜色） */
@supports not selector(::-webkit-scrollbar) {
    html {
        scrollbar-width: thin;
        scrollbar-color: rgba(140, 144, 165, 0.45) transparent;
    }

    html[data-theme="dark"] {
        scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    }

    html[data-theme="light"] {
        scrollbar-color: rgba(15, 18, 40, 0.18) transparent;
    }
}
