/* ==========================================================================
   Noto Read — 为长文阅读设计
   字体：思源黑体 / Noto Sans SC（本地自托管，SIL OFL 1.1）
         正文仿宋 / 朱雀仿宋（本地自托管子集，SIL OFL 1.1）
   ========================================================================== */

/* 正文仿宋：朱雀仿宋 Regular（自托管，SIL OFL 1.1，见 assets/fonts/NR-FangSong-LICENSE.txt）
   子集 = 站内用字 ∪ GB2312 一级常用字（3755）+ 拉丁/标点，共约 1.3MB。
   只在系统没有仿宋的机器上下载（macOS 普遍没装），Windows 直接命中系统「仿宋」。 */
@font-face {
    font-family: "NR FangSong";
    src: url("assets/fonts/nr-fangsong.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 同一个字体文件的 optional 版本：后台「字体加载策略」选 optional 时启用，
   避免大字体到达后整段正文重排（CLS）。 */
@font-face {
    font-family: "NR FangSong Optional";
    src: url("assets/fonts/nr-fangsong.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: optional;
}

:root {
    /* ---------- 字体 ----------
       全站只认四个字体角色，任何元素都从这里取值，不再各写一套：
         --nr-font    界面区：导航、站点标题、卡片标题、元信息、按钮
         --nr-read    阅读区：文章正文、评论正文、列表摘要（由后台「全站字体」决定）
         --nr-head    标题族：文章内标题、表头
         --nr-kai     引文族：引用块
       四个「族」是字体栈本身，方案切换只改后三档指向哪个族。 */
    --nr-font: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* 黑体族：自托管思源黑体排在系统黑体之前，保证标题与界面始终是同一副字形 */
    --nr-heiti: "Noto Sans SC", "Source Han Sans SC", "Heiti SC", "SimHei", "PingFang SC", "Microsoft YaHei", sans-serif;
    /* 仿宋族：系统仿宋优先（Windows 自带且更贴近公文），没有才拉自托管的朱雀仿宋 */
    --nr-fangsong: "FangSong_GB2312", "FangSong", "STFangsong", "华文仿宋", "仿宋", "NR FangSong", "Songti SC", "SimSun", "宋体", "Noto Serif SC", serif;
    /* 楷体族：引文用；缺楷体的机器退到仿宋再退宋体，不会掉成黑体 */
    --nr-kaiti: "KaiTi_GB2312", "KaiTi", "STKaiti", "楷体", "Kaiti SC", "NR FangSong", "Songti SC", "Noto Serif SC", serif;
    /* 宋体族：传统书刊阅读 */
    --nr-songti: "Songti SC", "SimSun", "宋体", "Noto Serif SC", "Source Han Serif SC", serif;
    /* 等宽族：代码，全站共用一份 */
    --nr-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;

    /* 默认取「仿宋公文」方案；其它方案见下方 html[data-font] 覆盖 */
    --nr-read: var(--nr-fangsong);
    --nr-head: var(--nr-heiti);
    --nr-kai: var(--nr-kaiti);
    /* 阅读区字距：仿宋本身字面宽，0 即可；换黑体/宋体时补回一点，避免行气过紧 */
    --nr-read-ls: 0;

    /* 由 header.php 内联覆盖 */
    --nr-font-size: 16px;
    --nr-line-height: 1.85;
    --nr-content-width: 760px;
    --nr-anim: 1;

    /* 色板：浅色（纸张感） */
    --bg: #f7f7f5;
    --bg-card: #ffffff;
    --text: #2b2b2b;
    --text-soft: #5f6368;
    --text-faint: #6b7076;
    --border: #e8e8e5;
    --accent: #2f6f5e;
    --accent-soft: #e8f1ed;
    --on-accent: #ffffff;
    --code-bg: #f2f3f1;
    --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 8px 28px rgba(0, 0, 0, .045);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .04), 0 16px 40px rgba(0, 0, 0, .09);
    --ease: cubic-bezier(.22, .61, .36, 1);
    /* 圆角：控件与卡片统一 4px；圆形元素（头像）另用 50% */
    --nr-radius: 4px;
    --nr-radius-card: 4px;
    /* 卡片间距：正文列表、侧栏模块、评论、上下篇统一走这一个变量 */
    --nr-gap-card: 10px;
    /* 正文标题 # 装饰色：随标题级别变化，暗色方案的覆盖见下方两组 dark 变量 */
    --nr-h1-mark: var(--accent);
    --nr-h2-mark: #d94a4a;
    --nr-h3-mark: #d98518;
    --nr-h4-mark: #2b7ec4;
    --nr-h5-mark: #7b5ed6;
    --nr-h6-mark: var(--text-faint);
}

/* ---------- 全站字体方案（后台「外观 → 设置主题 → 排版 → 全站字体」）----------
   一个选项同时定下「阅读 / 标题 / 引文」三档，全站不会再冒出第四种字体。
   data-font 由 header.php 直接输出在 <html> 上，首屏就是对的，不会闪一下默认字体。 */
/* 仿宋公文：正文仿宋、标题黑体、引文楷体（默认，GB/T 9704 的做法） */
html[data-font="fangsong"] {
    --nr-read: var(--nr-fangsong);
    --nr-head: var(--nr-heiti);
    --nr-kai: var(--nr-kaiti);
    --nr-read-ls: 0;
}
/* 全站黑体：整站一种字形，层级只靠字号与字重 */
html[data-font="sans"] {
    --nr-read: var(--nr-font);
    --nr-head: var(--nr-font);
    --nr-kai: var(--nr-font);
    --nr-read-ls: .01em;
}
/* 全站仿宋：连界面也换仿宋，整站只剩一种字形，最像一份红头文件 */
html[data-font="fangsong-all"] {
    --nr-font: var(--nr-fangsong);
    --nr-read: var(--nr-fangsong);
    --nr-head: var(--nr-fangsong);
    --nr-kai: var(--nr-fangsong);
    --nr-read-ls: 0;
}
/* 宋体阅读：正文宋体、标题黑体，书刊排法 */
html[data-font="song"] {
    --nr-read: var(--nr-songti);
    --nr-head: var(--nr-heiti);
    --nr-kai: var(--nr-kaiti);
    --nr-read-ls: .008em;
}
/* 系统默认：完全不使用自托管字体，正文 / 标题 / 引文一律走本机系统栈
   （macOS 落 PingFang SC、Windows 落微软雅黑、Android 落思源黑体），
   同时 header.php 不再输出 assets/fonts*.css，等于零字体下载 */
html[data-font="system"] {
    --nr-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
    --nr-heiti: var(--nr-font);
    --nr-kaiti: var(--nr-font);
    --nr-songti: var(--nr-font);
    --nr-read: var(--nr-font);
    --nr-head: var(--nr-font);
    --nr-kai: var(--nr-font);
    --nr-read-ls: 0;
}

/* 「字体加载策略 = optional」时，正文/引文改用 optional 版仿宋 */
html[data-font-display="optional"] {
    --nr-fangsong: "FangSong_GB2312", "FangSong", "STFangsong", "华文仿宋", "仿宋", "NR FangSong Optional", "Songti SC", "SimSun", "宋体", "Noto Serif SC", serif;
    --nr-kaiti: "KaiTi_GB2312", "KaiTi", "STKaiti", "楷体", "Kaiti SC", "NR FangSong Optional", "Songti SC", "Noto Serif SC", serif;
}

html[data-theme="dark"] {
    --bg: #191a1b;
    --bg-card: #212325;
    --text: #dedede;
    --text-soft: #a8acb0;
    --text-faint: #8a9095;
    --border: #33373a;
    --accent: #7fc4ac;
    --accent-soft: #23342e;
    --on-accent: #0d2c22;
    --code-bg: #282b2d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 28px rgba(0, 0, 0, .28);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .25), 0 16px 40px rgba(0, 0, 0, .4);
    /* 标题 # 装饰在深色底上提亮，保持可读 */
    --nr-h2-mark: #f0736f;
    --nr-h3-mark: #eda34a;
    --nr-h4-mark: #63a9e8;
    --nr-h5-mark: #a68ef0;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --bg: #191a1b;
        --bg-card: #212325;
        --text: #dedede;
        --text-soft: #a8acb0;
        --text-faint: #8a9095;
        --border: #33373a;
        --accent: #7fc4ac;
        --accent-soft: #23342e;
    --on-accent: #0d2c22;
        --code-bg: #282b2d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 28px rgba(0, 0, 0, .28);
        --shadow-hover: 0 2px 4px rgba(0, 0, 0, .25), 0 16px 40px rgba(0, 0, 0, .4);
        --nr-h2-mark: #f0736f;
        --nr-h3-mark: #eda34a;
        --nr-h4-mark: #63a9e8;
        --nr-h5-mark: #a68ef0;
    }
}

*, *::before, *::after { box-sizing: border-box; }

/* rem 基准 = 正文字号：后台/阅读工具改字号时，标题、导航、元信息、侧栏会按同一比例缩放，
   否则正文 18px 而界面仍锁在浏览器默认 16px 基准上，同一页会出现两种「密度」 */
html { font-size: var(--nr-font-size, 16px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    /* 竖向弹性布局：短页面（404、空分类）也把页脚压到视口底部，不会出现页脚下方露一截底色 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--nr-font);
    font-size: 1rem;
    line-height: var(--nr-line-height);
    letter-spacing: .01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--text); }

/* 表单控件不会继承 body 的字体（浏览器一律给系统 UI 字体），
   全站显式继承，否则评论输入框、搜索框、阅读设置按钮会冒出第四种字形 */
button, input, select, textarea, optgroup { font-family: inherit; }

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--nr-radius);
}

/* 键盘用户跳过导航，直达正文 */
.nr-skip {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: 0 0 var(--nr-radius) var(--nr-radius);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: .88rem;
    transition: top .18s var(--ease);
}
.nr-skip:focus { top: 0; color: var(--text); }

img { max-width: 100%; height: auto; }

/* ---------- 顶部 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    max-width: var(--nr-shell-width, var(--nr-content-width));
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}
.site-brand {
    /* 22px = 1.375rem，与文章标题同号，站点名是页头唯一的主标题 */
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
    white-space: nowrap;
}
.site-brand:hover { color: var(--accent); }
.site-brand--logo { display: inline-flex; align-items: center; }
.site-brand--logo img {
    display: block;
    height: 30px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.site-nav {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    align-items: center;
}
.site-nav a {
    /* 0.9rem ≈ 14.4px，比站点名小两档，导航更收敛 */
    font-size: .9rem;
    color: var(--text-soft);
    position: relative;
    padding: 2px 0;
}
.site-nav a:hover, .site-nav a.current { color: var(--accent); }
.site-nav a.current::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -3px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.site-nav__admin {
    padding: 2px 10px !important;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    color: var(--text-faint) !important;
}
.site-nav__admin:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

/* ---------- 阅读设置（右上角 Aa） ---------- */
.nr-tools {
    display: none;
    flex: 0 0 auto;
    margin-left: 4px;
}
.nr-js .nr-tools { display: flex; }

.nr-tools__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    font: inherit;
    cursor: pointer;
    transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.nr-tools__btn:hover,
.nr-tools__btn[aria-expanded="true"] {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: var(--accent-soft);
}
.nr-tools__aa {
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
}

/* 页头右侧动作区：桌面是「搜索 + Aa」；窄屏再多一个菜单图标，顺序为「菜单 / 搜索 / Aa」 */
.nr-headacts {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}
.nr-headacts .nr-tools { margin-left: 0; }

/* 图标按钮：与 Aa 同尺寸同外观。默认不显示（无 JS 时点了没反应，索性不露出），
   桌面只显搜索，窄屏再补上菜单，见下方两条规则 */
.nr-iconbtn {
    display: none;
    appearance: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    font: inherit;
    cursor: pointer;
    transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.nr-iconbtn:hover,
.nr-iconbtn[aria-expanded="true"] {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: var(--accent-soft);
}
.nr-iconbtn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}
/* 菜单图标：展开时变成叉，提示再点一下收起 */
.nr-iconbtn__close { display: none; }
.nr-iconbtn[aria-expanded="true"] .nr-iconbtn__menu { display: none; }
.nr-iconbtn[aria-expanded="true"] .nr-iconbtn__close { display: block; }

/* 桌面端导航已经横排，只留搜索图标（同样排在 Aa 左侧）；菜单图标仍然只在窄屏出现 */
.nr-js #nr-search-btn { display: inline-flex; position: relative; }

/* 快捷键提示：滚过一屏后从搜索按钮右下角浮出一枚小键帽，提示可以直接按 / 搜索。
   只做提示，不接鼠标事件（按钮本身就在下面，点哪都一样） */
.nr-iconbtn__key {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-card);
    color: var(--text-faint);
    font-size: .6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 10%, transparent);
    pointer-events: none;
}
.nr-js #nr-search-btn .nr-iconbtn__key.is-on {
    display: inline-flex;
    animation: nr-key-in .22s var(--ease) both;
}
@keyframes nr-key-in {
    from { opacity: 0; transform: translateY(-3px) scale(.85); }
    to   { opacity: 1; transform: none; }
}

