/* ==============================================
 * Jx Blog - Anime Video Background Style
 * ============================================== */

/* === 视频背景层 === */
#bg-video {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  object-fit: cover;
}
#web_bg { display: none; }

/* 暗色蒙版 - 保证文字可读 */
#body-wrap {
  position: relative; z-index: 2;
}
#body-wrap::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(6,10,18,0.35);
}

/* === 全局 === */
body {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  background: #060a12;
  color: #c8d2dc;
}
code, pre { font-family: 'JetBrains Mono', 'Consolas', monospace; }

/* === 导航栏 === */
#nav {
  background: rgba(8,12,22,0.72) !important;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  height: 56px;
}
#nav #site-name {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.5rem; color: #e2e8f0;
}
#nav .menus_items .menus_item a {
  font-size: 0.85rem; font-weight: 500; color: #94a3b8;
  padding: 0.3rem 0.7rem; border-radius: 6px;
  transition: all 0.25s;
}
#nav .menus_items .menus_item a:hover {
  color: #e2e8f0; background: rgba(255,255,255,0.05);
}

/* === 进度条 === */
#nav::after {
  content: ''; position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8, #10b981);
  z-index: 101; width: var(--scroll, 0%); transition: width 0.08s linear;
}

/* === 页面头部 === */
#page-header { background: transparent !important; }
#page-header::before { display: none; }

/* 首页标题 */
#page-header #site-info {
  background: rgba(8,12,22,0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 10px; padding: 1.2rem 2rem;
  display: flex !important; flex-direction: column; align-items: center;
}
#page-header #site-info #site-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 2.4rem; font-weight: 700; color: #f1f5f9;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
#page-header #site-info #site-subtitle {
  font-size: 0.9rem; color: #94a3b8; margin-top: 0.3rem;
}

/* 文章页标题 */
#page-header #post-info {
  background: rgba(8,12,22,0.7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 10px; padding: 1.3rem 1.8rem;
}
#post-info #post-title {
  font-size: 1.5rem; font-weight: 700; color: #f1f5f9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#post-info #post-meta { color: #94a3b8; }

/* === 主体 === */
#content-inner { padding-top: 1.5rem; max-width: 1100px; }
#recent-posts { display: flex; flex-direction: column; gap: 1.5rem; }

/* === 卡片基础 === */
.card-widget,
.recent-post-item,
#post, #page {
  background: rgba(12,18,30,0.55) !important;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  overflow: hidden;
}
.card-widget:hover,
.recent-post-item:hover {
  border-color: rgba(14,165,233,0.12) !important;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(14,165,233,0.06);
  transform: translateY(-1px);
}

/* === 首页文章列表 === */
.recent-post-item {
  margin-bottom: 0.9rem;
  padding: 0;
  display: flex; flex-direction: column;
  min-height: 280px;
}
/* 封面放上面 */
.recent-post-item .post-cover,
.recent-post-item .post_cover {
  width: 100%; height: 170px;
  border-radius: 10px 10px 0 0; overflow: hidden;
  position: relative; flex-shrink: 0;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 196, 170, 0.34), transparent 30%),
    linear-gradient(135deg, #1b1324, #251a2a 42%, #0d1628);
  background-size: 300% 300%;
  animation: coverShimmer 6s ease-in-out infinite;
}
@keyframes coverShimmer {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.recent-post-item .post-cover img,
.recent-post-item .post_cover img,
.recent-post-item .post-bg {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05) contrast(0.96) brightness(0.92);
  transition: transform 0.5s, filter 0.5s;
  position: relative; z-index: 1;
}
#recent-posts .recent-post-item .post_cover a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}
#recent-posts .recent-post-item .post_cover .post-bg {
  display: block;
  position: relative !important;
  z-index: 1 !important;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-post-item:hover .post-cover img,
