html {
    height: 100svh !important;
    overflow: hidden;
}

body {
    background-color: white;
    overflow: hidden;
}

/* 有弹框时 */
[dialog='yes'] .main-view>div {
    z-index: -1;
}

[dialog='yes'] header .tips,
[dialog='yes'] .form-view {
    display: none;
}

/* 全屏时 */
[isfull='yes'] header .tips,
[isfull='yes'] .main-view>div.book,
[isfull='yes'] .main-view>div.menu {
    display: none;
}

[isfull='yes'] .form-view {
    top: 0;
    margin-right: 260px;
}

[isfull='yes'] .search-list {
    top: 46px;
    margin-right: 260px;
}

/* 手机模式 */
[phone='yes'][isfull='no'] .form-view {
    right: 160px;
    top: 2px;
    box-shadow: none;
}

[phone='yes'][isfull='no'] .search-list {
    right: 160px;
    top: 46px;
}

[phone='yes'] .tips {
    left: 200px;
}

/* 查询表单 */
.form-view {
    position: fixed;
    right: 180px;
    top: 49px;
    padding: 10px;
    font-size: 0;
    box-shadow: rgb(213 221 225) 0px 4px 6px;
    background-color: #ffffff;
    width: 260px;
    white-space: nowrap;
}

.form-view input {
    line-height: 26px;
    height: 26px;
    width: 200px;
    padding: 0 5px;
    outline: none;
    font-size: 12px;
    border-width: 1px 0 1px 1px;
    border-color: #2c6ddc;
    border-radius: 0;
}

.form-view:focus-within input {
    border-color: #2a5cb0;
}

.form-view button {
    height: 26px;
    width: 40px;
    display: inline-block;
    vertical-align: top;
    background-color: #2c6ddc;
    color: white;
    border: none;
    outline: none;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    padding: 0;
}

.form-view:focus-within button {
    background-color: #2a5cb0;
}

.search-list {
    position: fixed;
    right: 180px;
    top: 95px;
    width: 420px;
    max-height: calc(100% - 200px) !important;
    background-color: rgb(255, 255, 255);
    z-index: 2;
    box-shadow: rgb(213 221 225) 0px 4px 6px;
    border: none !important;
    overflow: auto;
    padding: 6px;
}

.search-list>.search-head {
    padding: 8px 10px 6px;
    font-size: 12px;
}

.search-list>.item {
    padding: 9px 12px;
    cursor: pointer;
    margin: 2px 0;
    border-radius: 8px;
}

.search-list>.item:hover {
    background-color: #e8f1f9;
}

.search-list>.item>.item-head {
    display: flex;
    align-items: center;
}

.search-list>.item>.title {
    font-size: 14px;
    line-height: 1.45;
}