/* 搜索面板：通栏——从页头下沿整幅拉开，不是一个贴边的小浮块。
   桌面与窄屏同一套，只有内部左右内边距不同（见窄屏段落）。 */
.nr-search { display: none; }
.nr-js .nr-search:not([hidden]) {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 6;
    display: block;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: nr-drawer-in .18s var(--ease) both;
}
@keyframes nr-drawer-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
/* 内容与站点外壳同宽同左缘，搜索框拉满，不和正文错位 */
.nr-search__inner {
    max-width: var(--nr-shell-width, var(--nr-content-width));
    margin: 0 auto;
    padding: 10px 20px 12px;
}
.nr-search__form { display: flex; align-items: center; gap: 8px; }
.nr-search__input {
    flex: 1 1 auto;
    min-width: 0;
    font: inherit;
    /* 16px：iOS 聚焦输入框时不会因为字号小于 16 而自动放大页面 */
    font-size: 1rem;
    /* 正文的 1.85 行高会把输入框撑到 48px，搜索框用 1.45 收到 40px 上下 */
    line-height: 1.45;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: var(--text);
}
.nr-search__input::placeholder { color: var(--text-faint); }
.nr-search__input:focus {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.nr-search__submit {
    appearance: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: var(--nr-radius);
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
}
.nr-search__submit:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.nr-search__submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

/* 搜索框下方的词组（热门 / 推荐）：一行一组，放不下就换行 */
.nr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
}
.nr-chips__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.nr-chips__label {
    font-size: .78rem;
    color: var(--text-faint);
    letter-spacing: .02em;
}
.nr-chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-soft);
    font-size: .8rem;
    line-height: 1;
    max-width: 14em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.nr-chip:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: var(--accent-soft);
}
/* 搜索结果为空时，词组居中摆在提示下面 */
.empty-state .nr-chips {
    justify-content: center;
    margin-top: 18px;
}

/* 搜索结果页 */
.empty-state__hint { margin: 8px 0 0; font-size: .88rem; color: var(--text-faint); }

.nr-panel {
    position: absolute;
    top: calc(100% + 8px);
    /* 基准：页头右侧 Aa 按钮（按钮右缘距外壳右缘正好 20px），再向右探出 24px，
       于是面板始终落在按钮正下方、右端略探出按钮一点，不贴页头右缘。
       宽度基准用 100%（= .site-header 宽度，已排除滚动条）；用 100vw 的话，
       有常显滚动条的浏览器会多算一条滚动条宽，面板会整体左移半个滚动条。
       末尾 max() 兜住「视口刚好等于外壳宽」的极窄情况，面板不会溢出屏幕。 */
    right: max(12px, calc((100% - var(--nr-shell-width, var(--nr-content-width))) / 2 + 20px - 24px));
    z-index: 5;
    width: 268px;
    padding: 14px 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    box-shadow: var(--shadow-hover);
    font-size: .88rem;
    animation: nr-panel-in .16s var(--ease) both;
}
.nr-panel[hidden] { display: none; }
@keyframes nr-panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nr-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
}
.nr-panel__row + .nr-panel__row { border-top: 1px solid var(--border); }
.nr-panel__label { color: var(--text-soft); flex: 0 0 auto; }

.nr-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    overflow: hidden;
    background: var(--bg);
}
.nr-stepper button {
    appearance: none;
    width: 30px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nr-stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.nr-stepper__val {
    min-width: 30px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.nr-seg {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
}
.nr-seg button {
    appearance: none;
    border: 0;
    border-radius: calc(var(--nr-radius) - 2px);
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: .82rem;
    padding: 5px 9px;
    cursor: pointer;
    transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nr-seg button:hover { color: var(--text); }
.nr-seg button.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nr-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.nr-panel__hint { color: var(--text-faint); font-size: .76rem; }
.nr-panel__reset {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: .8rem;
    padding: 2px 0;
    cursor: pointer;
}
.nr-panel__reset:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 阅读进度（仅文章页） */
.nr-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    pointer-events: none;
    background: transparent;
}
.nr-progress i {
    display: block;
    height: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8fd6bd));
    will-change: transform;
}

/* ---------- 文章目录（正文页按 h2/h3 自动生成） ----------
   宽屏：贴在正文左侧留白里浮动（left 由 JS 按正文实际左缘算，正文居中/带侧栏都能贴住）；
   窄屏：收成左下角一条折叠条，点开向上展开目录。
   目录只用界面字体与三个语义色，不引入新色板。 */
.nr-toc {
    position: fixed;
    z-index: 44;
    display: none;
    flex-direction: column;
    font-family: var(--nr-font);
    font-size: .82rem;
    line-height: 1.55;
    letter-spacing: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), visibility .2s var(--ease);
}
.nr-toc.is-ready { display: flex; }
.nr-toc.is-visible,
.nr-toc.is-open { opacity: 1; visibility: visible; }

/* 宽屏竖排：从页头下方起，超出视口高度的部分在面板内滚动 */
.nr-toc[data-mode="side"] {
    top: calc(var(--nr-head-h, 54px) + 26px);
    max-height: calc(100vh - var(--nr-head-h, 54px) - 56px);
}

.nr-toc__title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0 0 9px;
    /* 13px = 面板 1px 边线 + 12px 内边距，标题与目录项首字严格对齐 */
    padding-left: 13px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--text-faint);
}
.nr-toc__title em {
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    opacity: .75;
}

/* 左侧一条细竖线当轴线，当前小节用一小段绿色压在上面 */
.nr-toc__panel {
    position: relative;
    min-height: 0;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.nr-toc__panel::-webkit-scrollbar { width: 4px; }
.nr-toc__panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nr-toc__list { margin: 0; padding: 0; list-style: none; }

.nr-toc__link {
    position: relative;
    /* 长标题最多两行，超出省略，避免一条标题把目录撑满一屏 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 3px 0;
    color: var(--text-soft);
    transition: color .16s var(--ease);
}
.nr-toc__link::before {
    content: "";
    position: absolute;
    /* 压在 1px 轴线上：轴线在面板 border-box 左缘，正文项左缘再内缩 12px */
    left: -13px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: 1px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: 50% 0;
    transition: transform .2s var(--ease);
}
.nr-toc__link:hover { color: var(--text); }
/* 三级标题：缩一格、小一号，层级靠位置而不是字重 */
.nr-toc__li--3 .nr-toc__link {
    padding-left: 12px;
    font-size: .78rem;
    opacity: .92;
}
.nr-toc__li.is-active > .nr-toc__link {
    color: var(--accent);
    font-weight: 600;
}
.nr-toc__li.is-active > .nr-toc__link::before { transform: scaleY(1); }

/* 折叠条（仅窄屏）：左下角一颗药丸，右侧给返回顶部让位 */
.nr-toc__bar { display: none; }
.nr-toc[data-mode="bar"] {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    right: auto;
    width: auto;
    max-width: calc(100vw - 78px);
}
/* 只在 JS 组装完成后露出来（.is-ready 由 nr.js 添加），避免无 JS 时留一块空白 */
.nr-toc[data-mode="bar"].is-ready { display: block; }
.nr-toc[data-mode="bar"] .nr-toc__title { display: none; }
.nr-toc[data-mode="bar"] .nr-toc__bar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    color: var(--text-soft);
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
    transition: color .18s var(--ease), border-color .18s var(--ease);
}
.nr-toc[data-mode="bar"] .nr-toc__bar:hover,
.nr-toc.is-open .nr-toc__bar {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.nr-toc__ico,
.nr-toc__chev { display: none; flex: 0 0 auto; width: 14px; height: 14px; }
.nr-toc__ico path,
.nr-toc__chev path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}
.nr-toc[data-mode="bar"] .nr-toc__ico,
.nr-toc[data-mode="bar"] .nr-toc__chev { display: block; }
.nr-toc__chev { transition: transform .2s var(--ease); }
.nr-toc.is-open .nr-toc__chev { transform: rotate(180deg); }
.nr-toc__bar-label { flex: 0 0 auto; font-weight: 600; color: var(--text); }
.nr-toc.is-open .nr-toc__bar-label { color: var(--accent); }
.nr-toc__bar-current {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nr-toc[data-mode="bar"] .nr-toc__bar-current { display: block; }

/* 折叠条展开后的目录面板：贴在药丸上方，自身滚动 */
.nr-toc[data-mode="bar"] .nr-toc__panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    display: none;
    width: min(76vw, 300px);
    max-height: min(56vh, 400px);
    padding: 8px 12px 10px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}
.nr-toc[data-mode="bar"].is-open .nr-toc__panel { display: block; }

/* 返回顶部 */
.nr-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 45;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.nr-top[hidden] { display: none !important; }
.nr-js .nr-top.is-visible { display: inline-flex; }
.nr-top:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    transform: translateY(-2px);
}
.nr-top svg { display: block; }

/* ---------- 主体 ---------- */
.site-main {
    /* body 是竖向 flex 容器，横轴上的 auto 外边距会让元素收缩成 fit-content；
       显式给 100% 才能撑满（窄 / 全宽都靠 max-width 收口，auto 负责居中） */
    width: 100%;
    max-width: var(--nr-content-width);
    margin: 0 auto;
    padding: 10px;
    min-height: 60vh;
}
/* body 是弹性列，正文容器吃掉剩余高度，页脚自然贴底 */
.nr-shell,
.site-main { flex: 1 0 auto; }


