Files
NiceQuote/assets/admin.css

717 lines
14 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.
/*
* NiceQuote 2.1 后台编辑器样式
*
* 1) 工具栏按钮:只作用于 #nq-button,跟随 Typecho / riven / NewAdmin 的既有按钮尺寸
* 2) 弹窗:全部 nq- 前缀,支持 NewAdmin 深色(.nq-dark)与系统深色
*/
/* ---------- 工具栏按钮 ---------- */
#wmd-button-row li#nq-button {
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
line-height: 0;
cursor: pointer;
color: #777;
}
#wmd-button-row li#nq-button svg {
display: block;
width: 20px;
height: 20px;
}
#wmd-button-row li#nq-button:hover {
color: var(--nq-ui-accent, #467b96);
}
/* 工具栏只剩很窄的空位时自动收窄,避免被挤到第三行 */
#wmd-button-row li#nq-button.nq-compact {
padding: 0.35rem !important;
margin: 0.15rem !important;
}
/* NewAdmin 深色:hover 底色是深蓝,图标颜色跟随提亮 */
#newadmin.dark #wmd-button-row li#nq-button {
color: #cbd5e1;
}
#newadmin.dark #wmd-button-row li#nq-button:hover {
color: #fff;
}
.nq-fallback-bar {
margin-bottom: 8px;
}
/* ---------- 遮罩与弹窗 ---------- */
.nq-mask {
position: fixed;
inset: 0;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
background: rgba(15, 23, 42, .5);
}
.nq-mask[hidden] {
display: none;
}
.nq-modal {
display: flex;
flex-direction: column;
width: 560px;
max-width: 100%;
max-height: calc(100vh - 40px);
overflow: hidden;
border-radius: 12px;
background: #fff;
color: #1f2328;
box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
font-size: 14px;
line-height: 1.6;
animation: nq-pop .16s ease-out;
}
/* 插入框:左边选、右边看,省掉纵向滚动 */
.nq-modal.nq-modal-wide {
width: 840px;
}
@keyframes nq-pop {
from {
opacity: 0; transform: translateY(6px) scale(.99);
}
to {
opacity: 1; transform: none;
}
}
.nq-modal-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 18px;
border-bottom: 1px solid #eef0f2;
}
.nq-modal-head strong {
font-size: 15px;
font-weight: 600;
}
.nq-count {
margin: 0 10px 0 auto;
color: #9aa3ad;
font-size: 12px;
}
.nq-x {
border: 0;
background: transparent;
color: #9aa3ad;
font-size: 22px;
line-height: 1;
cursor: pointer;
padding: 0 4px;
border-radius: 6px;
}
.nq-x:hover {
color: #1f2328;
background: #f1f3f5;
}
.nq-modal-body {
flex: 1 1 auto;
min-height: 0;
padding: 16px 18px 18px;
overflow-y: auto;
}
/* 左右两栏:左选右看 */
.nq-modal-body.nq-split {
display: grid;
grid-template-columns: minmax(0, 1fr) 300px;
gap: 18px;
align-items: start;
}
/* 右侧预览跟着表单一起滚,条目多的时候在栏内自己滚 */
.nq-col-side {
position: sticky;
top: 0;
align-self: start;
}
.nq-col-main,
.nq-col-side {
min-width: 0;
}
.nq-row {
margin-bottom: 14px;
}
.nq-row:last-child {
margin-bottom: 0;
}
.nq-label {
display: block;
margin-bottom: 6px;
color: #6b7280;
font-size: 12px;
letter-spacing: .02em;
}
/* ---------- 七类引用:各自独立 ---------- */
.nq-kinds {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
}
/* 「修改引用」弹窗里没有外部链接,三列刚好排满 */
.nq-kinds-sm {
grid-template-columns: repeat(3, 1fr);
}
.nq-kind {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
height: 40px;
padding: 0 8px;
border: 1px solid #e2e5e9;
border-radius: 8px;
background: #fff;
color: #4b5563;
font-size: 13px;
line-height: 1;
cursor: pointer;
transition: border-color .15s, background .15s, color .15s;
}
.nq-kind svg {
width: 18px;
height: 18px;
flex: 0 0 auto;
opacity: .7;
}
.nq-kind:hover {
border-color: #c8ced6;
color: #1f2328;
}
.nq-kind.is-on {
border-color: var(--nq-ui-accent, #467b96);
background: #f2f8fb;
background: color-mix(in srgb, var(--nq-ui-accent, #467b96) 10%, #fff);
color: var(--nq-ui-accent, #467b96);
font-weight: 600;
}
.nq-kind.is-on svg {
opacity: 1;
}
.nq-kind-name {
white-space: nowrap;
}
/* ---------- 表单 ---------- */
.nq-input {
width: 100%;
box-sizing: border-box;
height: 36px;
padding: 0 10px;
border: 1px solid #e2e5e9;
border-radius: 8px;
background: #fff;
color: inherit;
font-size: 14px;
outline: none;
transition: border-color .15s, box-shadow .15s;
}
.nq-input:focus {
border-color: var(--nq-ui-accent, #467b96);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--nq-ui-accent, #467b96) 16%, transparent);
}
.nq-idline {
display: flex;
align-items: center;
gap: 10px;
}
/* ID 是短数字,给一窄条就够;不带数字输入框的步进按钮,宽度也就不会跳动 */
.nq-idline .nq-input {
flex: 0 0 180px;
width: 180px;
}
/* 外部链接填的是网址,得给足宽度 */
.nq-idline .nq-input.is-url {
flex: 1 1 auto;
width: auto;
min-width: 0;
}
/* ID 那一行现在承载类型名 + 短码,比普通标签重要一点 */
.nq-label.nq-idlabel {
margin-bottom: 7px;
color: #4b5563;
font-size: 13px;
font-weight: 500;
}
.nq-dark .nq-label.nq-idlabel {
color: #cbd5e1;
}
.nq-idline .nq-btn {
flex: 0 0 auto;
height: 36px;
padding: 0 14px;
}
/* ---------- 已选引用 ---------- */
.nq-picked {
display: flex;
flex-direction: column;
gap: 6px;
max-height: 176px;
padding: 8px;
border: 1px dashed #e2e5e9;
border-radius: 8px;
background: #fafbfc;
overflow-y: auto;
}
.nq-chip {
display: flex;
align-items: center;
gap: 7px;
padding: 5px 8px;
border: 1px solid #e2e5e9;
border-radius: 7px;
background: #fff;
font-size: 13px;
cursor: pointer;
}
.nq-chip:hover {
border-color: #c8ced6;
}
.nq-chip.is-on {
border-color: var(--nq-ui-accent, #467b96);
box-shadow: inset 0 0 0 1px var(--nq-ui-accent, #467b96);
}
.nq-chip-badge {
flex: 0 0 auto;
padding: 0 5px;
border-radius: 4px;
background: #f1f3f5;
color: #6b7280;
font-size: 11px;
line-height: 18px;
}
.nq-chip-title {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.nq-chip-id {
flex: 0 0 auto;
color: #9aa3ad;
font-family: Consolas, Monaco, monospace;
font-size: 11px;
}
.nq-chip-x {
flex: 0 0 auto;
padding: 0 2px;
border: 0;
border-radius: 4px;
background: transparent;
color: #9aa3ad;
font-size: 16px;
line-height: 1;
cursor: pointer;
}
.nq-chip-x:hover {
background: #fdecea;
color: #d9534f;
}
.nq-chip.nq-flash {
animation: nq-flash .7s;
}
@keyframes nq-flash {
0%, 100% {
background: #fff;
}
30% {
background: #fff0ee;
}
}
.nq-shortcode {
color: #9aa3ad;
font-family: Consolas, Monaco, monospace;
font-size: 12px;
}
.nq-hint {
margin: 6px 0 0;
color: #9aa3ad;
font-size: 12px;
}
/* ---------- 搜索结果 ---------- */
.nq-results {
max-height: min(340px, 46vh);
margin-top: 6px;
overflow-y: auto;
overscroll-behavior: contain;
}
/* 结果多时列表自己滚,滚动条收细一点,别把标题挤窄 */
.nq-results::-webkit-scrollbar {
width: 8px;
}
.nq-results::-webkit-scrollbar-thumb {
border-radius: 8px;
background: rgba(15, 23, 42, .18);
}
.nq-results::-webkit-scrollbar-track {
background: transparent;
}
.nq-dark .nq-results::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, .18);
}
.nq-results:empty {
display: none;
}
.nq-result {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
width: 100%;
padding: 8px 10px;
border: 0;
border-radius: 8px;
background: transparent;
color: inherit;
font-size: 13px;
text-align: left;
cursor: pointer;
}
.nq-result:hover {
background: #f4f6f8;
}
.nq-result-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* 右侧:日期 + 类型,一行摆开,行高不因日期而变 */
.nq-result-meta {
display: flex;
flex: 0 0 auto;
align-items: center;
gap: 8px;
}
.nq-result-date {
color: #9aa3ad;
font-size: 11px;
font-variant-numeric: tabular-nums;
}
.nq-result-extra {
flex: 0 0 auto;
color: #9aa3ad;
font-size: 12px;
}
.nq-empty {
margin: 0;
padding: 6px 2px;
color: #9aa3ad;
font-size: 12px;
}
/* ---------- 预览:已选几条就预览几条 ---------- */
.nq-preview-hint {
margin-left: 8px;
color: #9aa3ad;
font-size: 11px;
}
.nq-preview-list {
display: flex;
flex-direction: column;
gap: 10px;
max-height: calc(100vh - 300px);
padding-right: 2px;
overflow-y: auto;
}
.nq-preview-item {
padding: 8px 8px 6px;
border: 1px solid #e2e5e9;
border-radius: 8px;
background: #fafbfc;
transition: border-color .15s, box-shadow .15s, background .15s;
}
.nq-preview-item.is-draft {
border-style: dashed;
}
.nq-preview-item.is-on {
border-color: var(--nq-ui-accent, #467b96);
background: #fff;
box-shadow: 0 0 0 2px color-mix(in srgb, var(--nq-ui-accent, #467b96) 16%, transparent);
}
.nq-preview-cap {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
margin-bottom: 6px;
color: #6b7280;
font-size: 12px;
}
.nq-preview-no {
flex: 0 0 auto;
width: 16px;
height: 16px;
border-radius: 50%;
background: #eef1f4;
color: #6b7280;
font-size: 11px;
line-height: 16px;
text-align: center;
font-variant-numeric: tabular-nums;
}
.nq-preview-item.is-on .nq-preview-no {
background: var(--nq-ui-accent, #467b96);
color: #fff;
}
.nq-preview-badge {
flex: 0 0 auto;
padding: 0 5px;
border-radius: 4px;
background: rgba(127, 127, 127, .12);
font-size: 11px;
line-height: 16px;
}
.nq-preview-title {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
color: #4b5563;
white-space: nowrap;
text-overflow: ellipsis;
}
/* 通用预览框(「修改引用」弹窗里的单个预览就是它) */
.nq-preview {
min-height: 120px;
padding: 10px 10px 12px;
border: 1px dashed #e2e5e9;
border-radius: 8px;
background: #fafbfc;
}
/* 单条预览块自身不带边框和底色,交给外层的 .nq-preview-item */
.nq-preview-item .nq-preview {
min-height: 0;
padding: 0;
border: 0;
border-radius: 0;
background: transparent;
}
.nq-preview iframe {
display: block;
width: 100%;
height: 96px;
border: 0;
background: transparent;
}
.nq-preview-empty {
margin: 0;
padding: 16px 12px;
border: 1px dashed #e2e5e9;
border-radius: 8px;
color: #9aa3ad;
font-size: 12px;
line-height: 1.7;
text-align: center;
}
.nq-preview-list:not(:empty) + .nq-preview-empty {
display: none;
}
/* ---------- 底部按钮 ---------- */
.nq-modal-foot {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 12px 18px;
border-top: 1px solid #eef0f2;
background: #fafbfc;
}
.nq-foot-link {
margin-right: auto;
align-self: center;
color: #9aa3ad;
font-size: 12px;
text-decoration: none;
}
.nq-foot-link:hover {
color: var(--nq-ui-accent, #467b96);
text-decoration: underline;
}
.nq-btn {
height: 34px;
padding: 0 16px;
border: 1px solid #e2e5e9;
border-radius: 8px;
background: #fff;
color: #4b5563;
font-size: 14px;
cursor: pointer;
}
.nq-btn:hover {
border-color: #c8ced6;
}
.nq-btn.nq-primary {
border-color: var(--nq-ui-accent, #467b96);
background: var(--nq-ui-accent, #467b96);
color: #fff;
}
.nq-btn.nq-primary:hover {
filter: brightness(.94);
}
.nq-btn.is-idle {
opacity: .6;
}
.nq-shake {
animation: nq-shake .4s;
border-color: #d9534f !important;
}
@keyframes nq-shake {
0%, 100% {
transform: translateX(0);
}
20%, 60% {
transform: translateX(-4px);
}
40%, 80% {
transform: translateX(4px);
}
}
/* ---------- 深色:NewAdmin 的 .dark 优先,其次跟随系统 ---------- */
.nq-mask.nq-dark {
background: rgba(0, 0, 0, .6);
}
.nq-dark .nq-modal {
background: #1f2937;
color: #e5e7eb;
box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.nq-dark .nq-modal-head,
.nq-dark .nq-modal-foot {
border-color: rgba(255, 255, 255, .08);
background: #1a2432;
}
.nq-dark .nq-label,
.nq-dark .nq-hint,
.nq-dark .nq-shortcode,
.nq-dark .nq-result-date,
.nq-dark .nq-result-extra,
.nq-dark .nq-empty,
.nq-dark .nq-foot-link {
color: #94a3b8;
}
.nq-dark .nq-x {
color: #94a3b8;
}
.nq-dark .nq-x:hover {
color: #f1f5f9;
background: rgba(255, 255, 255, .08);
}
.nq-dark .nq-kind,
.nq-dark .nq-input,
.nq-dark .nq-btn {
border-color: rgba(255, 255, 255, .12);
background: #263244;
color: #e5e7eb;
}
.nq-dark .nq-kind:hover {
border-color: rgba(255, 255, 255, .24);
color: #fff;
}
.nq-dark .nq-kind.is-on {
border-color: var(--nq-ui-accent, #6aa9c4);
background: #24384a;
background: color-mix(in srgb, var(--nq-ui-accent, #6aa9c4) 26%, #1f2937);
color: #fff;
}
.nq-dark .nq-result:hover {
background: rgba(255, 255, 255, .06);
}
.nq-dark .nq-picked {
border-color: rgba(255, 255, 255, .12);
background: #18212e;
}
.nq-dark .nq-chip {
border-color: rgba(255, 255, 255, .12);
background: #263244;
}
.nq-dark .nq-chip:hover {
border-color: rgba(255, 255, 255, .24);
}
.nq-dark .nq-chip.is-on {
border-color: var(--nq-ui-accent, #6aa9c4);
box-shadow: inset 0 0 0 1px var(--nq-ui-accent, #6aa9c4);
}
.nq-dark .nq-chip-badge {
background: rgba(255, 255, 255, .1);
color: #94a3b8;
}
.nq-dark .nq-chip-id {
color: #94a3b8;
}
.nq-dark .nq-chip-x:hover {
background: rgba(217, 83, 79, .18);
color: #ffb3ae;
}
.nq-dark .nq-chip.nq-flash {
animation: nq-flash-dark .7s;
}
@keyframes nq-flash-dark {
0%, 100% {
background: #263244;
}
30% {
background: #3a2b2a;
}
}
.nq-dark .nq-preview {
border-color: rgba(255, 255, 255, .12);
background: #18212e;
}
.nq-dark .nq-preview-hint,
.nq-dark .nq-preview-empty {
color: #94a3b8;
}
.nq-dark .nq-preview-empty {
border-color: rgba(255, 255, 255, .12);
}
.nq-dark .nq-preview-item {
border-color: rgba(255, 255, 255, .12);
background: #18212e;
}
.nq-dark .nq-preview-item.is-on {
border-color: var(--nq-ui-accent, #6aa9c4);
background: #1e2a3a;
box-shadow: 0 0 0 2px color-mix(in srgb, var(--nq-ui-accent, #6aa9c4) 22%, transparent);
}
.nq-dark .nq-preview-no {
background: rgba(255, 255, 255, .12);
color: #94a3b8;
}
.nq-dark .nq-preview-item.is-on .nq-preview-no {
background: var(--nq-ui-accent, #6aa9c4);
color: #fff;
}
.nq-dark .nq-preview-badge {
background: rgba(255, 255, 255, .1);
color: #94a3b8;
}
.nq-dark .nq-preview-title {
color: #cbd5e1;
}
.nq-dark .nq-btn.nq-primary {
border-color: var(--nq-ui-accent, #467b96);
background: var(--nq-ui-accent, #467b96);
color: #fff;
}
@media (max-width: 780px) {
.nq-modal-body.nq-split {
grid-template-columns: 1fr;
}
.nq-col-side {
position: static;
}
.nq-preview-list {
max-height: none;
}
}
@media (max-width: 520px) {
.nq-kinds {
grid-template-columns: repeat(2, 1fr);
}
.nq-modal-foot {
flex-direction: column-reverse;
}
.nq-btn {
width: 100%;
}
}