.search-list>.item>.crumb {
    margin-top: 3px;
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.search-list>.item>.crumb .crumb-sep {
    margin: 0 4px;
}

.search-list>.item mark {
    border-radius: 3px;
    padding: 0 1px;
}

.search-list>.notify {
    text-align: center;
    line-height: 40px;
    font-weight: 800;
    font-family: cursive;
    font-style: italic;
}

.search-list>.notify.error {
    color: red;
}

.search-list>.notify.msg {
    color: black;
}

/* 页头 */
body>header {
    background-color: #ffffff;
    padding: 10px;
    height: 50px;
    box-shadow: rgb(213 221 225) 0px 4px 6px;
    background-image: url("../images/logo.png");
    background-size: auto 90%;
    background-repeat: no-repeat;
    padding-left: 70px;
    background-position: 15px center;
}

body>header>h2 {
    font-family: cursive;
    color: #0855d7;
    font-weight: 200;
}

body>header>h2>.total {
    font-size: 16px;
    color: black;
}

body>header>h2>.total>.value {
    font-weight: 800;
    text-align: center;
    color: red;
    padding: 0 5px;
    display: inline-block;
    min-width: 40px;
}

body>header>.tips {
    font-size: 12px;
    color: #2196f3;
    background-color: #ffeb3b;
    position: fixed;
    user-select: none;
    width: 500px;
    line-height: 30px;
    height: 30px;
    left: calc(50% - 250px);
    top: 10px;
    text-align: center;
}

body>header>.github {
    user-select: none;
    position: fixed;
    z-index: 1;
}

body>header>.github[tag='type1'] {
    right: 20px;
    top: 0;
    line-height: 50px;
    color: black;
    text-decoration: underline;
    font-size: 15px;
    font-style: italic;
    font-weight: 200;
    cursor: pointer;
    z-index: 1;
}

body>header>.github[tag='type2'] {
    transform: rotate(-45deg);
    line-height: 18px;
    transform-origin: 150px 23px;
    text-align: center;
    display: inline-block;
    bottom: 46px;
    right: -107px;
    width: 300px;
    background-color: #2196f3;
    outline: 4px solid #2196f3;
    border: 2px dashed #ffffff;
    color: #ffffff;
    font-size: 12px;
}

body>header>.github:hover {
    font-weight: 400;
}

/* 页面布局 */
.main-view {
    white-space: nowrap;
    font-size: 0;
}

.main-view>div {
    vertical-align: top;
    display: inline-block;
    height: calc(100svh - 50px);
    font-size: 16px;
    padding: 10px;
    white-space: normal;
    overflow: auto;
}

.main-view>div:not(:last-child) {
    border-right: 1px solid rgb(188, 186, 186);
    user-select: none;
}

.main-view>div:first-child {
    border-bottom: 1px solid rgb(188, 186, 186);
}

.main-view>div:not(:last-child)>h2 {
    padding: 10px 0;
    font-size: 16px;
}

.main-view>div:not(:last-child) ul {
    padding-left: 10px;
}

.main-view>div:not(:last-child) li[is-open='no']>ul {
    display: none;
}

.main-view>div:not(:last-child) li[is-open='no']>span {
    background-image: url("../images/close.png");
}

.main-view>div:not(:last-child) li[is-open='yes']>span {
    background-image: url("../images/open.png");
}

.main-view>div:not(:last-child) li[is-open]>span {
    background-repeat: no-repeat;
    background-position: -4px center;
    background-size: 20px auto;
    padding-left: 15px;
}

.main-view>div:not(:last-child) span {
    font-weight: 400;
    font-size: 14px;
    color: #304455;
    cursor: pointer;
    margin: 7px 0;
    height: 1.2em;
    width: 100%;
    display: inline-block;
}

.menu-tip {
    display: block;
    font-size: 12px;
    line-height: 2em;
    color: gray;
    margin-left: -10px;
}

.main-view span[tag]:hover {
    text-decoration: underline;
}

/* 高亮当前打开的叶子菜单节点 */
.main-view>div:not(:last-child) li[is-on-path='yes']>span {
    outline: 2px dashed #E91E63;
    width: fit-content;
    padding: 0 5px;
    border-radius: 3px;
    text-decoration: none;
    max-width: 100%;
    cursor: auto;
    height: auto;
}

.kind-title {
    margin-left: -10px;
    width: calc(100% + 10px);
    font-weight: 800;
    padding: 10px 0;
    font-size: 16px;
}

.kind-title>i {
    font-size: 12px;
    font-weight: 800;
    color: red;
    text-decoration: underline;
}

.main-view>.book {
    width: 260px;
}

.main-view>.menu {
    width: 260px;
    position: relative;
}

/* 回到首页 */
.goback {
    background-image: url('../images/home.png');
    position: fixed;
    left: 0px;
    bottom: 70px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background-size: 80% auto;
    z-index: 2;
    background-color: #f7f7f7;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 0 6px 0px black;
}

/* 切换文字 */
.lang-change {
    position: fixed;
    left: 0;
    bottom: 10px;
    background-color: rgb(255, 255, 255);
    box-shadow: 0 0 6px 0px #d6cdcd;
    padding: 10px 5px;
    font-size: 12px;
    z-index: 2;
}

.lang-change>span {
    cursor: pointer;
    margin: 0 5px;
    padding: 2px 0;
    display: inline-block;
}

.lang-change>span.active {
    background-color: #334669;
    padding: 2px 5px;
    color: white;
}

/* 快捷导航 */
.quick-link {
    position: fixed;
    left: 160px;
    bottom: 94px;
    background-color: white;
    border: 1px solid rgb(188, 186, 186);
    border-top: none;
    padding: 5px 10px;
    width: 70px;
    border-radius: 0 0 10px 10px;
}

.quick-link>a {
    display: block;
    font-size: 12px;
    height: 80px;
    width: 50px;
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    padding-top: 48px;
    line-height: 30px;
    text-align: center;
    color: black;
}

.quick-link>a.toolbox {
    background-image: url('../images/toolbox.png');
}

/* 例子 */
.example-view {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(228, 224, 224, 0.661);
    display: none;
    z-index: 20;
}

.example-view>div {
    width: 90%;
    height: 90%;
    position: fixed;
    top: 5%;
    left: 5%;
    background-color: white;
    font-size: 0;
    box-shadow: 0 0 16px black;
}

.example-view>div>div {
    display: inline-block;
    font-size: 16px;
    white-space: normal;
    vertical-align: top;
    outline: 1px solid #8c9da5;
    margin: 20px 0 0 20px;
}

.example-view>div>div>h2 {
    border-bottom: 1px solid #8c9da5;
    height: 50px;
    line-height: 50px;
    padding: 0 20px;
    position: relative;
    font-family: cursive;
}

.example-view>div>div>.iframe,
.example-view>div>div>textarea {
    width: 100%;
    height: calc(100% - 50px);
}

.example-view>div>div>.iframe>iframe,
.example-view>div>div>textarea {
    outline: none;
    border: none;
}

.example-view>div>div>.iframe>iframe {
    width: 100%;
    height: calc(100% - 240px);
}

.example-view>div>div>.iframe>.f12 {
    width: 100%;
    height: 240px;
    border-top: 1px solid #8c9da5;
}

.example-view>div>div>textarea {
    padding: 10px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    resize: none;
}

.example-view>div>div>h2>button {
    position: absolute;
    right: 10px;
    top: 10px;
    height: 30px;
    line-height: 30px;
    padding: 0 20px;
    border: none;
    outline: none;
    color: white;
    cursor: pointer;
}

.example-view>div>div>h2>button.run {
    background-color: red;
}

.example-view>div>div>h2>button.close {
    background-color: #e6e3dd;
}

/* 解释说明 */
.explain-view {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.3);
}