.recent-post-item:hover .post_cover img,
.recent-post-item:hover .post-bg {
  filter: saturate(1.12) contrast(1) brightness(0.96);
  transform: scale(1.06);
}
.recent-post-item .post-cover::after,
.recent-post-item .post_cover::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 205, 184, 0.22), transparent 35%),
    linear-gradient(180deg, rgba(255, 176, 154, 0.12), transparent 38%, rgba(7, 8, 15, 0.68)),
    linear-gradient(90deg, rgba(255, 128, 150, 0.12), rgba(80, 184, 255, 0.08));
}
/* 封面流光 */
.recent-post-item .post-cover::before,
.recent-post-item .post_cover::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 226, 210, 0.08) 45%, rgba(255, 241, 225, 0.14) 50%, rgba(255, 226, 210, 0.08) 55%, transparent 60%);
  background-size: 200% 100%;
  animation: coverSweep 4s ease-in-out infinite;
}
@keyframes coverSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* 标题信息放封面下面 */
.recent-post-item .recent-post-info {
  background: transparent !important; border: none !important;
  padding: 1rem 1.3rem; flex: 1;
  display: flex; flex-direction: column; justify-content: center;
}
.recent-post-item .recent-post-info a.article-title {
  font-size: 1.05rem; font-weight: 600; color: #e2e8f0;
  display: block; line-height: 1.4;
}
.recent-post-item:hover .recent-post-info a.article-title { color: #38bdf8; }
.recent-post-item .article-meta-wrap {
  font-size: 0.75rem; color: #64748b; margin-top: 0.4rem;
}
.recent-post-item .article-meta-wrap i { color: #0ea5e9; margin-right: 0.2rem; }
.recent-post-item .article-meta-wrap span { margin-right: 0.7rem; }

/* === 侧边栏 === */
#aside-content .card-widget {
  margin-bottom: 0.8rem; padding: 0.9rem 1.1rem;
  background: rgba(12,18,30,0.65) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#aside-content .card-widget .card-title {
  font-size: 0.8rem; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.7rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
#card-author .author-info__name { font-size: 1.1rem; font-weight: 700; color: #e2e8f0; }
#card-author .author-info__description { font-size: 0.73rem; color: #64748b; line-height: 1.5; }

/* === 标签 === */
.tag-cloud-list a {
  font-size: 0.66rem !important; font-weight: 500;
  color: #38bdf8 !important;
  background: rgba(14,165,233,0.07) !important;
  border: 1px solid rgba(14,165,233,0.1) !important;
  border-radius: 4px !important; padding: 0.12rem 0.5rem !important;
  transition: all 0.25s;
}
.tag-cloud-list a:hover {
  background: rgba(14,165,233,0.15) !important;
  border-color: rgba(14,165,233,0.25) !important;
  color: #7dd3fc !important;
}

/* ==== 文章内容页（几乎不透，保护阅读） ==== */
#post, #page {
  padding: 2rem 2.2rem;
  background: rgba(8,12,20,0.94) !important;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
#article-container {
  color: #b0bac8; line-height: 1.9; font-size: 0.95rem;
}
#article-container h1 {
  font-size: 1.5rem; font-weight: 700; color: #f1f5f9; margin: 1.5rem 0 0.8rem;
}
#article-container h2 {
  font-size: 1.25rem; font-weight: 700; color: #f1f5f9;
  margin: 2rem 0 0.7rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#article-container h3 {
  font-size: 1.08rem; font-weight: 600; color: #e8edf3;
  margin: 1.5rem 0 0.5rem;
}
#article-container h4 { font-size: 1rem; font-weight: 600; color: #e2e8f0; }
#article-container a {
  color: #38bdf8; text-decoration: none;
  border-bottom: 1px solid rgba(14,165,233,0.2);
  transition: all 0.2s;
}
#article-container a:hover { color: #7dd3fc; border-bottom-color: #38bdf8; }
#article-container img {
  border-radius: 8px; margin: 1rem auto; display: block; max-width: 100%;
}
#article-container blockquote {
  border-left: 3px solid #0ea5e9;
  padding: 0.6rem 1.2rem; margin: 1rem 0;
  background: rgba(14,165,233,0.04);
  border-radius: 0 6px 6px 0;
  color: #8896a8; font-size: 0.9rem;
}
#article-container ul { list-style: none; padding-left: 0; }
#article-container ul li {
  position: relative; padding-left: 1.2rem; margin: 0.3rem 0;
}
#article-container ul li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 5px; height: 5px; background: #0ea5e9;
  border-radius: 50%; opacity: 0.6;
}
#article-container ol li::marker { color: #0ea5e9; font-weight: 600; }
#article-container hr {
  margin: 2rem 0; border: none; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
#article-container table {
  width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.88rem;
}
#article-container table th {
  background: rgba(14,165,233,0.1); color: #e2e8f0;
  font-weight: 600; padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.06);
}
#article-container table td {
  padding: 0.4rem 0.8rem; border: 1px solid rgba(255,255,255,0.04);
}

/* === 代码块 === */
figure.highlight {
  border-radius: 8px !important; overflow: hidden;
  margin: 1rem 0; box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
#article-container pre {
  background: #060b18 !important; border: none !important; font-size: 0.85rem;
}

