/* ============================================================
   美化设置面板 + 背景氛围层
   ============================================================ */

/* ---------- 背景层（可调模糊/饱和/对比） ---------- */
#np-bg {
  position: fixed;
  inset: -60px;
  z-index: -2;
  background: url('/images/banner/bg-night.webp') center / cover no-repeat;
  filter: blur(var(--np-bg-blur, 0px)) saturate(var(--np-bg-sat, 104%)) contrast(var(--np-bg-contrast, 103%)) brightness(var(--np-bg-bright, 96%));
  transform: scale(1.04);
  transition: filter .35s ease;
}

#np-bg-mask {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(10, 14, 20, 0) 40%, rgba(10, 14, 20, .45) 100%),
    linear-gradient(180deg, rgba(12, 17, 24, .35), rgba(12, 17, 24, .15) 40%, rgba(12, 17, 24, .5));
}

body {
  background-color: #0f141b !important;
}

/* ---------- 卡片：跟随设置变化 ---------- */
:root {
  --card: rgba(255, 255, 255, var(--np-card-alpha, .82));
}

#recent-posts .recent-post-item,
#aside-content .card-widget,
#pagination .page-number,
#pagination .extend,
.post-copyright,
.card-widget {
  -webkit-backdrop-filter: blur(var(--np-card-blur, 14px)) saturate(140%);
  backdrop-filter: blur(var(--np-card-blur, 14px)) saturate(140%);
}

[data-theme='dark'] {
  --card: rgba(28, 32, 38, var(--np-card-alpha, .82));
}

/* ---------- 右侧齿轮按钮 ---------- */
#np-set-btn {
  width: 35px;
  height: 35px;
  margin-bottom: .5rem;
  border-radius: 8px;
  border: none;
  background: var(--btn-bg, #fff);
  color: var(--font-color, #4c4948);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: transform .25s ease, background .25s ease;
}

#np-set-btn:hover {
  transform: rotate(45deg);
  background: #5b7c99;
  color: #fff;
}

/* ---------- 设置面板 ---------- */
#np-settings {
  position: fixed;
  top: 50%;
  right: 76px;
  transform: translate(12px, -50%) scale(.96);
  width: 330px;
  max-width: calc(100vw - 40px);
  z-index: 100001;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.22, .61, .36, 1);
  border-radius: 16px;
  color: #e7ecf2;
  background: rgba(24, 28, 35, .92);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}

#np-settings.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}

.np-set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px;
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
}

.np-set-head b {
  font-weight: 600;
}

.np-set-close {
  border: none;
  background: transparent;
  color: #9aa4b2;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.np-set-body {
  padding: 16px 18px 20px;
  max-height: 68vh;
  overflow-y: auto;
}

.np-set-row {
  margin-bottom: 18px;
}

.np-set-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #aab4c2;
  margin-bottom: 8px;
}

.np-set-label em {
  font-style: normal;
  color: #7fa6c0;
  font-variant-numeric: tabular-nums;
}

.np-set-row input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .16);
  outline: none;
}

.np-set-row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7fa6c0;
  box-shadow: 0 0 10px rgba(127, 166, 192, .8);
  cursor: pointer;
  transition: transform .2s ease;
}

.np-set-row input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.np-set-presets {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
}

.np-preset {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  color: #cfd8e3;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  cursor: pointer;
  transition: all .2s ease;
}

.np-preset:hover,
.np-preset.active {
  background: rgba(127, 166, 192, .22);
  border-color: rgba(127, 166, 192, .55);
  color: #fff;
}

.np-set-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.np-set-actions button {
  flex: 1;
  padding: 9px;
  font-size: 12.5px;
  color: #cfd8e3;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  cursor: pointer;
  transition: all .2s ease;
}

.np-set-actions button:hover {
  background: rgba(127, 166, 192, .22);
  color: #fff;
}

/* ---------- FPS 小标 ---------- */
#np-fps {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 9993;
  padding: 3px 9px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(231, 236, 242, .8);
  background: rgba(16, 20, 26, .55);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  letter-spacing: .04em;
}

@media screen and (max-width: 768px) {
  #np-settings {
    right: 12px;
    width: calc(100vw - 24px);
  }
  #np-fps {
    display: none;
  }
}

/* ---------- 暗色模式下的补充修正 ---------- */
[data-theme='dark'] #page-header.nav-fixed #nav,
[data-theme='dark'] #nav {
  background: rgba(16, 20, 26, .72) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

[data-theme='dark'] #nav .site-name,
[data-theme='dark'] #nav a {
  color: #e6e8ec !important;
}

[data-theme='dark'] #article-container figure.highlight,
[data-theme='dark'] #article-container pre {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
}

[data-theme='dark'] #article-container table th {
  background: rgba(143, 183, 209, .14);
}

[data-theme='dark'] #pagination .page-number,
[data-theme='dark'] #pagination .extend {
  color: #d7dde5;
}
