Files
obsidian-rss-union/styles.css

1269 lines
28 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ==================================================================
RSS Union Reader
全部用 Obsidian 自己的 CSS 变量,深浅色主题都不用另写一套
配色规则(这次重写的重点)
---------------------------------------------------------------
1. 两层表面:外壳 = background-secondary(顶栏 / 左树 / 统计条 /
分页 / 状态栏),内容 = background-primary(文章列表、阅读正文)。
以前顶栏用 primary、统计条用 secondary,深色下会突然暗一块,
看起来像两个界面拼起来的。
2. 所有「强调色淡底」都和所在表面做 color-mix,不再和 transparent 混。
深色主题下 accent 叠在深底上乘 alpha 会暗到看不见;和 background
混合则会整体提亮,深浅两边视觉重量才一致。
3. 文字分三级:normal(标题)/ muted(次要)/ faint(装饰)。
以前把正文摘要、时间行放到 faint,浅色下几乎是白字,读不出来。
结构:
.ru-view
.ru-bar 顶部工具条
.ru-main
.ru-tree 左:分类树
.ru-listwrap 右:统计条 + 列表 + 分页
.ru-status 底部状态
================================================================== */
.ru-view,
.ru-reader {
/* 表面 */
--ru-bg: var(--background-primary);
--ru-shell: var(--background-secondary);
--ru-line: var(--background-modifier-border);
--ru-hover: var(--background-modifier-hover);
/* 悬停更明显一档(深色主题的 modifier-hover 很淡) */
--ru-hover-strong: var(--background-modifier-active-hover, var(--background-modifier-hover));
color: var(--text-normal);
}
.ru-view {
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
overflow: hidden;
background: var(--ru-shell);
/* 让下面的 @container 按「面板宽度」生效 —— 侧边栏拖窄时,
窗口本身还是宽的,@media 查不出来 */
container-type: inline-size;
container-name: ru;
}
/* ---------- 顶部工具条 ---------- */
/* 三段式栅格:左标题|中搜索|右动作。
两侧都是 1fr,中间的搜索框永远落在整条的正中间;
面板变窄时中间格先缩到 120px,再窄就隐藏标题里的范围文字。 */
.ru-bar {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(120px, 340px) minmax(0, 1fr);
align-items: center;
gap: 12px;
padding: 7px 12px;
flex: 0 0 auto;
border-bottom: 1px solid var(--ru-line);
background: var(--ru-shell);
}
.ru-bar__title {
display: flex;
align-items: center;
gap: 7px;
min-width: 0;
justify-self: start;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.01em;
}
.ru-bar__icon {
display: inline-flex;
color: var(--interactive-accent);
}
.ru-bar__icon .svg-icon {
width: 16px;
height: 16px;
}
.ru-bar__scope {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-normal);
}
/* 搜索格:内容居中,输入框自己撑满这一格 */
.ru-bar__search {
display: flex;
align-items: center;
justify-content: center;
min-width: 0;
width: 100%;
}
.ru-bar__actions {
justify-self: end;
display: flex;
align-items: center;
gap: 6px;
}
/* 搜索框:住在顶栏中间。
底用 primary —— 外壳是 secondary,这样它像「凹进去的一个输入格」,
深浅两个主题下都能和顶栏分开,不用靠阴影。 */
.ru-search {
width: 100%;
max-width: 340px;
min-width: 0;
height: 28px;
font-size: 12.5px;
padding: 0 11px;
border-radius: 999px;
border: 1px solid var(--ru-line);
background: var(--ru-bg);
color: var(--text-normal);
box-shadow: none;
}
.ru-search::placeholder {
color: var(--text-faint);
}
.ru-search:hover {
border-color: var(--background-modifier-border-hover, var(--text-faint));
}
.ru-search:focus {
border-color: var(--interactive-accent);
background: var(--ru-bg);
/* 各主题都认的写法:用 accent 的 hsl 分量算透明色 */
box-shadow: 0 0 0 2px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.22);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--interactive-accent) 24%, transparent);
}
@container ru (max-width: 460px) {
.ru-bar {
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 8px;
}
.ru-bar__scope {
display: none;
}
}
.ru-icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: none;
border-radius: var(--radius-s);
background: transparent;
color: var(--text-muted);
cursor: pointer;
box-shadow: none;
}
.ru-icon-btn:hover {
background: var(--ru-hover);
color: var(--text-normal);
}
.ru-icon-btn:disabled {
opacity: 0.35;
cursor: default;
background: transparent;
}
.ru-icon-btn .svg-icon {
width: 16px;
height: 16px;
}
/* ---------- 主体:左树 + 右列表 ---------- */
.ru-main {
flex: 1 1 auto;
display: flex;
min-height: 0;
background: var(--ru-bg);
}
/* ---------- 左树 ---------- */
.ru-tree {
/* 跟着面板宽度伸缩:宽面板 232px,窄到侧边栏时收到 132px */
flex: 0 0 clamp(132px, 26%, 232px);
min-width: 0;
max-width: 232px;
overflow: auto;
padding: 8px 6px 20px;
border-right: 1px solid var(--ru-line);
background: var(--ru-shell);
}
.ru-tree__cat {
margin: 1px 0;
border: none;
background: none;
}
.ru-tree__row {
position: relative;
display: flex;
align-items: center;
gap: 6px;
width: 100%;
min-height: 29px;
padding: 5px 8px;
border: none;
border-radius: var(--radius-s);
background: transparent;
color: var(--text-normal);
font-size: 12.5px;
line-height: 1.4;
text-align: left;
cursor: pointer;
box-shadow: none;
outline: none;
white-space: nowrap;
transition: background-color 0.1s ease, color 0.1s ease;
}
.ru-tree__row:hover {
background: var(--ru-hover);
}
/* 键盘操作时给个不刺眼的焦点提示(div 有 tabindex,默认 outline 会被主题放大) */
.ru-tree__row:focus-visible {
background: var(--ru-hover);
box-shadow: inset 0 0 0 1px var(--background-modifier-border-focus);
}
/* 选中:左侧一条 2px 的强调色竖条 + 淡强调色底。
注意别写 rgba(var(--color-accent-rgb), …) —— Obsidian 只提供
--accent-h / --accent-s / --accent-l,没有 accent-rgb 这个变量,
那种写法整条声明会被丢弃,选中行看起来就像没选中。
底色和「所在表面」(左树是 secondary)混合:深色主题下才是提亮而不是变暗。 */
.ru-tree__row.is-active {
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.16);
background: color-mix(in srgb, var(--interactive-accent) 18%, var(--ru-shell));
color: var(--text-accent);
font-weight: 600;
}
.ru-tree__row.is-active::before {
content: "";
position: absolute;
left: 0;
top: 5px;
bottom: 5px;
width: 2px;
border-radius: 2px;
background: var(--interactive-accent);
}
.ru-tree__row--cat {
list-style: none;
padding-left: 6px;
}
.ru-tree__row--cat::-webkit-details-marker {
display: none;
}
.ru-tree__row--cat::marker {
content: "";
}
.ru-tree__caret {
display: inline-flex;
color: var(--text-faint);
transition: transform 0.14s ease;
}
.ru-tree__caret .svg-icon {
width: 13px;
height: 13px;
}
.ru-tree__cat[open] > .ru-tree__row--cat .ru-tree__caret {
transform: rotate(90deg);
}
.ru-tree__label {
flex: 1 1 auto;
overflow: hidden;
text-overflow: ellipsis;
}
/* 计数做成小小的胶囊,数字与名字一眼分开。
底 = 文字色 7% 混入外壳:浅色下略微变灰、深色下略微变亮,
两边都是「比底色深/浅一点点」,不会像 transparent 混合那样一边消失。 */
.ru-tree__count {
flex: 0 0 auto;
min-width: 0;
padding: 0 5px;
border-radius: 999px;
font-size: 10.5px;
line-height: 16px;
color: var(--text-muted);
background: var(--ru-hover);
background: color-mix(in srgb, var(--text-normal) 9%, var(--ru-shell));
font-weight: 500;
font-variant-numeric: tabular-nums;
}
.ru-tree__count:empty {
display: none;
}
.ru-tree__row.is-active .ru-tree__count {
color: var(--text-accent);
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.24);
background: color-mix(in srgb, var(--interactive-accent) 28%, var(--ru-shell));
}
.ru-tree__sites {
/* 只用缩进表达层级,不要背景、不要竖线 */
padding: 0 0 0 16px;
margin: 0;
border: none;
background: none;
}
.ru-tree__row--site {
/* 这三条是给旧版 button 兜底的:万一还是 button,也不带主题的边框底色 */
border: none;
background: transparent;
box-shadow: none;
color: var(--text-muted);
font-weight: 400;
font-size: 12px;
min-height: 26px;
padding-top: 3px;
padding-bottom: 3px;
}
.ru-tree__row--site:hover {
color: var(--text-normal);
}
/* 网站行选中只换字色:分类树那一套「淡底 + 左侧竖条」是给分类/全部用的,
网站是缩进在最里层的叶子,再来一块底色就把整片列表框成色块了。 */
.ru-tree__row--site.is-active {
color: var(--text-accent);
font-weight: 500;
background: transparent;
}
.ru-tree__row--site.is-active::before {
content: none;
}
.ru-tree__state {
display: flex;
flex-direction: column;
gap: 8px;
align-items: flex-start;
padding: 16px 10px;
font-size: 12px;
color: var(--text-muted);
line-height: 1.7;
}
.ru-tree__state-title {
font-weight: 600;
color: var(--text-normal);
}
.ru-tree__state-desc {
font-size: 12px;
color: var(--text-muted);
}
.ru-tree__state.is-error {
color: var(--text-error);
}
/* ---------- 右列表 ---------- */
.ru-listwrap {
flex: 1 1 auto;
display: flex;
flex-direction: column;
min-width: 0;
background: var(--ru-bg);
}
/* 列表顶部统计条:左「共 N 篇」,右已读 · 未读。
搜索已经搬到顶栏,这一条只回答「范围多大、读了多少」。
用外壳色,和顶栏连成一条横向的「信息带」,下方才是内容区。 */
.ru-listhead {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 10px;
padding: 7px 14px;
border-bottom: 1px solid var(--ru-line);
font-size: 11.5px;
color: var(--text-muted);
background: var(--ru-shell);
}
.ru-listhead__left {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
font-variant-numeric: tabular-nums;
}
.ru-listhead__icon {
display: inline-flex;
flex: 0 0 auto;
color: var(--text-faint);
}
.ru-listhead__icon .svg-icon {
width: 14px;
height: 14px;
}
/* 「共 N 篇」就是一行字,不用 button:主题给 button 的底色、边框、
hover 反白会把这行字弄成一个突兀的方块。 */
.ru-listhead__total {
color: var(--text-normal);
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 筛选进行中时才允许点它回到全部(此时它是唯一能「退出来」的地方) */
.ru-listhead__total.is-clearable {
cursor: pointer;
}
.ru-listhead__left.is-filtered .ru-listhead__total {
color: var(--text-accent);
}
/* 服务端文件还是旧版时的小标签:让「数字不对」这件事一眼可见。
橙字压淡橙底;底色和外壳混合,深色主题下不会暗成一块脏斑。 */
.ru-listhead__warn {
flex: 0 0 auto;
padding: 0 6px;
border-radius: 999px;
font-size: 10.5px;
line-height: 16px;
white-space: nowrap;
color: var(--color-orange);
background: rgba(var(--color-orange-rgb), 0.18);
background: color-mix(in srgb, var(--color-orange) 20%, var(--ru-shell));
}
.ru-listhead__right {
margin-left: auto;
display: flex;
align-items: center;
justify-content: flex-end;
/* 多选时这一格会多出「全选 / 设为已读」两枚按钮。
flex-basis 必须是 0:留 auto 的话它的「理想宽度」有 300 多像素,
整格会被挤到下一行,「共 N 篇」就孤零零占一行了。
取 0 之后它先和左边同排,放不下的按钮自己往下换行。 */
flex: 1 1 0;
min-width: 0;
flex-wrap: wrap;
gap: 2px 4px;
font-variant-numeric: tabular-nums;
}
/* 已读 / 未读:两枚按钮的结构与盒模型完全一致(同 padding、同字号、
同圆角、都没有边框和底色),只有「字色 + 圆点色」不同。
选中时两枚也一样:强调色实心。 */
.ru-chip {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 1px 8px;
margin: 0;
border: none;
border-radius: 999px;
background: transparent;
box-shadow: none;
font-family: inherit;
font-size: 11px;
line-height: 17px;
white-space: nowrap;
cursor: pointer;
color: var(--text-muted);
transition: background-color 90ms ease, color 90ms ease;
}
.ru-chip:hover {
background: var(--ru-hover);
color: var(--text-normal);
}
.ru-chip__dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex: 0 0 auto;
background: currentColor;
}
/* 未读用强调色、已读用次要灰:区分靠色相,不靠把已读压到看不见 */
.ru-chip--unread {
color: var(--text-accent);
}
.ru-chip--unread .ru-chip__dot {
background: var(--interactive-accent);
}
.ru-chip--read {
color: var(--text-muted);
}
.ru-chip--read .ru-chip__dot {
background: var(--text-muted);
}
/* 选中态:两枚完全同一套样式,整枚变强调色实心,一眼看出列表被筛过 */
.ru-chip.is-active {
color: var(--text-on-accent);
background: var(--interactive-accent);
}
.ru-chip.is-active:hover {
color: var(--text-on-accent);
background: var(--interactive-accent-hover);
}
.ru-chip.is-active .ru-chip__dot {
background: var(--text-on-accent);
}
.ru-chip__n {
font-weight: 600;
}
/* 搜索期间顶替已读 / 未读的位置:显示关键词,点一下清空 */
.ru-chip--search {
max-width: 220px;
color: var(--text-normal);
background: transparent;
}
.ru-chip--search .ru-chip__label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* ---------- 多选:选择 / 全选 / 设为已读 ----------
和已读未读同一套盒模型(无边框、无底色、同 padding),
所以整条统计条看起来是一排等高的胶囊,不会冒出方块。 */
.ru-chip--tool {
color: var(--text-muted);
}
.ru-chip--tool:hover {
color: var(--text-normal);
}
/* 「选择」进入后变成「取消」,选中态用实心强调色区分 */
.ru-chip--tool.is-active {
color: var(--text-on-accent);
}
/* 按钮里不再带图标(「选择 / 取消」只用文字),原先的 .ru-chip__icon
规则一并去掉,省得留在样式表里误导后来的人。 */
/* 「设为已读」有勾选时才亮成强调色,没勾选是禁用灰 */
.ru-chip--action:not(:disabled) {
color: var(--text-accent);
}
.ru-chip--action:not(:disabled):hover {
color: var(--text-accent);
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.14);
background: color-mix(in srgb, var(--interactive-accent) 16%, var(--ru-shell));
}
.ru-chip:disabled {
opacity: 0.42;
cursor: default;
}
.ru-chip:disabled:hover {
background: transparent;
color: var(--text-muted);
}
.ru-list {
flex: 1 1 auto;
overflow: auto;
padding: 4px 10px 24px;
scroll-padding-top: 8px;
background: var(--ru-bg);
}
.ru-list__state {
display: flex;
flex-direction: column;
gap: 10px;
align-items: center;
justify-content: center;
height: 100%;
min-height: 180px;
text-align: center;
color: var(--text-muted);
font-size: 12.5px;
padding: 24px;
}
.ru-list__state-title {
font-size: 13px;
font-weight: 600;
color: var(--text-normal);
}
.ru-list__state-desc {
max-width: 420px;
line-height: 1.7;
}
.ru-list__state.is-error .ru-list__state-title {
color: var(--text-error);
}
/* ---------- 文章行 ---------- */
.ru-item {
position: relative;
padding: 10px 12px;
border-radius: var(--radius-m);
cursor: pointer;
transition: background-color 0.1s ease;
}
.ru-item:hover {
background: var(--ru-hover);
}
.ru-item:active {
background: var(--ru-hover-strong);
}
/* 多选:勾上的行铺一层淡强调色,配合行首复选框。
和「内容区底色」混合,深色主题下是提亮,不会比未选中还暗。 */
.ru-item.is-selected {
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.12);
background: color-mix(in srgb, var(--interactive-accent) 13%, var(--ru-bg));
}
.ru-item.is-selected:hover {
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.18);
background: color-mix(in srgb, var(--interactive-accent) 19%, var(--ru-bg));
}
/* 行首复选框:交给 Obsidian 自己的 checkbox 变量上色,深浅主题都跟得上 */
.ru-pick {
flex: 0 0 auto;
width: 15px;
height: 15px;
min-width: 15px;
margin: 0;
padding: 0;
cursor: pointer;
}
/* 多选时行首已经有复选框了,再来一个未读圆点会变成「□ ○」两个小圈 */
.ru-item.is-selecting .ru-item__dot {
display: none;
}
/* 选择模式下标题右移了一个复选框的宽度,下面的正文跟着对齐 */
.ru-item.is-selecting .ru-item__meta,
.ru-item.is-selecting .ru-item__excerpt,
.ru-item.is-selecting .ru-item__tags {
padding-left: 21px;
}
/* 行与行之间一条很淡的分隔线,扫读时不会糊成一团。
直接用主题的 border 色:它在深色下是白色 8%、浅色下是黑色 9%,
两边强度天生一致,不用再乘不透明度。 */
.ru-item + .ru-item::before {
content: "";
position: absolute;
left: 12px;
right: 12px;
top: 0;
height: 1px;
background: var(--ru-line);
}
.ru-item:hover::before,
.ru-item:hover + .ru-item::before {
opacity: 0;
}
.ru-item__head {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
/* 未读圆点:已读时变成空心点,扫一眼就能分清 */
.ru-item__dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex: 0 0 auto;
background: var(--interactive-accent);
transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.ru-item.is-read .ru-item__dot {
background: transparent;
box-shadow: inset 0 0 0 1.5px var(--text-faint);
}
.ru-item__title {
flex: 0 1 auto;
min-width: 0;
font-size: 13.5px;
font-weight: 600;
line-height: 1.5;
color: var(--text-normal);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 已读标题压到次要色,但 hover 时提回来 —— 鼠标指着的那一行不该是灰的 */
.ru-item.is-read .ru-item__title {
color: var(--text-muted);
font-weight: 500;
}
.ru-item:hover .ru-item__title {
color: var(--text-normal);
}
.ru-item__title.is-cached {
color: var(--text-accent);
}
/* 时间 / 来源行进次要色。以前用 faint,浅色主题下 11.5px 的灰白字
基本读不出来;这里退到 muted,靠字号而不是靠发白来降低权重。 */
.ru-item__meta {
margin-top: 2px;
padding-left: 12px;
font-size: 11.5px;
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ru-item__excerpt {
margin-top: 4px;
padding-left: 12px;
font-size: 12px;
line-height: 1.65;
color: var(--text-muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* 已读摘要降一档:同样是 muted,只压不透明度,深浅两边都还读得清 */
.ru-item.is-read .ru-item__excerpt {
opacity: 0.8;
}
.ru-item__tags {
margin-top: 6px;
padding-left: 12px;
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.ru-item__tag {
padding: 0 6px;
border-radius: 999px;
font-size: 10.5px;
line-height: 16px;
color: var(--text-accent);
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.10);
background: color-mix(in srgb, var(--interactive-accent) 12%, var(--ru-bg));
}
/* 徽标 */
.ru-badge {
display: inline-flex;
align-items: center;
gap: 3px;
flex: 0 0 auto;
padding: 0 6px;
border-radius: 999px;
font-size: 10.5px;
line-height: 16px;
}
.ru-badge__icon {
display: inline-flex;
}
.ru-badge__icon .svg-icon {
width: 10px;
height: 10px;
}
/* 三种彩色徽标都按「颜色 18% 混入内容底色」上底,
深色主题下不会变成一块块发黑的色斑。 */
.ru-badge--pin {
color: var(--color-red);
background: rgba(var(--color-red-rgb), 0.14);
background: color-mix(in srgb, var(--color-red) 18%, var(--ru-bg));
}
.ru-badge--feature {
color: var(--color-orange);
background: rgba(var(--color-orange-rgb), 0.14);
background: color-mix(in srgb, var(--color-orange) 18%, var(--ru-bg));
}
.ru-badge--hot {
color: var(--color-purple);
background: rgba(var(--color-purple-rgb), 0.14);
background: color-mix(in srgb, var(--color-purple) 18%, var(--ru-bg));
}
.ru-badge--cached {
color: var(--text-accent);
background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.14);
background: color-mix(in srgb, var(--interactive-accent) 15%, var(--ru-bg));
}
/* ---------- 分页 ---------- */
.ru-pager {
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
padding: 8px 12px;
border-top: 1px solid var(--ru-line);
font-size: 11.5px;
color: var(--text-muted);
background: var(--ru-shell);
font-variant-numeric: tabular-nums;
}
.ru-pager.is-hidden {
display: none;
}
.ru-pager .ru-icon-btn {
width: 24px;
height: 24px;
}
/* ---------- 底部状态栏 ---------- */
.ru-status {
flex: 0 0 auto;
display: flex;
gap: 12px;
align-items: center;
padding: 0 12px;
border-top: 1px solid var(--ru-line);
font-size: 11px;
color: var(--text-muted);
min-height: 24px;
background: var(--ru-shell);
}
.ru-status__hint {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 筛选进行中:跟随强调色,别和「未读」胶囊抢注意力 */
.ru-status__filter {
flex: 0 0 auto;
color: var(--text-accent);
font-weight: 600;
white-space: nowrap;
}
/* 服务端文件没换 / 接口过旧时的一行提醒 */
.ru-status__warn {
flex: 0 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--color-orange);
}
.ru-status__auto {
margin-left: auto;
flex: 0 0 auto;
white-space: nowrap;
color: var(--text-faint);
}
/* 面板很窄时:统计条允许换行,已读 / 未读掉到第二行右侧,
「共 N 篇」独占第一行 —— 挤在一行会互相压字 */
@container ru (max-width: 380px) {
/* 这个宽度下列表区只有 220px 左右。把按钮的横向内边距和字号收一档后,
「共 N 篇 + 取消 + 全选 + 设为已读(N)」刚好挤进第一行,
「未读 / 已读」落到第二行右对齐 —— 总共两行,比竖排四行省一半高度。 */
.ru-listhead {
flex-wrap: wrap;
row-gap: 3px;
gap: 6px;
padding: 6px 10px;
}
.ru-listhead__right {
flex: 1 1 0;
min-width: 0;
justify-content: flex-end;
gap: 2px;
}
.ru-listhead__right .ru-chip {
padding: 1px 4px;
gap: 3px;
font-size: 10.5px;
}
}
/* 侧边栏那种宽度:左树收窄,把空间让给文章列表 */
@container ru (max-width: 520px) {
.ru-tree {
flex-basis: 132px;
padding-left: 4px;
padding-right: 4px;
}
.ru-tree__row {
font-size: 12px;
padding-left: 6px;
padding-right: 4px;
}
.ru-tree__sites {
padding-left: 10px;
}
}
/* ---------- 通用小件 ---------- */
.ru-linkbtn {
border: none;
background: transparent;
color: var(--text-accent);
font-size: 12px;
cursor: pointer;
padding: 2px 0;
box-shadow: none;
}
.ru-linkbtn:hover {
background: transparent;
text-decoration: underline;
}
.ru-primary {
padding: 6px 16px;
border-radius: var(--radius-m);
border: 1px solid var(--interactive-accent);
background: var(--interactive-accent);
color: var(--text-on-accent);
font-size: 12.5px;
cursor: pointer;
box-shadow: none;
}
.ru-primary:hover {
background: var(--interactive-accent-hover);
color: var(--text-on-accent);
}
.ru-spinner {
width: 18px;
height: 18px;
border: 2px solid var(--ru-line);
border-top-color: var(--interactive-accent);
border-radius: 50%;
animation: ru-spin 0.7s linear infinite;
}
@keyframes ru-spin {
to {
transform: rotate(360deg);
}
}
/* ---------- 未配置 ---------- */
.ru-config {
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 32px 24px;
text-align: center;
max-width: 460px;
}
.ru-config__icon {
color: var(--text-muted);
}
.ru-config__icon .svg-icon {
width: 34px;
height: 34px;
}
.ru-config__title {
font-size: 15px;
font-weight: 600;
}
.ru-config__desc {
font-size: 12.5px;
line-height: 1.8;
color: var(--text-muted);
}
/* ==================================================================
阅读窗口
================================================================== */
.ru-reader {
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
overflow: hidden;
background: var(--ru-bg);
}
.ru-reader__bar {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 20px 6px;
flex: 0 0 auto;
}
.ru-reader__title {
flex: 1 1 auto;
min-width: 0;
font-size: 16.5px;
font-weight: 650;
line-height: 1.45;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-normal);
}
.ru-reader__actions {
display: flex;
gap: 2px;
flex: 0 0 auto;
}
.ru-reader__meta {
flex: 0 0 auto;
display: flex;
gap: 8px;
align-items: baseline;
flex-wrap: wrap;
padding: 0 20px 10px;
border-bottom: 1px solid var(--ru-line);
font-size: 11.5px;
color: var(--text-muted);
}
.ru-reader__origin {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 60%;
color: var(--text-accent);
}
.ru-reader__count {
margin-left: auto;
font-variant-numeric: tabular-nums;
color: var(--text-faint);
}
/* 正文限宽居中:行长超过 80 字符就很难读了 */
.ru-reader__content {
flex: 1 1 auto;
overflow: auto;
width: 100%;
max-width: 760px;
margin: 0 auto;
padding: 22px 28px 90px;
font-size: var(--font-text-size, 15px);
line-height: 1.8;
box-sizing: border-box;
color: var(--text-normal);
}
.ru-reader__content > :first-child {
margin-top: 0;
}
.ru-reader__content h1,
.ru-reader__content h2,
.ru-reader__content h3 {
line-height: 1.4;
margin-top: 1.6em;
}
.ru-reader__content a {
color: var(--link-color, var(--text-accent));
text-decoration: none;
}
.ru-reader__content a:hover {
text-decoration: underline;
}
.ru-reader__content img {
max-width: 100%;
height: auto;
border-radius: var(--radius-s);
}
/* 引用块用强调色细线打头:深浅主题下都比灰线更容易认出这是引用 */
.ru-reader__content blockquote {
margin-left: 0;
padding-left: 14px;
border-left: 3px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
border-left: 3px solid color-mix(in srgb, var(--interactive-accent) 55%, var(--ru-line));
color: var(--text-muted);
}
.ru-reader__content pre {
overflow: auto;
border-radius: var(--radius-s);
}
.ru-reader__content code {
font-size: 0.92em;
}
.ru-reader__state {
display: flex;
flex-direction: column;
gap: 10px;
align-items: center;
justify-content: center;
min-height: 240px;
padding: 32px;
text-align: center;
color: var(--text-muted);
}
.ru-reader__state-title {
font-size: 14px;
font-weight: 600;
color: var(--text-normal);
}
.ru-reader__state.is-error .ru-reader__state-title {
color: var(--text-error);
}
.ru-reader__state-desc {
max-width: 480px;
font-size: 12.5px;
line-height: 1.8;
}
.ru-reader__state-acts {
display: flex;
gap: 8px;
margin-top: 4px;
}
.ru-reader__state-acts button {
padding: 5px 12px;
font-size: 12px;
}
.ru-reader__notice {
margin-bottom: 16px;
padding: 8px 12px;
border-radius: var(--radius-s);
border-left: 3px solid var(--color-orange);
background: rgba(var(--color-orange-rgb), 0.12);
background: color-mix(in srgb, var(--color-orange) 14%, var(--ru-bg));
font-size: 12px;
color: var(--text-muted);
}
/* ---------- 设置页 ---------- */
.ru-setting-code {
width: 320px;
font-family: var(--font-monospace);
}
.ru-setting-verify {
margin-top: 4px;
font-size: 12px;
color: var(--text-muted);
}
.ru-setting-verify.is-ok {
color: var(--text-success);
}
.ru-setting-verify.is-error {
color: var(--text-error);
}
.ru-setting-help {
font-size: 12.5px;
line-height: 1.9;
color: var(--text-muted);
}
/* ---------- 滚动条:细一点,别抢视线的注意力 ----------
用「文字色混一点」而不是 border 色:border 色的灰度在各主题里
差别很大,深色主题下常常淡到看不见,滚动条一消失就找不到位置。 */
.ru-tree::-webkit-scrollbar,
.ru-list::-webkit-scrollbar,
.ru-reader__content::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.ru-tree::-webkit-scrollbar-thumb,
.ru-list::-webkit-scrollbar-thumb,
.ru-reader__content::-webkit-scrollbar-thumb {
background: var(--ru-line);
background: color-mix(in srgb, var(--text-normal) 16%, transparent);
border-radius: 999px;
}
.ru-tree::-webkit-scrollbar-thumb:hover,
.ru-list::-webkit-scrollbar-thumb:hover,
.ru-reader__content::-webkit-scrollbar-thumb:hover {
background: color-mix(in srgb, var(--text-normal) 30%, transparent);
}