.explain-view>div {
    width: calc(100svw - 420px);
    height: calc(100svh - 50px);
    position: fixed;
    top: 25px;
    right: 210px;
    background-color: #ffffff;
    font-size: 0;
    white-space: nowrap;
    box-shadow: 0 0 16px black;
    overflow: auto;
    border-radius: 10px;
}

.explain-view>div::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.explain-view>button {
    position: fixed;
    top: 40px;
    right: 160px;
    background-image: url("../images/close-pink.png");
    height: 40px;
    width: 40px;
    font-size: 0;
    background-size: auto 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}

/* 按钮 */

.doc a.to-editor-btn {
    margin: 30px 0 40px 0;
    display: block;
    width: fit-content;
    font-size: 16px;
    color: #0286b6;
    border-bottom: 1px solid #0286b6;
    padding: 0 5px;
    font-family: cursive;
    font-weight: 600;
    text-decoration: none;
}

.editor-btn,
.full-btn {
    position: fixed;
    top: 49px;
    right: 10px;
    cursor: pointer;
    background-position: center center;
    background-repeat: no-repeat;
    width: 50px;
    height: 50px;
    border-style: solid;
    border-color: rgb(188, 186, 186);
    background-color: rgb(255, 255, 255);
}

.editor-btn[isFull='yes'],
.full-btn[isFull='yes'] {
    top: 0;
    right: 256px;
}

/* 编辑按钮 */
.editor-btn {
    margin-right: 65px !important;
    background-size: 100% auto;
    background-image: url('../images/edit.png');
    border-width: 0 0 1px 1px;
    border-radius: 0 0 0 10px;
}

/* 全屏右侧 */

.fixed-view>.right {
    position: fixed;
    right: 15px;
    top: 10px;
    width: 230px;
    height: calc(100% - 20px);
    overflow: auto;
    padding: 10px;
    outline: 1px solid rgb(205, 203, 203);
    background-color: white;
    border-radius: 5px;
}

.fixed-view>.right>.sponsors {
    background-position: center center;
    background-size: 100% auto;
    background-repeat: no-repeat;
}

.fixed-view>.right>.sponsors.zfb {
    height: 335px;
    background-image: url("../images/zfb.jpeg");
}

.fixed-view>.right>.sponsors.wx {
    height: 200px;
    background-image: url("../images/wx.jpeg");
}

.fixed-view>.right>.help {
    font-size: 12px;
    padding: 10px;
}

.fixed-view>.right>.help>.title {
    font-weight: 800;
    font-size: 14px;
    display: block;
    line-height: 2.5em;
}

.fixed-view>.right>.help>a {
    color: rgb(10, 165, 226);
    text-decoration: underline;
}

/* 最大化快速定位相关 */
.full-btn {
    background-size: 70% auto;
    margin-right: 20px !important;
    border-width: 0 1px 1px 0;
    border-radius: 0 0 10px 0;
}

