/* 站点背景：很淡的冷色渐变，夜间单独压暗，不额外请求图片 */
#web_bg {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(30, 144, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(99, 102, 241, 0.08), transparent 55%),
    linear-gradient(180deg, #f4f7fb 0%, #eef2f8 100%);
}

[data-theme="dark"] #web_bg {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(30, 144, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(99, 102, 241, 0.12), transparent 55%),
    linear-gradient(180deg, #16181d 0%, #101216 100%);
}

/* 首页文章卡片：鼠标经过时一道高光扫过封面 */
#recent-posts > .recent-post-item > .post_cover {
  position: relative;
  overflow: hidden;
}

#recent-posts > .recent-post-item > .post_cover::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

#recent-posts > .recent-post-item:hover > .post_cover::after {
  animation: post-shine 0.9s ease;
}

@keyframes post-shine {
  to {
    left: 130%;
  }
}

/* 代码块换行：主题自带的 code_word_wrap 在开启行号时不生效，这里单独处理。
   行号列保持 nowrap，只有代码列折行，避免行号和代码错位。 */
figure.highlight td.code,
div.highlight td.code {
  white-space: pre-wrap;
  word-break: break-all;
}

figure.highlight td.code .line,
div.highlight td.code .line {
  white-space: pre-wrap;
}

/* 页脚备案号：做成小徽章，和上方彩色徽标统一 */
#footer-bar .beian-record {
  margin-top: 6px;
}

#footer-bar .beian-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--anzhiyu-card-border);
  border-radius: 999px;
  background: var(--anzhiyu-card-bg);
  font-size: 12px;
  line-height: 1.6;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

#footer-bar .beian-badge:hover {
  border-color: var(--anzhiyu-main);
  color: var(--anzhiyu-main);
}

#footer-bar .beian-badge-icon {
  width: 14px;
  height: 14px;
  flex: none;
}

/* 右下角昼夜切换：太阳 / 月亮带旋转过渡，替换原来的半圆图标 */
button#darkmode {
  position: relative;
  overflow: hidden;
}

button#darkmode .anzhiyu-icon-circle-half-stroke {
  display: none;
}

button#darkmode::before {
  content: "☀";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

[data-theme="dark"] button#darkmode::before {
  content: "☾";
  transform: rotate(-360deg);
}

/* 统计页 */
.stats-page {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stats-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--anzhiyu-card-bg);
  border: 1px solid var(--anzhiyu-card-border);
  text-align: center;
}

.stats-card .num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--anzhiyu-main);
  font-family: "Noto Serif SC", serif;
}

.stats-card .label {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.7;
}

.stats-block {
  padding: 8px 4px;
}

.stats-block h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.stats-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-tags a {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--anzhiyu-secondbg);
  font-size: 13px;
}

/* 卡片毛玻璃：只透出已有的淡色背景，不另加背景图 */
.cardHover,
#footer,
#footer-bar {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

[data-theme="dark"] .cardHover,
[data-theme="dark"] #footer,
[data-theme="dark"] #footer-bar {
  background: rgba(29, 30, 34, 0.72);
}

#page-header.nav-fixed #nav {
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

[data-theme="dark"] #page-header.nav-fixed #nav {
  background: rgba(22, 24, 29, 0.8);
}

/* 自定义光标。类名由 cursor.js 加上，触屏不加载脚本，系统光标保持不变 */
html.cursor-on,
html.cursor-on * {
  cursor: none !important;
}

html.cursor-on input,
html.cursor-on textarea,
html.cursor-on select,
html.cursor-on [contenteditable="true"] {
  cursor: text !important;
}

#cursor {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--anzhiyu-main);
}

.cursor-ring {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 1.5px solid var(--anzhiyu-main);
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, background 0.2s ease;
}

#cursor.is-hover .cursor-ring {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  background: rgba(30, 144, 255, 0.12);
}

#cursor.is-hidden {
  opacity: 0;
}

.cursor-ripple {
  position: fixed;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1.5px solid var(--anzhiyu-main);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  animation: cursor-ripple 0.5s ease-out forwards;
}

@keyframes cursor-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}