/* === 页脚 === */
#footer {
  background: rgba(8,12,20,0.65) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 1.2rem 0; margin-top: 2rem;
}
#footer-wrap { color: #556070; font-size: 0.8rem; }
#footer-wrap a { color: #64748b; }
#footer-wrap a:hover { color: #38bdf8; }

/* === 滚动条 === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2a3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2d3d52; }
::selection { background: rgba(14,165,233,0.22); color: #e2e8f0; }

/* === 右侧按钮 === */
#rightside > div > button,
#rightside > div > a {
  background: rgba(15,22,38,0.75) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 8px !important;
  color: #94a3b8 !important;
}
#rightside > div > button:hover,
#rightside > div > a:hover {
  background: rgba(14,165,233,0.15) !important;
  color: #e2e8f0 !important;
}

/* === 搜索弹窗 === */
#local-search .search-dialog {
  background: rgba(15,22,38,0.95) !important;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

/* === 分页 === */
#pagination .page-number {
  background: rgba(15,22,38,0.7); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px; color: #94a3b8; padding: 0.3rem 0.7rem;
  margin: 0 0.15rem; transition: all 0.25s;
}
#pagination .page-number.current {
  background: rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.3);
  color: #38bdf8;
}
#pagination .page-number:hover { background: rgba(14,165,233,0.1); color: #e2e8f0; }

/* === 动漫立绘 === */
#anime-chara {
  position: fixed; bottom: 0; right: 0; z-index: 10; pointer-events: none;
  width: 180px; height: 340px; overflow: hidden; opacity: 0.55;
  display: none;
}
#anime-chara img {
  width: 100%; height: 100%; object-fit: contain; object-position: bottom right;
  animation: charaBreathe 5s ease-in-out infinite;
}
@keyframes charaBreathe {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.015); }
}

/* === 全屏樱花 === */
.sakura-fall {
  position: fixed; pointer-events: none; z-index: 1000; user-select: none;
  animation: sakuraWave var(--dur, 18s) var(--delay, 0s) var(--easing, cubic-bezier(0.4,0,0.6,1)) infinite;
  opacity: 0;
}
.sakura-fall.near { width: 20px; height: 24px; }
.sakura-fall.mid  { width: 13px; height: 16px; }
.sakura-fall.far  { width: 7px; height: 9px; filter: blur(1px); }
.sakura-fall::before {
  content: ''; display: block; width: 100%; height: 100%;
  background: var(--petal-svg) no-repeat center/contain;
  opacity: var(--petal-opacity, 0.5);
  transform: rotate(var(--petal-rotate, 0deg));
}
@keyframes sakuraWave {
  0%   { transform: translate(0, -30px) rotate(0deg); opacity: 0; }
  3%   { opacity: var(--peak-opacity, 0.5); }
  20%  { transform: translate(calc(var(--swing, 40px) * 0.4), 20vh) rotate(60deg); }
  40%  { transform: translate(calc(var(--swing, 40px) * -0.3), 40vh) rotate(140deg); }
  60%  { transform: translate(calc(var(--swing, 40px) * 0.5), 60vh) rotate(220deg); }
  80%  { transform: translate(calc(var(--swing, 40px) * -0.2), 80vh) rotate(300deg); opacity: calc(var(--peak-opacity, 0.5) * 0.7); }
  100% { transform: translate(calc(var(--swing, 40px) * 0.1), 110vh) rotate(360deg); opacity: 0; }
}

/* === 点击樱花 === */
.click-petal {
  position: fixed; pointer-events: none; z-index: 10000;
  font-weight: bold; animation: petalUp 1s ease-out forwards; user-select: none;
}
@keyframes petalUp {
  0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-90px) scale(0.2) rotate(30deg); }
}

/* === Glitch === */
.page-title:hover, .post-title:hover { animation: glitch 0.3s ease; }
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px,2px); }
  40% { transform: translate(-2px,-2px); }
  60% { transform: translate(2px,2px); }
  80% { transform: translate(2px,-2px); }
  100% { transform: translate(0); }
}

/* === 响应式 === */
@media (max-width: 768px) {
  #anime-chara { width: 100px; height: 200px; opacity: 0.3; }
  #aside-content { display: none; }
  .recent-post-item { flex-direction: column; padding: 0.8rem; }
  .recent-post-item .post-cover,
  .recent-post-item .post_cover { width: 100%; height: 150px; }
  #content-inner { padding: 0.5rem; }
  #post, #page { padding: 1rem; }
}