.full-btn[tag='toFull'] {
    background-image: url('../images/icon1.png');
}

.full-btn[tag='toRight'] {
    background-image: url('../images/icon2.png');
}

.fixed-view {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #f7f7f7;
    display: none;
}

.fixed-view>.menu {
    position: fixed;
    left: 15px;
    top: 10px;
    width: 230px;
    height: calc(100% - 181px);
    overflow: auto;
    padding: 10px;
    outline: 1px solid rgb(205, 203, 203);
    background-color: white;
    border-radius: 5px;
}

.fixed-view>.menu>h1 {
    padding: 10px 0;
    font-size: 16px;
    border-bottom: 1px solid rgb(205, 203, 203);
}

.fixed-view>.menu>h2,
.fixed-view>.menu>h3,
.fixed-view>.menu>h4 {
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 400;
}

.fixed-view>.menu>h2:hover,
.fixed-view>.menu>h3:hover,
.fixed-view>.menu>h4:hover {
    text-decoration: underline;
}

.fixed-view>.menu>h2 {
    padding-left: 1em;
}

.fixed-view>.menu>h3 {
    padding-left: 2em;
}

.fixed-view>.menu>h4 {
    padding-left: 3em;
}

.link-btns {
    padding: 10px;
    padding-right: 0;
}

.link-btns>a {
    text-decoration: underline;
    margin-right: 10px;
    color: #555555;
}

.link-btns>a:hover {
    color: #000000;
}

.f12>.nav {
    background-color: #cadcea;
    color: #424648;
    padding: 0 10px;
}

.f12>.nav>li {
    display: inline-block;
    line-height: 30px;
    padding: 0 10px;
    cursor: pointer;
}

.f12>.nav>li.active {
    color: #2196F3;
    font-weight: 800;
    border-bottom: 2px solid #2196F3;
}

/* 控制台 */
ul#f12-console {
    overflow: auto;
    font-size: 12px;
    font-weight: 200;
    background-color: white;
    height: calc(100% - 35px);
}

ul#f12-console>li {
    border-bottom: 1px solid #e2e1e1;
    padding: 5px;
}

ul#f12-console>li.blank:first-child:last-child {
    display: block;
}

ul#f12-console>li.blank {
    display: none;
    border-bottom: none;
    text-align: center;
    padding-top: 100px;
    font-size: 26px;
    font-family: monospace;
    color: #9e9e9e;
    font-weight: 200;
}

ul#f12-console>li [isopen] {
    position: relative;
}

ul#f12-console>li [isopen]:before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    position: absolute;
    left: -15px;
    top: 4px;
}

ul#f12-console>li [isopen='no']>div {
    display: none;
}

ul#f12-console>li [isopen='no']:before {
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid #9e9e9e;
}

ul#f12-console>li [isopen='yes']:before {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 10px solid #9e9e9e;
}

ul#f12-console>li [defType='showobject'] span {
    display: block;
    margin-top: 5px;
}

ul#f12-console>li [defType='showobject'] .item {
    margin-left: 20px;
}

ul#f12-console>li [defType='showobject'] i {
    font-style: normal;
    cursor: pointer;
}

ul#f12-console>li .item {
    white-space: nowrap;
}

ul#f12-console>li>.item {
    margin-left: 15px;
}

/* ---------- 基础 ---------- */

html,
body {
    background-color: var(--bg);
    color: var(--ink);
}

body {
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--line-2);
    border-radius: 10px;
    border: 3px solid var(--bg);
    box-shadow: none;
}

::-webkit-scrollbar-track {
    background-color: transparent;
    box-shadow: none;
}

body>#process {
    background-color: var(--accent);
}

/* ---------- 页头 ---------- */

body>header {
    background-color: var(--card);
    box-shadow: none;
    border-bottom: 1px solid var(--line);
    background-size: auto 62%;
    padding-left: 62px;
    background-position: 14px center;
}

body>header>h2 {
    font-family: var(--font);
    color: var(--ink);
    font-weight: 600;
    font-size: 15.5px;
    letter-spacing: -.01em;
    line-height: 30px;
}

body>header>h2>.total {
    color: var(--ink-3);
    font-size: 11.5px;
    font-family: var(--mono);
    letter-spacing: .02em;
}

body>header>h2>.total>.value {
    color: var(--accent);
    font-weight: 500;
    font-family: var(--mono);
    min-width: 34px;
    padding: 0 3px;
}