/* ---------- 文章卡片列表 ---------- */
.post-list { display: grid; gap: var(--nr-gap-card); }

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    padding: 18px 24px;
    box-shadow: var(--shadow);
    transition: transform .32s var(--ease), box-shadow .32s var(--ease), border-color .32s var(--ease);
}
html[data-theme="dark"] .post-card,
html[data-theme="auto"] .post-card { box-shadow: var(--shadow); }

.post-card__title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 700;
    letter-spacing: .005em;
    text-wrap: balance;
    /* 长英文/插件名没有空格时也要在卡片内折行，别被裁掉 */
    overflow-wrap: anywhere;
}
.post-card__title a { color: var(--text); }
.post-card__title a:hover { color: var(--accent); }

.post-card__meta {
    font-size: .82rem;
    color: var(--text-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.post-card__meta .dot { color: var(--border); }

.post-card__excerpt {
    font-family: var(--nr-read);
    letter-spacing: var(--nr-read-ls, 0);
    color: var(--text-soft);
    font-size: .88rem;
    line-height: 1.9;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__more {
    font-size: .85rem;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.post-card__more span { transition: transform .25s var(--ease); }
.post-card__more:hover span { transform: translateX(4px); }

/* 悬停动画：可后台关闭（body.nr-anim-on 由 header.php 输出） */
body.nr-anim-on .post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
body.nr-anim-on .post-card__more:hover span { transform: translateX(4px); }

/* 入场动画（渐进浮现，不晃眼） */
body.nr-anim-on .post-card {
    animation: nr-rise .5s var(--ease) both;
}
body.nr-anim-on .post-card:nth-child(1) { animation-delay: .02s; }
body.nr-anim-on .post-card:nth-child(2) { animation-delay: .06s; }
body.nr-anim-on .post-card:nth-child(3) { animation-delay: .10s; }
body.nr-anim-on .post-card:nth-child(4) { animation-delay: .14s; }
body.nr-anim-on .post-card:nth-child(5) { animation-delay: .18s; }
body.nr-anim-on .post-card:nth-child(n+6) { animation-delay: .22s; }

@keyframes nr-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- 文章正文 ---------- */
.post { margin: 0; }
.post__header { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.post__title {
    /* 竖线用绝对定位放到卡片内边距里，标题文字与日期、正文左缘对齐；
       若用 border-left + padding 会把标题整体右推 16px，看着左边比右边空 */
    position: relative;
    margin: 0 0 14px;
    /* 24px = 1.5rem，比正文内 h1/h2（22px）高一档，700 字重压住页面 */
    font-size: 1.5rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: .005em;
    text-wrap: balance;
    /* 长英文/插件名没有空格时也要在卡片内折行，别被裁掉 */
    overflow-wrap: anywhere;
}
/* 4px 主题色竖条，挂在标题左侧的内边距里（34px - 16px = 距卡片边缘 18px） */
.post__title::before {
    content: "";
    position: absolute;
    left: -16px;
    top: .18em;
    bottom: .18em;
    width: 4px;
    border-radius: 2px;
    background: var(--accent);
}
.post__meta {
    font-size: .85rem;
    color: var(--text-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.post__meta .dot { color: var(--border); }

/* 正文按党政机关公文格式（GB/T 9704）排：仿宋、首行缩进 2 字、
   段间不留空行（靠缩进分段）、两端对齐。字号取 16px（小四/五号之间），
   系统有仿宋就直接用，没有（如 macOS）就落到自托管的「NR FangSong」。 */
.post__content {
    /* 字体取自全站方案（--nr-read），不在这里另立一套 */
    font-family: var(--nr-read);
    /* 16px：一行约 42 字 */
    font-size: 1em;
    line-height: var(--nr-line-height);
    color: var(--text);
    text-align: justify;
    text-justify: inter-ideograph;
    line-break: strict;
    letter-spacing: var(--nr-read-ls, 0);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.post__content > *:first-child { margin-top: 0; }
.post__content > *:last-child { margin-bottom: 0; }

/* 段落：不设下边距，段与段只靠首行缩进 2 字分开，这是公文正文的基本形态 */
.post__content p { margin: 0; text-indent: 2em; }

/* 标题：字号自 .post__title（24px）起逐级递减，H6 落到正文字号；
   字形仍按公文习惯分层：H1/H2 黑体（--nr-head）、H3 楷体（--nr-kai）、H4–H6 正文字体。
   逐级尺寸只在下面按级别覆盖，rem 基准跟着后台「正文字号」走，换字号时整条阶梯等比缩放。 */
.post__content h1, .post__content h2, .post__content h3,
.post__content h4, .post__content h5, .post__content h6 {
    font-size: 1rem;
    line-height: 1.45;
    margin: .55em 0 0;
    /* 标题不缩进，与正文左缘对齐（折行时第二行也不会退回左缘，因为压根没有缩进） */
    padding-left: 0;
    text-indent: 0;
    font-weight: 700;
    /* 锚点跳转（目录、分享链接）要让开吸顶页头；页头高度由 nr.js 写入 --nr-head-h */
    scroll-margin-top: calc(var(--nr-head-h, 54px) + 24px);
    text-wrap: pretty;
}
/* 逐级字号：24 → 22 → 20 → 18 → 17 → 16 */
.post__content h1 { font-size: 1.5rem; }
.post__content h2 { font-size: 1.375rem; }
.post__content h3 { font-size: 1.25rem; }
.post__content h4 { font-size: 1.125rem; }
.post__content h5 { font-size: 1.0625rem; }
.post__content h6 { font-size: 1rem; }

.post__content h1, .post__content h2 {
    font-family: var(--nr-head);
    margin-top: 0;
}
.post__content h3 { font-family: var(--nr-kai); margin-top: .8em; }
.post__content h4, .post__content h5, .post__content h6 { font-family: var(--nr-read); }

/* 正文标题的 Markdown 式 # 前缀：颜色随级别变化（H1 主题绿、H2 红、H3 橙、H4 蓝、H5 紫、H6 灰）
   # 贴在正文左缘、当作公文的层次序号用（形如「# 文件职责」），标题文字紧跟在 # 之后，
   不再用负外边距把它吊到缩进区左边 —— 那样 # 会孤零零悬在标题前，看着错位。 */
.post__content :is(h1, h2, h3, h4, h5, h6)::before {
    content: '#';
    /* 占位固定 1em：不同字体里 # 的字宽不一样（仿宋窄、黑体宽），
       用固定占位顶住，换字体方案时标题首字不会左右跳 */
    display: inline-block;
    width: 1em;
    font-weight: 700;
    color: var(--nr-h1-mark);
    /* 装饰符号不参与选中与复制 */
    -webkit-user-select: none;
    user-select: none;
}
.post__content h2::before { color: var(--nr-h2-mark); }
.post__content h3::before { color: var(--nr-h3-mark); }
.post__content h4::before { color: var(--nr-h4-mark); }
.post__content h5::before { color: var(--nr-h5-mark); }
.post__content h6::before { color: var(--nr-h6-mark); }
/* 引用：公文引述用楷体、左右缩进各 2 字，不加底色；
   只留一条最轻的左边线，因为并非每台机器都装了楷体（macOS 常缺），没有这条线引文会认不出来 */
.post__content blockquote {
    margin: .55em 0;
    padding: 0 2em;
    border-left: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
    font-family: var(--nr-kai);
    color: var(--text-soft);
}
.post__content blockquote p { margin: 0; text-indent: 0; }
.post__content blockquote blockquote { padding: 0 1.5em; }

/* 列表：公文正文以段落为主，列表尽量贴着正文排，不额外拉开间距 */
.post__content ul, .post__content ol { margin: .3em 0; padding-left: 2em; }
.post__content li { margin: 0; text-indent: 0; }
.post__content li::marker { color: var(--text-soft); }
.post__content li > ul, .post__content li > ol { margin: .1em 0; }
.post__content li > p { margin: 0; text-indent: 0; }
.post__content li > p + p { text-indent: 2em; }

/* 图片：自适应宽度，说明文字居中小一号 */
.post__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--nr-radius);
    display: block;
    margin: .9em auto;
}
.post__content figure { margin: .9em 0; text-indent: 0; }
.post__content figure img { margin: 0 auto; }
.post__content figcaption {
    margin-top: .5em;
    text-align: center;
    font-size: .86em;
    line-height: 1.6;
    color: var(--text-faint);
    text-indent: 0;
}

/* 代码：公文里属于「附件/示例」性质，缩回正文左缘，不参与首行缩进 */
.post__content pre {
    margin: .6em 0;
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 12px 15px;
    border-radius: var(--nr-radius);
    overflow-x: auto;
    line-height: 1.6;
    font-size: .86em;
    tab-size: 4;
    text-indent: 0;
    -webkit-overflow-scrolling: touch;
}
.post__content code {
    font-family: var(--nr-mono);
    background: var(--code-bg);
    padding: .1em .34em;
    border-radius: 3px;
    font-size: .9em;
    text-indent: 0;
    word-break: break-word;
}
.post__content pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
    word-break: normal;
}

/* 表格：表头走黑体，正文走仿宋，单元格两边对齐；宽度不够时横滑 */
.post__content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: .6em 0;
    font-size: .88em;
    line-height: 1.6;
    text-indent: 0;
}
.post__content th, .post__content td {
    border: 1px solid var(--border);
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
    text-indent: 0;
}
.post__content thead th {
    background: var(--bg);
    font-family: var(--nr-head);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.post__content tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 55%, transparent); }

.post__content hr { border: 0; border-top: 1px solid var(--border); margin: 1.6em 0; }

.post__content a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.post__content a:hover { text-decoration-color: currentColor; }

/* 强调与行内装饰 */
.post__content strong, .post__content b { font-weight: 700; color: var(--text); }
.post__content mark {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: inherit;
    padding: 0 .15em;
    border-radius: 2px;
}
.post__content kbd {
    font-family: var(--nr-mono);
    font-size: .82em;
    padding: .1em .4em;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 3px;
    background: var(--bg-card);
}

/* 正文里的下载类链接（如插件压缩包）做成轻按钮，不和正文链接混在一起 */
.post__content a[download] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: .4em 0;
    padding: 7px 14px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: var(--nr-radius);
    font-size: .92em;
    text-decoration: none;
}
.post__content a[download]:hover {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.post__footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
/* 标签：四色胶囊，按标签顺序循环取色（橙红 → 绿 → 蓝 → 黄），
   底色是该色的淡染，描边深一档，悬停时实色反白，与正文的绿 accent 区分开 */
.post__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-size: .875rem;
    color: var(--text-faint);
}
.post__tags a {
    --nr-tag: #f25022;
    --nr-tag-ink: color-mix(in srgb, var(--nr-tag) 62%, #12161a);
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    font-size: .875rem;
    line-height: 1.75;
    color: var(--nr-tag-ink);
    background: color-mix(in srgb, var(--nr-tag) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--nr-tag) 34%, transparent);
    transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}
.post__tags a:nth-of-type(4n+2) { --nr-tag: #7fba00; }
.post__tags a:nth-of-type(4n+3) { --nr-tag: #00a4ef; }
.post__tags a:nth-of-type(4n+4) { --nr-tag: #ffb900; }
.post__tags a:hover {
    background: var(--nr-tag);
    border-color: var(--nr-tag);
    color: #fff;
}
/* 黄色底上白字看不清，悬停改用深墨 */
.post__tags a:nth-of-type(4n+4):hover { color: #2b1f00; }
/* 深色主题下墨色要提亮，纯色本身在暗底上已经够清楚 */
html[data-theme="dark"] .post__tags a { --nr-tag-ink: color-mix(in srgb, var(--nr-tag) 88%, #fff); }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .post__tags a { --nr-tag-ink: color-mix(in srgb, var(--nr-tag) 88%, #fff); }
}

/* ---------- 文章底部互动按钮 ----------
   分享 / 点赞 / 赞赏三个胶囊居中，位置在正文之后、标签页脚之上。
   按钮自带收尾感，所以不加分隔线；下方的标签页脚仍由 .post__footer 的顶边框隔开 */
.post-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}
/* 按钮行紧跟标签页脚时，页脚不再重复留 40px 的大间距 */
.post-actions + .post__footer { margin-top: 22px; padding-top: 18px; }

.post-actions__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-soft);
    font: inherit;
    font-size: .84rem;
    line-height: 1.4;
    cursor: pointer;
    transition: color .2s var(--ease), border-color .2s var(--ease),
                background-color .2s var(--ease), transform .2s var(--ease);
}
.post-actions__btn svg { flex: none; }
.post-actions__btn:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.post-actions__btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.post-actions__btn:active { transform: scale(.97); }
.post-actions__count {
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    opacity: .8;
}
/* 已点赞：实心主题色底 + 白字，心形填充，和未点赞一眼能区分 */
.post-actions__btn--like.is-liked {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}
.post-actions__btn--like.is-liked svg { fill: currentColor; }
.post-actions__btn--like.is-busy { opacity: .7; cursor: progress; }

/* 赞赏弹窗：两张收款码并排，窄屏自动换行 */
.nr-sponsor__desc {
    margin: 0 0 14px;
    color: var(--text-soft);
    font-size: .84rem;
    line-height: 1.75;
}
.nr-sponsor__codes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 4px;
}
.nr-sponsor__code {
    margin: 0;
    display: grid;
    justify-items: center;
    gap: 6px;
}
.nr-sponsor__code img {
    /* 收款码固定白底：深色主题下也保持扫得出来，不跟页面底色走 */
    display: block;
    width: 156px;
    height: 156px;
    object-fit: contain;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.nr-sponsor__code figcaption {
    color: var(--text-faint);
    font-size: .78rem;
}

/* ---------- 上一篇 / 下一篇 ----------
   一条横带：左「上一篇」右「下一篇」，中间一根竖线分开；
   每边两行 —— 上行为方向标签，下行为标题，标题单行不折，超长省略 */
.post-near {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
}
.post-near__item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.post-near__label {
    font-size: .78rem;
    line-height: 1.4;
    color: var(--text-faint);
    letter-spacing: .02em;
}
.post-near__title {
    font-size: .95rem;
    line-height: 1.5;
    color: var(--text);
    /* 标题只占一行，过长截断，避免把横带撑高或挤到竖线上 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-near__title a { color: var(--text); }
.post-near__title a:hover { color: var(--accent); }
.post-near__item--next { text-align: right; }
.post-near__sep {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    color: var(--text-faint);
    opacity: .55;
    font-size: .95rem;
    user-select: none;
}

/* ---------- 评论 ---------- */
.comments { margin: 0; padding: 0; scroll-margin-top: 78px; }
.comments__title { font-size: 1.2rem; margin: 0 0 22px; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: var(--nr-gap-card); }
.comment {
    display: flex;
    flex-wrap: wrap;
    /* 列间距留给头像，行间距留给子回复：子回复要另起一行、通栏 */
    column-gap: 14px;
    row-gap: var(--nr-gap-card);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    padding: 18px;
}
.comment__avatar img { border-radius: 50%; display: block; }
/* 站点关闭评论头像时模板不输出这一层；万一留下空壳也不让它占位、挤出 14px 缩进 */
.comment__avatar:empty { display: none; }
.comment__body { flex: 1 1 0; min-width: 0; }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.comment__author { font-weight: 600; }
.comment__time { font-size: .8rem; color: var(--text-faint); }
.comment__content { font-family: var(--nr-read); letter-spacing: var(--nr-read-ls, 0); font-size: .94rem; color: var(--text-soft); }
/* 评论里贴代码也走等宽，不会跟着阅读字体变形 */
.comment__content code, .comment__content pre { font-family: var(--nr-mono); font-size: .92em; }
.comment__content p { margin: 0 0 .8em; }
.comment__reply { font-size: .82rem; margin-top: 6px; }
.comment__reply a { color: var(--text-faint); }
.comment__reply a:hover { color: var(--accent); }
/* 子回复：另起一行通栏，靠左侧竖线表示层级；不再套卡片，避免卡片叠卡片 */
.comment-children {
    flex: 1 0 100%;
    padding-left: 14px;
    border-left: 2px solid var(--border);
}
/* 递归出来的 <ol class="comment-list"> 自带 32px 底边距，嵌套里去掉 */
.comment-children > .comment-list { margin: 0; }
/* Typecho 点「回复」会把整个表单搬进被回复的那条评论内部（Archive.php 的 TypechoComment.reply），
   这里让它整行铺开，否则它会成为第三个 flex 项、把评论正文挤成一条窄列 */
.comment > .respond {
    flex: 1 0 100%;
    margin-top: 4px;
}
.comment.comment--child,
.site-main--post .comment.comment--child {
    background: none;
    border: 0;
    padding: 0;
}
/* 评论分页：Typecho 默认输出 <ol class="page-navigator">，仅在评论超过每页条数时出现 */
.comments .page-navigator {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
    padding: 0;
}
.comments .page-navigator li a,
.comments .page-navigator li span {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    font-size: .86rem;
}
.comments .page-navigator li a:hover { border-color: var(--accent); color: var(--accent); }
.comments .page-navigator li.current span { background: var(--accent); color: #fff; border-color: var(--accent); }

.respond { margin-top: 24px; }
/* 取消回复：默认被 Typecho 用 display:none 收起，靠链接自身占位，空 div 不产生空隙 */
.cancel-comment-reply { font-size: .85rem; }
.cancel-comment-reply a { display: inline-block; margin-bottom: 6px; color: var(--text-faint); }
.cancel-comment-reply a:hover { color: var(--accent); }
/* 表单被搬进评论卡里时（点「回复」），标题比页面级小一号，别抢主体 */
.comment > .respond .comments__title { font-size: 1.05rem; margin: 4px 0 16px; }
/* 评论卡本身是浅灰内凹块，嵌进去的输入框改回卡片白底，否则和卡底色糊成一片 */
.site-main--post .comment > .respond input,
.site-main--post .comment > .respond textarea { background: var(--bg-card); }
.respond__hint { color: var(--text-soft); font-size: .9rem; }
.respond__fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.respond p { margin: 0 0 14px; }
.respond label { display: block; font-size: .85rem; color: var(--text-soft); margin-bottom: 6px; }
.respond input, .respond textarea {
    width: 100%;
    font: inherit;
    font-size: .94rem;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    padding: 10px 12px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.respond input:focus, .respond textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.respond textarea { resize: vertical; line-height: 1.7; }
.btn-submit {
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: var(--nr-radius);
    padding: 10px 22px;
    cursor: pointer;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.btn-submit:hover { opacity: .88; }
body.nr-anim-on .btn-submit:active { transform: scale(.97); }
.comments__closed { color: var(--text-faint); font-size: .92rem; }
.comments__empty { color: var(--text-faint); font-size: .92rem; margin: -8px 0 26px; }

/* ---------- 分页 ---------- */
.pagination { margin-top: 40px; }
.pagination__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.pagination__list li a, .pagination__list li span {
    display: inline-block;
    min-width: 38px;
    text-align: center;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    font-size: .88rem;
}
.pagination__list li a:hover { border-color: var(--accent); color: var(--accent); }
.pagination__list li.current span { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 100px 20px; color: var(--text-soft); }
.empty-state--404 .empty-state__code { font-size: 4rem; font-weight: 700; color: var(--border); margin: 0 0 12px; }

/* ---------- 页脚 ---------- */
/* 通栏底色带：正文卡片之上再抬一层，视觉上给页面收个尾 */
.site-footer {
    margin: 10px 0 0;
    padding: 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    font-size: .875rem;
    color: var(--text-faint);
}
.site-footer__inner {
    max-width: var(--nr-shell-width, var(--nr-content-width));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

/* 图标徽章：默认灰，悬停染主色并浮出提示 */
.site-footer__icons { display: flex; align-items: center; gap: 4px; }
.site-footer__sep { width: 1px; height: 12px; margin: 0 8px; background: var(--border); }
.nr-fbadge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--nr-radius);
    color: var(--text-faint);
    transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nr-fbadge svg { display: block; }
.nr-fbadge:hover,
.nr-fbadge:focus-visible { color: var(--accent); background: var(--accent-soft); }
.nr-fbadge--static { cursor: default; }
.nr-fbadge::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    z-index: 20;
    padding: 3px 8px;
    border-radius: var(--nr-radius);
    background: var(--text);
    color: var(--bg-card);
    font-size: .72rem;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 3px);
    transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s var(--ease);
}
.nr-fbadge::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    z-index: 20;
    border: 4px solid transparent;
    border-top-color: var(--text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 3px);
    transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s var(--ease);
}
.nr-fbadge:hover::after,
.nr-fbadge:focus-visible::after,
.nr-fbadge:hover::before,
.nr-fbadge:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.site-footer__copy { margin: 0; }
.site-footer__copy .dot { color: var(--border); margin: 0 4px 0 6px; }
/* 备案信息：比自定义说明再淡一档，排在最后一行 */
.site-footer__filing {
    margin: 0;
    font-size: .875rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.site-footer__filing .dot { color: var(--border); margin: 0 6px; }

/* Logo 浅/深双版：默认出浅色版，深色配色（含 auto 跟随系统）切到深色版 */
/* 选择器带上 .site-brand--logo，否则压不过 .site-brand--logo img 的 display:block */
.site-brand--logo .nr-logo--dark { display: none; }
html[data-theme="dark"] .site-brand--logo .nr-logo--light { display: none; }
html[data-theme="dark"] .site-brand--logo .nr-logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .site-brand--logo .nr-logo--light { display: none; }
    html[data-theme="auto"] .site-brand--logo .nr-logo--dark { display: block; }
}
.site-footer a { color: var(--text-faint); }
.site-footer a:hover { color: var(--accent); }

/* ---------- 顶部通栏推荐阅读（广告位） ----------
   挂在 .nr-shell 的第一个子元素上，横跨正文与侧栏两列整宽；
   4 张卡片用后台设定的四种品牌色，第 4 张琥珀底改用深色文字保证对比度。 */
.nr-adbar {
    /* 有侧栏时外壳是 grid，独占一整行；无侧栏时是普通块，这行声明不产生影响 */
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    /* 上下各 10px，和正文卡之间的 10px 竖距同一节拍 */
    margin: 10px 0;
}
/* 面包屑在上、推荐条在下时，上边距只算一次 */
.nr-crumb + .nr-adbar { margin-top: 0; }
/* 面包屑/推荐条自己已经让出 10px，下面的正文与侧栏都不再重复留白 */
.nr-shell > .nr-crumb ~ .site-main { padding-top: 0; }
.nr-shell > .nr-crumb ~ .site-main--post { margin-top: 0; }
.nr-shell > .nr-crumb ~ .nr-side { margin-top: 0; }
/* 推荐条 / 分类导航自己已经让出 10px，左右两列都不再重复留白，否则中间会变 20px。
   用 ~ 而不是 +：推荐条和正文之间还夹着 .nr-subnav；
   必须带上 .nr-shell > 前缀，否则压不过后面「.nr-shell > .site-main--post」的 margin */
.nr-shell > .nr-adbar ~ .site-main { padding-top: 0; }
.nr-shell > .nr-adbar ~ .site-main--post { margin-top: 0; }
.nr-shell > .nr-adbar ~ .nr-side { margin-top: 0; }

/* ---------- 推荐条下方的面包屑 ---------- */
.nr-crumb {
    grid-column: 1 / -1;
    /* 上下各 10px；紧跟着的推荐条会把自己的上外边距归零，两者之间仍是 10px */
    margin: 10px 0;
    min-width: 0;
    /* 一条窄卡片：底色 + 细边框，与正文卡、侧栏卡同一套描边规则 */
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    font-size: .875rem;
    color: var(--text-faint);
}
.nr-crumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
}
.nr-crumb__item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
/* 分隔符用 CSS 生成，复制出来的文字里不会夹一堆 > */
.nr-crumb__item + .nr-crumb__item::before {
    content: "›";
    color: var(--border);
}
.nr-crumb__item a { color: var(--text-soft); }
.nr-crumb__item a:hover { color: var(--accent); }
.nr-crumb__item.is-current {
    color: var(--text);
    min-width: 0;
}
/* 文章标题可能很长：单行省略，别把整条面包屑挤成两行 */
.nr-crumb__item.is-current > span {
    display: block;
    max-width: 46ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nr-adbar__card {
    /* 每张卡各自一套色：底色 + 略深的收尾色 + 与之匹配的投影光晕 */
    --ad-bg: #f25022;
    --ad-bg2: #d84218;
    --ad-ink: #fff;
    --ad-glow: rgba(242, 80, 34, .3);
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 6px;
    /* 右上角一层白色柔光叠在纯色上：保留品牌色，又有一点纸面起伏，不像一块死色块 */
    background-image:
        radial-gradient(130% 120% at 100% 0%, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0) 58%),
        linear-gradient(140deg, var(--ad-bg), var(--ad-bg2));
    color: var(--ad-ink);
    /* 投影用卡片自己的颜色，比灰影更像"发光"，深色主题下也不脏 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 22px -14px var(--ad-glow);
    overflow: hidden;
    /* 给内部翻转留透视，角度小一点，别翻出"纸片飞起"的夸张感 */
    perspective: 760px;
    transition: box-shadow .3s var(--ease), filter .3s var(--ease);
}
.nr-adbar__card--1 { --ad-bg: #f25022; --ad-bg2: #d84218; --ad-glow: rgba(242, 80, 34, .32); }
.nr-adbar__card--2 { --ad-bg: #7fba00; --ad-bg2: #699a00; --ad-glow: rgba(127, 186, 0, .3); }
.nr-adbar__card--3 { --ad-bg: #00a4ef; --ad-bg2: #0089c8; --ad-glow: rgba(0, 164, 239, .3); }
.nr-adbar__card--4 { --ad-bg: #f0a800; --ad-bg2: #cf8b00; --ad-glow: rgba(255, 185, 0, .32); }

/* 悬停不再上移，只在原地翻面：投影略加强，像被"点亮"了一下 */
a.nr-adbar__card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 14px 26px -12px var(--ad-glow);
    filter: saturate(1.06) brightness(1.02);
}

/* 双面结构：正反两面叠在同一格里，靠 rotateX 各自翻转完成"换面"。
   不用 backface-visibility + preserve-3d，那一套在 overflow:hidden 的父级里会叠影，
   改成两面分别翻 90°/-90° 再交叉淡入，视觉同样是翻，但没有兼容坑。 */
.nr-adbar__flip {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    perspective: 720px;
}
.nr-adbar__face {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 文字居中；左右留同样的 16px，右侧箭头压在留白里，不会顶到标题 */
    padding: 0 16px;
    min-width: 0;
    text-align: center;
    transform-origin: center center;
    transition: transform .4s var(--ease), opacity .28s var(--ease);
}
.nr-adbar__face--back {
    transform: rotateX(-90deg);
    opacity: 0;
    pointer-events: none;
}
/* 只有带描述的卡片才翻；纯展示块保持静止 */
a.nr-adbar__card--flip:hover .nr-adbar__face--front,
a.nr-adbar__card--flip:focus-visible .nr-adbar__face--front { transform: rotateX(90deg); opacity: 0; }
a.nr-adbar__card--flip:hover .nr-adbar__face--back,
a.nr-adbar__card--flip:focus-visible .nr-adbar__face--back { transform: rotateX(0); opacity: 1; }
a.nr-adbar__card:focus-visible {
    outline: 2px solid var(--ad-ink);
    outline-offset: -3px;
}
/* 右侧小箭头：只在可点击卡片上出现，悬停时向右滑一点，暗示"可以进" */
a.nr-adbar__card::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -4px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-3px, 3px);
    opacity: 0;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}
a.nr-adbar__card:hover::after,
a.nr-adbar__card:focus-visible::after { opacity: .85; transform: rotate(45deg) translate(0, 0); }

.nr-adbar__title,
.nr-adbar__desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-adbar__title {
    max-width: 100%;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.4;
    /* 居中后长标题两侧同时收，省略号落在中间偏右，视觉上比左对齐截断更平衡 */
    text-align: center;
}
/* 背面：整宽两行描述，超过两行截断，保证卡片高度不跳 */
.nr-adbar__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-width: 100%;
    font-size: .8125rem;
    line-height: 1.4;
    /* 描述同样用白色，不靠透明度压灰，避免在彩色底上发脏 */
    color: #fff;
    white-space: normal;
    text-align: center;
}

/* 窄屏：先两列，再一列；卡片内文字始终保持单行省略，不会把卡片撑破 */
@media (max-width: 1080px) {
    .nr-adbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .nr-adbar { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 整页外壳与侧栏 ---------- */
.nr-shell {
    /* 同 .site-main：body 是 flex 容器，auto 外边距会收缩宽度，这里补足 100% */
    width: 100%;
    max-width: var(--nr-shell-width, var(--nr-content-width));
    margin: 0 auto;
    padding: 0 20px;
}
.nr-shell--side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--nr-side-w, 280px);
    /* 与 header.php 里 --nr-shell-width 的 10px 必须同步 */
    column-gap: 10px;
    /* 行距交给各块自己的 margin：推荐条那行再加 10px 行距会让下方变 20px，与上方 10px 不对称 */
    row-gap: 0;
    align-items: start;
}
.nr-shell--left { grid-template-columns: var(--nr-side-w, 280px) minmax(0, 1fr); }
.nr-shell--left > .site-main { order: 2; }
.nr-shell--left > .nr-side { order: 1; }

/* 外壳内接管正文宽度，左右留白交给外壳 */
.nr-shell > .site-main {
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

/* ---------- 友链页 ---------- */
.site-main--links {
    margin: 10px auto 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    background: none;
    border: 0;
    box-shadow: none;
}
.nr-shell > .site-main--links { max-width: none; margin: 10px 0 0; padding: 0; }

.nr-links-hero,
.nr-links-pending,
.nr-links-wall,
.nr-link-apply {
    padding: 26px 30px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    box-shadow: var(--shadow);
}
.nr-links-hero { padding: 24px 30px; }
.nr-links-title { margin: 0; font-size: 1.35rem; line-height: 1.5; }
.nr-links-sub { margin: 6px 0 0; color: var(--text-soft); font-size: .88rem; }
.nr-links-intro { margin-top: 10px; color: var(--text-soft); font-size: .9rem; }
.nr-links-intro > :first-child { margin-top: 0; }
.nr-links-intro > :last-child { margin-bottom: 0; }

.nr-links-random {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    padding: 6px 14px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font: inherit;
    font-size: .84rem;
    cursor: pointer;
    transition: background-color .16s var(--ease), color .16s var(--ease), transform .2s var(--ease);
}
.nr-links-random:hover { background: var(--accent); color: #fff; }
.nr-links-random.is-launching { transform: scale(1.04); }

.nr-links-notice {
    margin: 0;
    padding: 11px 16px;
    border: 1px solid color-mix(in srgb, #c0392b 30%, transparent);
    border-radius: var(--nr-radius);
    background: color-mix(in srgb, #c0392b 8%, transparent);
    color: #c0392b;
    font-size: .86rem;
}
.nr-links-notice.is-ok {
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent);
}

.nr-links-section__title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
}
.nr-links-section__title span {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: color-mix(in srgb, #c0392b 12%, transparent);
    color: #c0392b;
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
}

/* 友链卡片墙 */
.nr-link-card-wrap { position: relative; min-width: 0; }
.nr-link-card__del {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-faint);
    font-size: .8125rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.nr-link-card-wrap:hover .nr-link-card__del,
.nr-link-card__del:focus-visible { opacity: 1; }
.nr-link-card__del:hover { color: #c0392b; border-color: color-mix(in srgb, #c0392b 45%, transparent); }

.nr-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
    gap: 10px;
}
.nr-link-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: inherit;
    text-decoration: none;
    transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.nr-link-card:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    box-shadow: 0 3px 12px rgba(18, 24, 32, .06);
    transform: translateY(-1px);
}
.nr-link-card__badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-size: .95rem;
    font-weight: 600;
}
.nr-link-card__main { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1 1 auto; }
.nr-link-card__name {
    font-size: .9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 简介不再单独占一行，改挂在卡片 title / aria-label 上（见 links.php） */
.nr-link-card__hits {
    flex: 0 0 auto;
    color: var(--text-faint);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
}
.nr-links-empty { margin: 0; padding: 26px 0; text-align: center; color: var(--text-faint); font-size: .88rem; }

/* 待审列表 */
.nr-links-pending { border-color: color-mix(in srgb, #c0392b 22%, var(--border)); }
.nr-links-pending__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.nr-links-pending__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
}
.nr-links-pending__info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 2px; }
.nr-links-pending__info a { font-size: .88rem; color: var(--text); text-decoration: none; }
.nr-links-pending__info a:hover { color: var(--accent); }
.nr-links-pending__info code { color: var(--text-faint); font-size: .74rem; word-break: break-all; }
.nr-links-pending__info span { color: var(--text-soft); font-size: .76rem; }
.nr-links-pending__ops { display: flex; gap: 6px; flex: 0 0 auto; }

/* 按钮 */
.nr-links-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .16s var(--ease), color .16s var(--ease), background-color .16s var(--ease);
}
.nr-links-btn:hover { border-color: var(--accent); color: var(--accent); }
.nr-links-btn--primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.nr-links-btn--primary:hover { background: var(--accent); color: #fff; opacity: .9; }
.nr-links-btn--primary:disabled { opacity: .45; cursor: not-allowed; }
.nr-links-btn--ok { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.nr-links-btn--bad { border-color: color-mix(in srgb, #c0392b 35%, transparent); color: #c0392b; }
.nr-links-btn--ghost { background: transparent; font-size: .76rem; padding: 3px 10px; }

/* 申请表单 */
.nr-link-apply__intro { margin: 0 0 14px; color: var(--text-soft); font-size: .86rem; }
.nr-link-form__hp { position: absolute; left: -9999px; }
.nr-link-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nr-link-form__row > p { margin: 0 0 12px; }
.nr-link-form label { display: block; margin-bottom: 5px; font-size: .8rem; color: var(--text-faint); }
.nr-link-form label em { font-style: normal; color: var(--accent); }
.nr-link-form input[type="text"],
.nr-link-form input[type="url"],
.nr-link-form input[type="email"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .88rem;
}
.nr-link-form input:focus { border-color: var(--accent); }
.nr-link-form__hint { display: block; margin-top: 4px; color: var(--text-faint); font-size: .74rem; }

.nr-link-agreement {
    margin: 4px 0 12px;
    border: 1px dashed var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
}
.nr-link-agreement summary {
    padding: 9px 12px;
    color: var(--text-soft);
    font-size: .82rem;
    cursor: pointer;
}
.nr-link-agreement__body { padding: 0 12px; border-top: 1px solid var(--border); }
.nr-link-agreement__body p { margin: 8px 0; color: var(--text-soft); font-size: .8rem; line-height: 1.7; }
.nr-link-agreement__check {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    padding: 9px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: .82rem;
    cursor: pointer;
}
.nr-link-form__actions { display: flex; align-items: center; gap: 10px; margin: 0; }

/* 同意书弹窗：提交按钮触发，勾选后才真正 POST */
/* 弹窗打开时锁滚动：用 padding 补掉滚动条宽度（--nr-sbw 由 assets/nr-scroll-lock.js 计算），避免页面横向跳动 */
html.nr-modal-open { overflow: hidden; padding-right: var(--nr-sbw, 0px); }
/* 原生 <dialog>：浏览器顶层渲染，不会被页面层叠上下文吃掉 */
.nr-modal {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 20px;
    border: 0;
    background: transparent;
    overflow: hidden;
    color: inherit;
}
.nr-modal:not([open]) { display: none; }
.nr-modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}
.nr-modal::backdrop {
    background: rgba(12, 16, 20, .52);
    backdrop-filter: blur(2px);
}
.nr-modal__card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(34rem, 100%);
    max-height: min(76vh, 40rem);
    padding: 22px 24px 18px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    background: var(--bg-card);
    box-shadow: 0 18px 48px rgba(12, 16, 20, .28);
    animation: nr-modal-in .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes nr-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .nr-modal__card { animation: none; }
}
.nr-modal__title { margin: 0 0 10px; font-size: 1.02rem; }
.nr-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 10px;
}
.nr-modal__body p {
    margin: 0 0 8px;
    color: var(--text-soft);
    font-size: .84rem;
    line-height: 1.8;
}
.nr-modal__check {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: var(--text-soft);
    font-size: .84rem;
    cursor: pointer;
}
.nr-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.nr-link-mine {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.nr-link-mine__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: .86rem;
    font-weight: 600;
}
.nr-link-mine ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.nr-link-mine li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-soft);
}
.nr-link-mine code {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-faint);
    font-size: .76rem;
    word-break: break-all;
}
.nr-link-mine__desc { color: var(--text-faint); font-size: .76rem; }

/* ---------- 说说页 ---------- */
.site-main--shuo {
    margin: 10px auto 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    background: none;
    border: 0;
    box-shadow: none;
}
.nr-shell > .site-main--shuo { max-width: none; margin: 10px 0 0; padding: 0; }

.nr-shuo-intro,
.nr-shuo-form,
.nr-shuo-card {
    padding: 26px 30px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    box-shadow: var(--shadow);
}
.nr-shuo-intro { padding: 22px 30px; }
.nr-shuo-title { margin: 0; font-size: 1.35rem; line-height: 1.5; }
.nr-shuo-desc { margin-top: 8px; color: var(--text-soft); font-size: .9rem; }
.nr-shuo-desc > :first-child { margin-top: 0; }
.nr-shuo-desc > :last-child { margin-bottom: 0; }

/* 屏幕阅读器专用文本 */
.nr-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 发布表单 */
.nr-shuo-form textarea,
.nr-shuo-form input[type="text"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    line-height: 1.7;
    transition: border-color .18s var(--ease);
}
.nr-shuo-form textarea { resize: vertical; min-height: 84px; }
.nr-shuo-form textarea:focus,
.nr-shuo-form input[type="text"]:focus { border-color: var(--accent); }

.nr-shuo-form__mood { margin-top: 14px; }
.nr-shuo-form__label { display: block; margin-bottom: 8px; font-size: .82rem; color: var(--text-faint); }
.nr-shuo-form__label em { font-style: normal; margin-left: 2px; color: var(--accent); }
.nr-shuo-moods { display: flex; flex-wrap: wrap; gap: 6px; }
.nr-mood-pick input { position: absolute; opacity: 0; pointer-events: none; }
.nr-mood-pick__box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    font-size: .82rem;
    color: var(--text-soft);
    cursor: pointer;
    transition: border-color .16s var(--ease), background-color .16s var(--ease), color .16s var(--ease);
}
.nr-mood-pick:hover .nr-mood-pick__box { border-color: var(--border-strong, var(--text-faint)); }
.nr-mood-pick input:checked + .nr-mood-pick__box {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}
.nr-mood-pick input:focus-visible + .nr-mood-pick__box { outline: 2px solid var(--accent); outline-offset: 2px; }

.nr-shuo-form__media { margin-top: 14px; }
.nr-shuo-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--nr-radius);
    color: var(--text-soft);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .16s var(--ease), color .16s var(--ease);
}
.nr-shuo-upload:hover { border-color: var(--accent); color: var(--accent); }
.nr-shuo-form__hint { display: block; margin-top: 6px; font-size: .76rem; color: var(--text-faint); }
.nr-shuo-form__hint--error { color: #c0392b; }
.nr-shuo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nr-shuo-previews[hidden] { display: none; }
.nr-shuo-preview {
    position: relative;
    width: 76px;
    height: 76px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}
.nr-shuo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nr-shuo-preview__del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(18, 24, 32, .66);
    color: #fff;
    font-size: .875rem;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}