body>header>.tips {
    background-color: #fffaea;
    color: #8a6a1c;
    border: 1px solid #f1e2b9;
    border-radius: 8px;
    line-height: 28px;
    height: 30px;
    font-size: 11.5px;
    letter-spacing: .01em;
}

html[data-theme="dark"] body>header>.tips {
    background-color: #221d12;
    color: #d5bf8a;
    border-color: #3a3222;
}

body>header>.github[tag='type1'] {
    color: var(--ink-2);
    font-style: normal;
    font-weight: 400;
    font-size: 12.5px;
    text-decoration: none;
}

body>header>.github[tag='type1']:hover {
    color: var(--ink);
    text-decoration: none;
}

body>header>.github[tag='type2'] {
    background-color: var(--ink);
    outline: 4px solid var(--ink);
    border: 2px dashed var(--bg);
    color: var(--bg);
    font-size: 11.5px;
}

body>header>.privacy {
    color: var(--ink-2) !important;
    font-style: normal !important;
    font-weight: 400 !important;
    font-size: 12.5px !important;
    text-decoration: none !important;
    line-height: 50px !important;
}

body>header>.privacy:hover {
    color: var(--ink) !important;
    text-decoration: underline !important;
}

/* ---------- 三栏骨架 ---------- */

.main-view>div:not(:last-child) {
    border-right-color: var(--line);
}

.main-view>div:first-child {
    border-bottom-color: var(--line);
}

.main-view>div {
    padding: 14px 16px;
}

/* 一级分组标题 */
.kind-title {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .17em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 16px 0 8px;
    margin-left: 0;
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.kind-title:first-child {
    padding-top: 2px;
}

.kind-title>i {
    font-family: var(--font);
    font-size: 10.5px;
    font-weight: 400;
    font-style: normal;
    color: var(--ink-3);
    text-decoration: none;
    letter-spacing: .02em;
    opacity: .8;
}

.main-view>div:not(:last-child)>h2 {
    padding: 2px 0 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
    font-family: var(--font);
}

/* 菜单条目 */
.main-view>div:not(:last-child) span {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 400;
    margin: 1px 0;
    height: auto;
    line-height: 1.9;
    border-radius: 6px;
    transition: color .14s ease, background-color .14s ease;
}

.main-view>div:not(:last-child) span:hover {
    color: var(--ink);
}

.main-view span[tag]:hover {
    text-decoration: none;
    color: var(--accent);
}

.main-view>div:not(:last-child) ul {
    padding-left: 8px;
}

/* 展开/收起：用 CSS 三角替代黑色 png，深浅色都清晰 */
.main-view>div:not(:last-child) li[is-open]>span {
    background-image: none !important;
    padding-left: 0;
    position: relative;
}

.main-view>div:not(:last-child) li[is-open]>span::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid var(--ink-3);
    border-top: 3.5px solid transparent;
    border-bottom: 3.5px solid transparent;
    margin-right: 8px;
    vertical-align: 1px;
    transition: transform .16s ease;
}

.main-view>div:not(:last-child) li[is-open='yes']>span::before {
    transform: rotate(90deg);
}

/* 当前所在节点：去掉玫红虚线框，改为浅底 + 强调色左线 */
.main-view>div:not(:last-child) li[is-on-path='yes']>span {
    outline: none;
    background-color: var(--sink);
    border-radius: 6px;
    padding: 0 9px;
    margin-left: -9px;
    width: auto;
    max-width: calc(100% + 9px);
    height: auto;
    color: var(--ink);
    cursor: auto;
}

.main-view>div:not(:last-child) li[is-on-path='yes']>span::before {
    margin-left: 0;
}

.menu-tip {
    color: var(--ink-3);
    font-size: 11px;
    line-height: 1.8;
    margin-left: 0;
}

/* ---------- 正文区 ---------- */

/* 说明：.main-view>div 的 padding 优先级高于 .doc，这里用同样的组合选择器覆盖 */
.main-view>div.doc {
    padding: 56px 40px 80px;
    box-sizing: border-box;
    counter-reset: h2;
}

/* 标题上方的路径行（由脚本按菜单层级写入，仅作阅读引导） */
.doc-crumb {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--ink-3);
    line-height: 1.6;
    margin-bottom: 14px;
    max-width: 780px;
}

.doc-crumb i {
    font-style: normal;
    margin: 0 7px;
    color: var(--line-2);
}

.doc-crumb span:last-child {
    color: var(--ink-2);
}

.doc>header {
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.3;
    padding: 0 0 18px;
    color: var(--ink);
    max-width: 780px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}

/* 标题下方的分类标签 */

.doc>h2 {
    counter-increment: h2;
    font-size: 17.5px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.6;
    padding: 0;
    margin: 34px 0 8px;
    border: 0;
    color: var(--ink);
    max-width: 780px;
}

.doc>h2::before {
    content: counter(h2, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .08em;
    color: var(--ink-3);
    margin-right: 12px;
    vertical-align: 2px;
}

.doc>h3 {
    font-size: 15px;
    font-weight: 600;
    padding: 12px 0 6px;
    color: var(--ink);
    max-width: 780px;
}

.doc>h4 {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    letter-spacing: .06em;
    padding: 12px 0 4px;
    max-width: 780px;
}

.doc>p {
    font-size: 15.5px;
    line-height: 2;
    color: var(--ink);
    text-indent: 0;
    margin: 14px 0;
    max-width: 780px;
}

.doc a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--accent-soft);
}

.doc a:hover {
    text-decoration-color: var(--accent);
}

.doc ul,
.doc ol {
    font-size: 13.5px;
    line-height: 2.1;
    color: var(--ink-2);
    max-width: 780px;
}

.doc .title {
    font-family: var(--serif);
    color: var(--ink);
    font-weight: 700;
    font-size: 19px;
}

.doc .warn,
.doc .gray {
    color: var(--ink);
    font-weight: 600;
}

.doc .important {
    color: #d9372b;
}

html[data-theme="dark"] .doc .important {
    color: #ff8a7a;
}

.doc .tips {
    background-color: #fffaea;
    border-left-color: #f0c24b;
    color: #7c5f18;
    border-radius: 0 8px 8px 0;
    font-size: 13.5px;
}

.doc .tips::before {
    background-color: #f0c24b;
    color: #40300a;
}

html[data-theme="dark"] .doc .tips {
    background-color: #221d12;
    border-left-color: #7a6320;
    color: #d8c391;
}

html[data-theme="dark"] .doc .tips::before {
    background-color: #7a6320;
    color: #f4ecd8;
}

.doc .tips-info {
    border-top-color: var(--line);
    color: var(--ink-3);
}

.doc .click {
    color: var(--accent);
}

.doc .pip-block {
    background-color: var(--sink);
    color: var(--ink-2);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
}

.doc .oneline {
    padding-left: 0;
}

/* 表格 */
.doc>table {
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
}

.doc>table>tbody>tr>* {
    border-color: var(--line);
}

.doc>table>tbody>tr:nth-child(2n) {
    background-color: var(--bg-soft);
}

.doc>table>tbody>tr:nth-child(2n + 1) {
    background-color: transparent;
}

.doc>table>thead>tr {
    background-color: var(--sink);
    border-color: var(--line);
    color: var(--ink);
    font-weight: 600;
}

/* 例子按钮 */
.doc>button[tag] {
    background: var(--ink);
    color: var(--bg);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: var(--font);
    margin: 16px 0;
    transition: opacity .16s ease;
}

.doc>button[tag]:hover {
    opacity: .86;
}

/* 代码块：shader.js 只输出 token 类名，容器与配色都由这里决定 */
.doc pre,
.explain-view pre {
    background-color: #f7f8fa !important;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px !important;
    line-height: 1.8 !important;
    margin: 16px 0;
    max-width: 780px;
    box-sizing: border-box;
    overflow: auto;
}

html[data-theme="dark"] .doc pre,
html[data-theme="dark"] .explain-view pre {
    background-color: #1b1f27 !important;
    border-color: #2b3040;
}

/* 浅色：纸面 + 清淡语法色 */
pre .tk-t {
    color: #1f2328;
}

pre .tk-c {
    color: #6a9955;
}

pre .tk-s {
    color: #a0a6ad;
}

pre .tk-n {
    color: #1e50b3;
}

pre .tk-a {
    color: #1e83b1;
}

pre .tk-v {
    color: #b05730;
}

pre .tk-k {
    color: #d1242f;
}

/* 墨黑：提亮一档，避免整块发死 */
html[data-theme="dark"] pre .tk-t {
    color: #dfe4ec;
}

html[data-theme="dark"] pre .tk-c {
    color: #8ad2a0;
}

html[data-theme="dark"] pre .tk-s {
    color: #7d8590;
}

html[data-theme="dark"] pre .tk-n {
    color: #8fc0ff;
}

html[data-theme="dark"] pre .tk-a {
    color: #d0b8ff;
}

html[data-theme="dark"] pre .tk-v {
    color: #a9d7c4;
}