.nr-shuo-preview__del:hover { background: rgba(18, 24, 32, .88); }

.nr-shuo-form__foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.nr-shuo-form__pwd { flex: 1 1 12rem; min-width: 0; }
.nr-shuo-btn {
    padding: 8px 20px;
    border: 1px solid var(--accent);
    border-radius: var(--nr-radius);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: .88rem;
    cursor: pointer;
    transition: opacity .16s var(--ease);
}
.nr-shuo-btn:hover { opacity: .88; }
.nr-shuo-btn--ghost { background: transparent; color: var(--accent); }
.nr-shuo-msg { margin: 10px 0 0; font-size: .84rem; color: var(--text-faint); }
.nr-shuo-msg[hidden],
.nr-shuo-lock__msg[hidden],
.nr-shuo-pwd__msg[hidden] { display: none; }
.nr-shuo-msg.is-ok,
.nr-shuo-lock__msg.is-ok,
.nr-shuo-pwd__msg.is-ok { color: var(--accent); }
.nr-shuo-msg.is-error,
.nr-shuo-lock__msg,
.nr-shuo-pwd__msg { color: #c0392b; }

/* 卡片列表 */
.nr-shuo-list { display: grid; gap: 18px; }
.nr-shuo-empty { margin: 0; padding: 34px 0; text-align: center; color: var(--text-faint); }

.nr-shuo-card { padding: 20px 24px 16px; }
.nr-shuo-card__top { display: flex; align-items: center; gap: 10px; }
.nr-shuo-mood {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-size: .78rem;
    line-height: 1.8;
    white-space: nowrap;
}
.nr-shuo-time { color: var(--text-faint); font-size: .76rem; font-variant-numeric: tabular-nums; }
.nr-shuo-lock-flag { font-size: .78rem; opacity: .75; }
.nr-shuo-admin { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.nr-shuo-key,
.nr-shuo-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: background-color .16s var(--ease), color .16s var(--ease);
}
.nr-shuo-del { font-size: 1.15rem; line-height: 1; }
.nr-shuo-key:hover,
.nr-shuo-key[aria-expanded="true"] { background: var(--bg); color: var(--accent); }
.nr-shuo-del:hover { background: var(--bg); color: #c0392b; }

.nr-shuo-card__body {
    margin-top: 10px;
    color: var(--text);
    font-size: .95rem;
    line-height: 1.85;
    word-break: break-word;
}
.nr-shuo-card__foot { display: flex; margin-top: 12px; }
.nr-shuo-like {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-faint);
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
    transition: border-color .16s var(--ease), color .16s var(--ease), background-color .16s var(--ease);
}
.nr-shuo-like:hover { border-color: var(--accent); color: var(--accent); }
.nr-shuo-like.is-liked {
    border-color: color-mix(in srgb, #e0574f 45%, transparent);
    background: color-mix(in srgb, #e0574f 10%, transparent);
    color: #e0574f;
}
.nr-shuo-like.is-liked svg path { fill: currentColor; }
.nr-shuo-like__count { font-variant-numeric: tabular-nums; }

/* 附图：1 张按原比例，2/4 张方图两列，3 张首图通栏 */
.nr-shuo-media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
}
.nr-shuo-media__item {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}
.nr-shuo-media__item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
.nr-shuo-media__item:hover img { transform: scale(1.03); }
.nr-shuo-media[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.nr-shuo-media[data-count="1"] .nr-shuo-media__item img {
    aspect-ratio: auto;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}
.nr-shuo-media[data-count="3"] .nr-shuo-media__item:first-child { grid-column: 1 / -1; }
.nr-shuo-media[data-count="3"] .nr-shuo-media__item:first-child img { aspect-ratio: 2 / 1; }

/* 加密块 */
.nr-shuo-lock {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
}
.nr-shuo-lock__tip { margin: 0 0 8px; color: var(--text-soft); font-size: .84rem; }
.nr-shuo-lock__form,
.nr-shuo-pwd__form { display: flex; gap: 8px; }
.nr-shuo-lock__form input,
.nr-shuo-pwd__form input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: .88rem;
}
.nr-shuo-lock__form input:focus,
.nr-shuo-pwd__form input:focus { border-color: var(--accent); }
.nr-shuo-lock__msg,
.nr-shuo-pwd__msg { margin: 7px 0 0; font-size: .82rem; }
.nr-shuo-pwd { margin-top: 10px; }
.nr-shuo-pwd[hidden] { display: none; }

/* 分页 */
.nr-shuo-pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.nr-shuo-pager__btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    color: var(--text-soft);
    font-size: .84rem;
    text-decoration: none;
    transition: border-color .16s var(--ease), color .16s var(--ease);
}
.nr-shuo-pager__btn:hover { border-color: var(--accent); color: var(--accent); }
.nr-shuo-pager__btn.is-disabled { opacity: .45; pointer-events: none; }
.nr-shuo-pager__info { font-size: .8rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* 文章页 / 独立页面：主列不再是整张卡片，而是「正文 → 上下篇 → 评论」三张独立卡片。
   列表页靠 .post-card 分层，正文若直接铺在页面底色上会显得空，也和侧栏卡片不成体系 */
.site-main--post {
    /* 与 .nr-side 的 margin-top 一致，保证左右首块顶端对齐 */
    margin: 10px auto 0;
    padding: 0;
    display: grid;
    /* 隐式 auto 列按 max-content 定宽，一条不带空格的超长 URL 就能把整张卡片顶出屏幕；
       显式 minmax(0, 1fr) 让列宽锁死在容器内，长串交给 overflow-wrap 折行 */
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    background: none;
    border: 0;
    box-shadow: none;
}
.site-main--post > .post,
.site-main--post > .post-near,
.site-main--post > .comments {
    /* 上下同为 32px：原来是 30 上 / 34 下，卡片底部总比顶部空一截 */
    padding: 32px 34px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    box-shadow: var(--shadow);
}
/* 上下篇只是翻页条，内边距比正文卡小一号，免得看着像个空盒子 */
.site-main--post > .post-near { padding: 18px 22px; }

/* 独立页面没有 .nr-shell 提供左右留白：直接挂在 body 上，自己留出与外壳一致的 20px；
   用 calc 而不是左右 margin，是为了让 boxed 模式的 auto 居中仍然生效 */
body > .site-main--post {
    width: calc(100% - 40px);
    margin: 10px auto 0;
}
/* 有外壳时宽度与左右留白交回外壳（.nr-shell > .site-main 会把 margin/padding 归零） */
.nr-shell > .site-main--post {
    max-width: none;
    margin: 10px 0 0;
    padding: 0;
}
/* 卡片内部再套卡片：评论、表单控件改用页面底色，读作内凹块而不是白底叠白卡
   上下篇现在是纯文字横带，不再给底色 */
.site-main--post .comment,
.site-main--post .respond input,
.site-main--post .respond textarea { background: var(--bg); }

/* 侧栏默认跟随页面一起滚动：不做 sticky、不做内部滚动条，
   滚轮永远只滚页面，不会出现「鼠标停在侧栏上页面不动」的情况。
   侧栏比正文长时由侧栏自己把页面撑高，多出来的内容顺着页面往下放。
   开「滚动浮动」后，勾选的模块由 nr-side.js 整体搬进 fixed 浮层（原位留等高占位块），这里只给定位和层级。 */
.nr-side {
    display: grid;
    /* 显式一列，避免隐式 auto 轨道按最长模块（标签云）撑宽后溢到正文里 */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nr-gap-card);
    /* 与 .site-main--post 的 margin-top 一致，保证左右首块顶端对齐 */
    margin-top: 10px;
    padding: 0 0 10px;
    /* 吸附模块要相对整页高度定位，栅格项默认 stretch 已经把 aside 拉到整行高 */
    align-content: start;
}

/* 悬浮显示：整根侧栏滚过去之后，勾选的模块才搬进这个浮层，贴在页头下方 */
.nr-side-float {
    position: fixed;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nr-gap-card);
    pointer-events: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    animation: nr-side-float-in .42s cubic-bezier(.22, .61, .36, 1) both;
}
/* 浮层内不显示侧边滚动条（仍可滚，滚轮/触控板照常） */
.nr-side-float::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* 模块搬走后原位留下的占位块，保证页面高度不变、滚动位置不跳 */
.nr-side-hold { margin: 0; }
@keyframes nr-side-float-in {
    0%   { opacity: 0; transform: translateY(14px) scale(.995); }
    60%  { opacity: .85; }
    100% { opacity: 1; transform: none; }
}
@media (max-width: 960px) {
    .nr-side-float { display: none; }
}

.nr-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--nr-radius-card);
    padding: 15px 16px 14px;
}
.nr-widget__title {
    display: flex;
    align-items: center;
    gap: 8px;
    /* 加高标题栏：上不额外顶，靠下内边距 + 分隔线拉开层次 */
    margin: 0 0 12px;
    padding: 1px 0 10px;
    border-bottom: 1px solid var(--border);
    /* 17px = 1.0625rem，600 字重；比正文 16px 只高一档，靠四格方块和分隔线区分层级 */
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .06em;
    color: var(--text-soft);
}
/* 标题前的四格方块装饰（微软 logo 式） */
.nr-widget__title::before {
    content: "";
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background-image:
        linear-gradient(#f25022, #f25022),
        linear-gradient(#7fba00, #7fba00),
        linear-gradient(#00a4ef, #00a4ef),
        linear-gradient(#ffb900, #ffb900);
    background-size: 45% 45%;
    background-position: 0 0, 100% 0, 0 100%, 100% 100%;
    background-repeat: no-repeat;
    opacity: .88;
}
/* 暗色底上四色会偏刺眼，压一档亮度 */
html[data-theme="dark"] .nr-widget__title::before { opacity: .72; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .nr-widget__title::before { opacity: .72; }
}

.nr-widget__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.nr-widget__list li {
    display: flex;
    align-items: baseline;
    /* 序号 + 标题 + 右侧计数：标题 flex:1 自然把计数顶到右边 */
    gap: 8px;
    font-size: .875rem;
    line-height: 1.5;
    min-width: 0;
}
.nr-widget__list a {
    flex: 1 1 auto;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nr-widget__list a:hover { color: var(--accent); }
/* 热门文章序号：等宽数字，前三名用主题色加粗，其余淡灰，扫一眼就知道排序 */
.nr-widget__rank {
    flex: 0 0 auto;
    min-width: 1.1em;
    color: var(--text-faint);
    font-size: .8rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.nr-widget__list li:nth-child(-n+3) .nr-widget__rank {
    color: var(--accent);
    font-weight: 700;
}
.nr-widget__list time,
.nr-widget__count {
    flex: 0 0 auto;
    color: var(--text-faint);
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
}

/* 最新评论：作者 + 摘要 + 出处 */
.nr-widget__list--comments li { display: block; }
.nr-widget__list--comments a {
    /* 两行截断：评论一至两行原样显示，超过两行才出省略号（作者名与正文同处这个盒子里） */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
    color: var(--text-soft);
}
.nr-widget__who { color: var(--accent); font-weight: 600; margin-right: 4px; }
.nr-widget__excerpt { color: var(--text-soft); }
.nr-widget__on {
    display: block;
    margin-top: 3px;
    color: var(--text-faint);
    font-size: .72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 关于 */
.nr-widget__about { display: grid; gap: 8px; }
.nr-widget__avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--nr-radius);
    object-fit: cover;
}
.nr-widget__name { margin: 0; font-size: .95rem; font-weight: 700; }
.nr-widget__desc {
    margin: 0;
    color: var(--text-soft);
    font-size: .84rem;
    line-height: 1.7;
}

/* 标签 */
.nr-widget__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nr-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: var(--text-soft);
    font-size: .78rem;
    line-height: 1.5;
    transition: color .18s var(--ease), border-color .18s var(--ease);
}
.nr-chip:hover { color: var(--accent); border-color: var(--accent); }
.nr-chip__n { color: var(--text-faint); font-size: .7rem; font-variant-numeric: tabular-nums; }

/* 统计 */
/* 统计：六个小格子，数字在上、标签在下；底色取主题绿的极低透明度，深浅色都跟着走 */
.nr-widget__stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.nr-widget__stats li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px 8px;
    border-radius: var(--nr-radius);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 13%, transparent);
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.nr-widget__stats li:hover {
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}
.nr-widget__num {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.nr-widget__label {
    font-size: .72rem;
    line-height: 1.3;
    letter-spacing: .04em;
    color: var(--text-soft);
}
/* 底部一行元信息：运行天数 + 最后更新，虚线分隔，不抢数字的视线 */
.nr-widget__meta {
    margin: 10px 0 0;
    padding-top: 9px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: .72rem;
    line-height: 1.5;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.nr-widget__meta b { color: var(--text-soft); font-weight: 600; }

/* 视口装不下「正文 + 侧栏」时直接退回单栏（默认 760 + 10 gap + 280 + 40 = 1090） */
@media (max-width: 1120px) {
    .nr-shell,
    .site-header__inner,
    .site-footer__inner { max-width: var(--nr-content-width); }
    .nr-shell--side,
    .nr-shell--left { display: block; }
    .nr-side { display: none; }
    /* 外壳在此断点回落到正文宽，面板右边缘跟着改基准，否则会飘到视口最右 */
    .nr-panel { right: max(12px, calc((100% - var(--nr-content-width)) / 2 + 20px - 24px)); }
    /* 搜索通栏的内部宽度也跟着页头回落，两者左缘才对得上 */
    .nr-search__inner { max-width: var(--nr-content-width); }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
    .site-header__inner {
        /* 没 JS 时保留换行（导航整行横滑），有 JS 再收成一行图标 */
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 10px 18px;
    }
    .nr-js .site-header__inner {
        flex-wrap: nowrap;
        gap: 10px;
    }
    .site-brand { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .nr-js .nr-iconbtn { display: inline-flex; }
    /* 手机上没有物理键盘，键帽提示没有意义，直接不显示 */
    .nr-iconbtn__key { display: none !important; }
    .nr-headacts { margin-left: auto; gap: 6px; }
    /* 菜单收成抽屉：贴在页头下沿整幅展开，不再横滑占一行 */
    .nr-js .site-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 4px 18px 8px;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nr-js .site-nav.is-open { display: flex; }
    .site-nav a {
        padding: 11px 0;
        font-size: .9rem;
        border-bottom: 1px solid var(--border);
    }
    .site-nav a:last-child { border-bottom: 0; }
    .site-nav a.current::after { display: none; }
    .site-nav a.current { font-weight: 700; }
    /* 搜索通栏在窄屏只是收一下左右内边距，结构不变 */
    .nr-search__inner { padding: 10px 18px 12px; }
    .nr-panel {
        /* 与页头 20px 内边距对齐，全宽浮层 */
        left: 20px;
        right: 20px;
        width: auto;
        top: calc(100% + 6px);
    }
    .post-card { padding: 16px 18px; border-radius: var(--nr-radius-card); }
    .post-card__title { font-size: 1.2rem; }
    .site-footer { padding: 22px 20px 24px; }
    .site-footer__inner { gap: 10px; }
    /* 窄屏把卡片内边距压到与列表卡接近，别让正文被挤成窄条 */
    .site-main.site-main--post { gap: 12px; }
    .site-main--shuo { gap: 12px; }
    .site-main--links { gap: 12px; }
    .nr-links-hero,
    .nr-links-pending,
    .nr-links-wall,
    .nr-link-apply { padding: 18px 16px 16px; }
    .nr-link-form__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .nr-shuo-intro,
    .nr-shuo-form,
    .nr-shuo-card { padding: 18px 16px 16px; }
    .site-main--post > .post,
    .site-main--post > .post-near,
    .site-main--post > .comments { padding: 20px 18px; }
    /* 窄屏内边距只剩 18px，竖条往里收，避免贴到卡片边缘 */
    .post__title::before { left: -10px; }
    .post-near { gap: 10px; }
    /* 窄屏正文：与桌面同为 16px（标题本就与正文同号，不用另调），只收引用与代码的内边距 */
    .post__content { font-size: 1em; }
    .post__content blockquote { padding: 0 1.5em; }
    .post__content pre { padding: 11px 12px; font-size: .82em; }
    .post__content th, .post__content td { padding: 6px 8px; }
    /* 独立页面没有 .nr-shell 提供左右留白（20px），这里补上，免得卡片贴屏边 */
    body > .site-main--post { margin-left: 20px; margin-right: 20px; }  /* 100% - 40px 与左右 20px 对齐 */
    .post__title { font-size: 1.5rem; }
    .post__meta { font-size: .8rem; }
    .respond__fields { grid-template-columns: 1fr; }
    .post-near__item--next { text-align: left; }
    .nr-top { right: 16px; bottom: 16px; }
}

/* ---------- 打印：长文存档 ---------- */
@media print {
    .site-header,
    .site-footer,
    .nr-side,
    .nr-tools,
    .nr-panel,
    .nr-progress,
    .nr-toc,
    .nr-top,
    .nr-skip,
    .comments,
    .post-near,
    .pagination {
        display: none !important;
    }
    :root {
        --bg: #fff;
        --bg-card: #fff;
        --text: #000;
        --text-soft: #333;
        --border: #ccc;
    }
    .nr-shell { max-width: none; padding: 0; }
    .nr-shell--side, .nr-shell--left { display: block; }
    body { font-size: 11pt; }
    .site-main { max-width: none; padding: 0; }
    /* 打印不需要卡片外壳的边框与内边距 */
    .site-main.site-main--post {
        margin: 0;
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
    }
    .post__title { font-size: 20pt; }
    .post__content { font-size: 12pt; line-height: 1.75; }
    .post__content a { color: #000; text-decoration: underline; }
    .post__content pre { white-space: pre-wrap; border: 1px solid #ccc; }
    .post__content img { page-break-inside: avoid; }
    .post__content h1, .post__content h2, .post__content h3 { page-break-after: avoid; }
    .nr-adbar, .nr-crumb { display: none; }
    /* 存档打印不需要彩色装饰符号（负外边距也会让标题偏出纸边） */
    .post__content :is(h1, h2, h3, h4, h5, h6)::before { display: none; }
}

/* ==========================================================================
   左上角轻提醒（Toast）—— 配合 assets/nr-toast.js
   用法见该文件头部注释；这里只管外观。
   ========================================================================== */
.nr-toast-stack {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1400;               /* 普通弹层之上；dialog 里显示时容器会被挪进 dialog（见 nr-toast.js） */
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(22rem, calc(100vw - 32px));
    pointer-events: none;        /* 空白处不挡页面点击，单条自己恢复 */
}
.nr-toast {
    --nr-toast-tone: var(--accent);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 32px 13px 11px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg-card);
    box-shadow: 0 12px 32px rgba(12, 16, 20, .14);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.nr-toast.is-in { opacity: 1; transform: none; }
.nr-toast.is-out { opacity: 0; transform: translateY(-6px); }
.nr-toast--success { --nr-toast-tone: #3d9a6a; }
.nr-toast--error { --nr-toast-tone: #d0554f; }
.nr-toast--warn { --nr-toast-tone: #d2961f; }
.nr-toast--info { --nr-toast-tone: #3d7fb8; }
.nr-toast__icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--nr-toast-tone);
}
.nr-toast__icon svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nr-toast__body { min-width: 0; }
.nr-toast__title {
    margin: 0;
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
}
.nr-toast__msg {
    margin: 2px 0 0;
    font-size: .8rem;
    line-height: 1.65;
    color: var(--text-soft);
    word-break: break-word;
}
.nr-toast__msg:first-child { margin-top: 1px; }
.nr-toast__close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: var(--nr-radius);
    background: none;
    color: var(--text-faint);
    font-size: .9375rem;
    line-height: 1;
    cursor: pointer;
}
.nr-toast__close:hover { background: var(--code-bg); color: var(--text); }
/* 底部进度条 = 倒计时；JS 每 100ms 改一次 scaleX，悬停时暂停 */
.nr-toast__bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: color-mix(in srgb, var(--nr-toast-tone) 16%, transparent);
}
.nr-toast__bar i {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    background: var(--nr-toast-tone);
    transition: transform .1s linear;
}

/* 提交按钮的忙碌 / 成功态 */
.nr-btn-spin {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: nr-spin .7s linear infinite;
}
@keyframes nr-spin { to { transform: rotate(360deg); } }
[type="submit"].is-busy,
button.is-busy {
    cursor: progress;
    opacity: .82;
}
[type="submit"].is-done,
button.is-done {
    color: #3d9a6a;
    border-color: #3d9a6a;
    opacity: 1;
}

@media (max-width: 640px) {
    .nr-toast-stack { top: 10px; left: 10px; width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) {
    .nr-toast { transition: none; }
    .nr-btn-spin { animation-duration: 1.6s; }
}
@media print {
    .nr-toast-stack { display: none !important; }
}

/* ============ 页头用户按钮 + 登录/注册弹窗 ============ */
/* 图标按钮默认 display:none，桌面端把用户按钮与搜索按钮一起显出来 */
.nr-js #nr-user-btn { display: inline-flex; }

.nr-auth__card {
    width: min(26rem, 100%);
    max-height: min(86vh, 42rem);
    padding: 22px 24px 20px;
    overflow-y: auto;
}
.nr-auth__x {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nr-auth__x:hover { color: var(--accent); background: var(--accent-soft); }
.nr-auth__x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.nr-auth__title { margin: 0 0 4px; font-size: 1.08rem; font-weight: 700; }
.nr-auth__sub { margin: 0 0 16px; color: var(--text-faint); font-size: .82rem; line-height: 1.7; }

.nr-auth__tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
}
.nr-auth__tabs button {
    flex: 1 1 0;
    padding: 7px 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nr-auth__tabs button[aria-selected="true"] {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 12%, transparent);
}

.nr-auth__form { display: flex; flex-direction: column; gap: 12px; }
/* hidden 属性会被上面的 display:flex 盖掉，这里补回来 */
.nr-auth__form[hidden] { display: none; }
.nr-auth__field { display: flex; flex-direction: column; gap: 5px; }
.nr-auth__field > span { color: var(--text-faint); font-size: .78rem; letter-spacing: .02em; }
.nr-auth__field input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--nr-radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.nr-auth__field input:focus {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.nr-auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nr-auth__check {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: .82rem;
    cursor: pointer;
    user-select: none;
}
.nr-auth__check input { width: 15px; height: 15px; accent-color: var(--accent); }
.nr-auth__hint { margin: 0; color: var(--text-faint); font-size: .78rem; line-height: 1.7; }
.nr-auth__hint--off { margin-top: 8px; text-align: center; }

.nr-auth__submit {
    height: 42px;
    margin-top: 2px;
    border: 0;
    border-radius: var(--nr-radius);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: filter .18s var(--ease), opacity .18s var(--ease);
}
.nr-auth__submit:hover { filter: brightness(1.06); }
.nr-auth__submit:disabled { opacity: .65; cursor: default; }
.nr-auth__form.is-busy .nr-auth__field { opacity: .65; }
.nr-auth__form.is-busy .nr-auth__field input { pointer-events: none; }
.is-dim { opacity: .3; pointer-events: none; transition: opacity .18s var(--ease); }

/* ---- 方向箭头验证 ---- */
.nr-auth__cap-tip {
    margin: 0 0 10px;
    color: var(--text-soft);
    font-size: .82rem;
    text-align: center;
}
.nr-auth__cap-target {
    display: inline-block;
    margin: 0 4px;
    padding: 1px 9px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .95rem;
    letter-spacing: .18em;
}
.nr-auth__cap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 230px;
    margin: 0 auto;
}
.nr-auth__cap-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-soft);
    cursor: pointer;
    transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.nr-auth__cap-cell:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
    color: var(--accent);
    background: var(--accent-soft);
}
.nr-auth__cap-cell.is-hit {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    opacity: .5;
    cursor: default;
}
.nr-auth__cap-cell svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* 箭头基础指向正上方，按方向旋转 */
.nr-auth__cap-arrow { display: inline-flex; transform: rotate(0deg); color: var(--cap-tone, currentColor); }
.nr-auth__cap-arrow.is-up-right { transform: rotate(45deg); }
.nr-auth__cap-arrow.is-right { transform: rotate(90deg); }
.nr-auth__cap-arrow.is-down-right { transform: rotate(135deg); }
.nr-auth__cap-arrow.is-down { transform: rotate(180deg); }
.nr-auth__cap-arrow.is-down-left { transform: rotate(225deg); }
.nr-auth__cap-arrow.is-left { transform: rotate(270deg); }
.nr-auth__cap-arrow.is-up-left { transform: rotate(315deg); }
.nr-auth__cap-err {
    margin: 8px 0 0;
    color: #d93025;
    font-size: .78rem;
    text-align: center;
}
.nr-auth__cap-cancel {
    display: block;
    margin: 10px auto 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-faint);
    font: inherit;
    font-size: .78rem;
    text-decoration: underline;
    cursor: pointer;
}

/* 人机验证独立弹窗（第二层），比登录卡片更窄更矮，居中显示 */
.nr-cap__card {
    width: min(21rem, 100%);
    padding: 20px 20px 16px;
    text-align: center;
}
.nr-cap__title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.nr-cap .nr-auth__cap-tip { margin-bottom: 14px; }
.nr-cap .nr-auth__cap-grid { max-width: 210px; }
.nr-cap__actions { display: flex; justify-content: center; margin-top: 14px; }
.nr-cap__cancel {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-soft);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: color .18s var(--ease), border-color .18s var(--ease);
}
.nr-cap__cancel:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }


/* ---------- 配色/可访问性补丁 ---------- */
/* 深色 accent 是浅绿色，白字只有 2.02:1；改用深色前景 */
.pagination__list li.current span,
.comments .page-navigator li.current span,
.nr-links-random:hover,
.nr-links-btn--primary,
.nr-links-btn--primary:hover,
.nr-auth__submit,
.nr-shuo-btn:not(.nr-shuo-btn--ghost) {
    color: var(--on-accent);
}

/* 全宽模式给正文一个可读行长，避免宽屏一行上百字 */
html[data-width="full"] .post__content {
    max-width: 46em;
    margin-left: auto;
    margin-right: auto;
}

/* 后台宽度配置 + 侧栏，放不下时由 header 前置脚本/JS 加这个 class 收起侧栏 */
html.nr-shell-compact .nr-shell,
html.nr-shell-compact .site-header__inner,
html.nr-shell-compact .site-footer__inner {
    max-width: var(--nr-content-width);
}
html.nr-shell-compact .nr-shell--side,
html.nr-shell-compact .nr-shell--left { display: block; }
html.nr-shell-compact .nr-side { display: none; }
html.nr-shell-compact .nr-panel {
    right: max(12px, calc((100% - var(--nr-content-width)) / 2 + 20px - 24px));
}
html.nr-shell-compact .nr-search__inner { max-width: var(--nr-content-width); }