html[data-theme="dark"] pre .tk-k {
    color: #ff9a90;
}

.doc pre>.copy-icon {
    background-color: transparent;
    border: 0;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    right: 10px;
    top: 10px;
    opacity: .75;
    transition: opacity .16s ease;
}

/* 复制提示块与按钮同高、同一条基线 */
.doc pre>.copy-icon[copied]::before {
    width: 58px;
    height: 30px;
    line-height: 30px;
    left: -58px;
    top: 0;
    border-radius: 4px 0 0 4px;
}

.doc pre>.copy-icon[copied] {
    outline: 1px solid var(--line-2);
    border-radius: 0 4px 4px 0;
}

.doc pre>.copy-icon:hover {
    opacity: 1;
}

html[data-theme="dark"] .doc pre>.copy-icon {
    filter: invert(1);
    opacity: .6;
}

/* ---------- 顶部搜索 ---------- */

.form-view {
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
    box-shadow: none;
    padding: 4px;
    height: 36px;
    width: 268px;
    top: 49px;
    border-top: none;
}

.form-view input {
    border: none;
    border-radius: 6px;
    line-height: 26px;
    height: 28px;
    width: 209px;
    padding: 0 8px;
    font-size: 12px;
    background: transparent;
    color: var(--ink);
    caret-color: var(--accent);
}

.form-view input::placeholder {
    color: var(--ink-3);
}

.form-view button {
    height: 28px;
    line-height: 28px;
    width: 48px;
    border-radius: 6px;
    background-color: var(--ink);
    color: var(--bg);
    font-size: 12px;
}

.form-view:focus-within button {
    background-color: var(--ink);
    opacity: .86;
}

.search-list {
    top: 93px;
    width: 420px;
    max-width: calc(100vw - 32px);
    background-color: var(--card);
    border: 1px solid var(--line) !important;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
    padding: 6px;
}

/* 没有搜索结果时不要留一个空的白条 */
.search-list:empty {
    display: none;
}

/* 结果计数条 */
.search-list>.search-head {
    padding: 8px 10px 7px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--ink-3);
    border-bottom: 1px solid var(--line);
}

.search-list>.search-head b {
    color: var(--accent);
    font-weight: 600;
    padding: 0 1px;
}

.search-list>.item {
    position: relative;
    border-radius: 10px;
    margin: 2px 0;
    padding: 9px 12px 9px 14px;
    transition: background-color .15s ease;
}

.search-list>.item::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 3px;
    background-color: transparent;
    transition: background-color .15s ease;
}

.search-list>.item:hover {
    background-color: var(--sink);
}

.search-list>.item:hover::before {
    background-color: var(--accent);
}

.search-list>.item>.item-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-list>.item>.title {
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.45;
}

.search-list>.item>.crumb {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    overflow: hidden;
}

.search-list>.item>.crumb .crumb-sep {
    color: var(--line-2);
    margin: 0 4px;
}

.search-list>.item>.crumb .crumb-node:last-child {
    color: var(--ink-2);
}

.search-list>.item mark {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 3px;
    padding: 0 1px;
}

.search-list>.notify {
    font-family: var(--font);
    font-style: normal;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-3);
}

.search-list>.notify.error {
    color: #d9372b;
}

/* ---------- 悬浮工具 ---------- */

.editor-btn,
.full-btn {
    background-color: var(--card);
    border-color: var(--line);
    border-radius: 0 0 10px 10px;
    width: 44px;
    height: 44px;
    top: 49px;
    opacity: .9;
    border-top: none;
}

.editor-btn {
    margin-right: 62px !important;
    border-width: 1px;
    right: 15px;
}

.full-btn {
    margin-right: 14px !important;
    border-width: 1px;
    right: 14px;
}

.editor-btn:hover,
.full-btn:hover {
    opacity: 1;
    border-color: var(--line-2);
}

/* 图标是白底 png，深色下反相后与深色卡片自然融合，所以背景必须透明 */
html[data-theme="dark"] .editor-btn,
html[data-theme="dark"] .full-btn {
    background-color: transparent;
    border-color: transparent;
    filter: invert(1) hue-rotate(180deg);
    opacity: .75;
}

.goback {
    background-color: var(--card);
    border: 1px solid var(--line);
    border-left: none;
    box-shadow: none;
    border-radius: 0 10px 10px 0;
    opacity: .9;
    bottom: 74px;
}

.goback:hover {
    opacity: 1;
}

html[data-theme="dark"] .goback {
    background-color: transparent;
    border-color: transparent;
    filter: invert(1) hue-rotate(180deg);
    opacity: .7;
}

.lang-change {
    background-color: var(--card);
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: none;
    padding: 6px 8px;
    font-size: 11.5px;
    color: var(--ink-2);
}

.lang-change>span {
    padding: 1px 5px;
    border-radius: 5px;
    color: var(--ink-3);
    margin: 0 2px;
}

.lang-change>span.active {
    background-color: var(--sink);
    color: var(--ink);
    padding: 1px 6px;
}

.quick-link {
    background-color: var(--card);
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 10px 10px;
    width: 68px;
    padding: 4px 8px 6px;
}

.quick-link>a {
    color: var(--ink-2);
    font-size: 11px;
    height: 66px;
    padding-top: 47px;
    line-height: 22px;
    border-radius: 6px;
}

html[data-theme="dark"] .quick-link>a {
    filter: invert(1) hue-rotate(180deg);
}

/* 主题切换（左下角语言切换右侧） */
.theme-switch.docked {
    position: fixed;
    left: 112px;
    bottom: 11px;
    z-index: 3;
    padding: 2px;
    background: transparent;
    border-radius: 0 8px 8px 0;
    box-shadow: none;
    height: 30px;
    border: none;
}

.theme-switch.docked button {
    width: 24px;
    height: 24px;
}

.theme-switch.docked svg {
    width: 13px;
    height: 13px;
}

/* ---------- 弹层 ---------- */

.example-view {
    background-color: color-mix(in srgb, var(--bg) 70%, transparent);
}

.example-view>div {
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.example-view>div>div {
    outline: 1px solid var(--line);
}

.example-view>div>div>h2 {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border-bottom-color: var(--line);
    color: var(--ink);
}

.example-view>div>div>h2>button {
    border-radius: 6px;
    font-size: 12px;
    padding: 0 14px;
}

.example-view>div>div>h2>button.run {
    background-color: var(--ink);
    color: var(--bg);
}

.example-view>div>div>h2>button.close {
    background-color: var(--sink);
    color: var(--ink);
}

.example-view>div>div>textarea {
    background: var(--bg-soft);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12.5px;
}

.explain-view {
    background-color: rgba(10, 10, 12, .35);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.explain-view>div {
    background-color: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    border-radius: 14px;
}

.explain-view>div>.doc {
    padding: 26px 32px;
}

.explain-view>button {
    filter: none;
}

.fixed-view {
    background-color: var(--bg-soft);
}

.fixed-view>.menu,
.fixed-view>.right {
    background-color: var(--card);
    outline: 1px solid var(--line);
    border-radius: 12px;
}

.fixed-view>.menu>h1 {
    font-size: 14px;
    font-weight: 600;
    border-bottom-color: var(--line);
    color: var(--ink);
    margin-bottom: 15px;
}

/* 导航：父子层级 */
.fixed-view>.menu>h2 {
    position: relative;
    margin-top: 18px;
    padding: 3px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.65;
    color: var(--ink);
}

.fixed-view>.menu>h2:first-of-type {
    margin-top: 4px;
}

.fixed-view>.menu>h3 {
    position: relative;
    margin-top: 7px;
    padding: 2px 0 2px 15px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-2);
}

.fixed-view>.menu>h3::before {
    content: "";
    position: absolute;
    left: 4px;
    top: calc(50% - 1px);
    width: 6px;
    height: 1px;
    background-color: var(--line-2);
}

.fixed-view>.menu>h4 {
    position: relative;
    margin-top: 5px;
    padding: 2px 0 2px 30px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--ink-3);
}

.fixed-view>.menu>h4::before {
    content: "";
    position: absolute;
    left: 19px;
    top: calc(50% - 1px);
    width: 6px;
    height: 1px;
    background-color: var(--line);
}

.fixed-view>.menu>h2:hover,
.fixed-view>.menu>h3:hover,
.fixed-view>.menu>h4:hover {
    color: var(--accent);
    text-decoration: none;
}

.fixed-view>.right>.help {
    color: var(--ink-2);
    font-size: 11.5px;
    line-height: 1.9;
}

.fixed-view>.right>.help>.title {
    color: var(--ink);
    font-size: 13px;
}

.fixed-view>.right>.help>a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
}

.link-btns>a {
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
}

.link-btns>a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* 复制按钮提示色 */
.copy-icon[copied] {
    outline: 1px solid var(--line-2);
}

.copy-icon[copied]::before {
    background-color: var(--ink);
    color: var(--bg);
}
