/* ========================================
   萌主题 main.css — 浅色模式基准
   ======================================== */

/* ── CSS 变量 ── */
:root {
  --c-bg:          #f5f6fa;
  /* --surface-alpha 由后台注入（0~1），默认 1 = 完全不透明 */
  --surface-alpha:   1;
  --c-surface:     rgba(255,255,255,var(--surface-alpha));
  --c-surface-s:   rgba(255,255,255,var(--surface-alpha));
  --c-surface-rgb: 255,255,255;
  --c-border:      rgba(0,0,0,0.08);
  --c-text:        #2c2c3a;
  --c-text-2:      #6b6b80;
  --c-text-3:      #9999aa;
  --c-primary:     #5eb3d9;
  --c-primary-h:   #3d97c2;
  --c-accent:      #b8e2f0;
  --c-danger:      #e05c5c;
  --c-warn:        #e0a050;
  --c-success:     #5cb85c;
  --c-info:        #5ba3e0;
  --radius:        12px;
  --radius-s:      8px;
  --shadow:        0 2px 16px rgba(0,0,0,0.08);
  --shadow-h:      0 6px 28px rgba(0,0,0,0.14);
  --trans:         0.22s ease;
  --header-h:      58px;
  --blur:          blur(18px) saturate(1.4);
}

[data-theme="dark"] { /* 深色变量由 dark.css 注入 */ }

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* 不要在 html 上全局 scroll-behavior:smooth — 它会让"浏览器刷新时恢复滚动位置"
   也变成平滑动画，造成"刷新后滚动条自己往下滑一点"的错觉。
   需要平滑滚动的场景（回到顶部按钮）通过 JS window.scrollTo({behavior:'smooth'}) 单独处理。 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.75;
  color: var(--c-text); background: var(--c-bg);
  min-height: 100vh;
}
a { color: var(--c-primary); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--c-primary-h); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ── 无障碍：键盘聚焦可视化（不影响鼠标 click，:focus-visible 只对键盘触发） ── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.moe-action-btn:focus-visible,
.moe-btn:focus-visible,
.moe-tag-link:focus-visible,
.moe-cat-badge:focus-visible,
.moe-meta-cat:focus-visible,
.moe-pagination .page-numbers:focus-visible {
  outline-offset: 3px;
}

/* ── 背景图 ── */
.moe-bg {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center; background-attachment: fixed;
  transition: background-image 0.4s;
}
.moe-bg::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(245,246,250,calc(var(--home-bg-mask, 60) / 100));
}
[data-theme="dark"] .moe-bg::after { background: rgba(15,26,36,calc(var(--home-bg-mask, 60) / 100)); }

/* ── 文章页顶部阅读进度条 ── */
.moe-reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 200;
  background: transparent;
  pointer-events: none;
}
.moe-reading-progress__bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--c-primary-h), var(--c-primary), var(--c-accent));
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(94,179,217,0.5);
}

/* ── Header ── */
.moe-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--c-surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.moe-header__inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px; height: 100%;
  display: flex; align-items: center; gap: 16px;
}
.moe-logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--c-text); font-size: 24px;
  flex-shrink: 0; text-decoration: none;
}
.moe-logo__img { height: 32px; width: auto; }
.moe-logo__text {
  font-family: 'ZCOOL QingKe HuangYou', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-weight: 400; letter-spacing: 2px; font-size: 26px;
  /* 浅冰蓝三段流光渐变，奶油柔光感 */
  background: linear-gradient(90deg, #7bc5e3 0%, #c2e4f2 35%, #a8d8f0 65%, #7bc5e3 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  color: transparent;
  animation: moe-logo-flow 6s linear infinite;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  filter: drop-shadow(0 1px 2px rgba(123,197,227,0.25));
}
.moe-logo:hover .moe-logo__text {
  transform: scale(1.05) translateY(-1px);
}
@keyframes moe-logo-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .moe-logo__text { animation: none; }
}
[data-theme="dark"] .moe-logo__text {
  background: linear-gradient(90deg, #a8d8f0 0%, #e8f5fb 35%, #c2e4f2 65%, #a8d8f0 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 6px rgba(168,216,240,0.35));
}

/* ── 主导航 ── */
.moe-nav { flex: 1; overflow: hidden; }
.moe-nav__brand { display: none; }
.moe-nav__brand-link { display: flex; align-items: center; gap: 8px; color: var(--c-text); font-weight: 700; font-size: 18px; text-decoration: none; }
.moe-nav__list { list-style: none; display: flex; align-items: center; gap: 2px; }
.moe-nav__list li { position: relative; }
.moe-nav__list a {
  display: block; padding: 6px 12px; border-radius: var(--radius-s);
  color: var(--c-text-2); font-size: 14px; transition: all var(--trans);
}
.moe-nav__list a:hover, .moe-nav__list .current-menu-item > a {
  color: var(--c-primary); background: rgba(94,179,217,0.1);
}
/* 二级菜单 */
.moe-nav__list .sub-menu {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 130px; background: var(--c-surface-s);
  border-radius: var(--radius-s); border: 1px solid var(--c-border);
  box-shadow: var(--shadow); padding: 6px;
  backdrop-filter: var(--blur);
}
.moe-nav__list li:hover > .sub-menu { display: block; }
.moe-nav__list .sub-menu a { border-radius: 6px; }

/* ── 右侧工具栏 ── */
.moe-header__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.moe-header__action {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px; border-radius: var(--radius-s);
  color: var(--c-text-2); transition: all var(--trans); font-size: 14px;
}
.moe-header__action:hover { color: var(--c-primary); background: rgba(94,179,217,0.1); }
.moe-login-btn { color: var(--c-primary); border: 1px solid var(--c-primary); padding: 5px 12px; }
.moe-hamburger { display: none; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--radius-s); }
.moe-hamburger span { display: block; width: 18px; height: 2px; background: var(--c-text-2); border-radius: 2px; transition: all var(--trans); }

/* ── 搜索栏 ── */
.moe-search-bar {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: var(--c-surface-s); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--c-border); padding: 12px 20px;
}
.moe-search-bar form { max-width: 600px; margin: 0 auto; display: flex; gap: 8px; }
.moe-search-bar input {
  flex: 1; padding: 10px 16px; border-radius: 100px;
  border: 1px solid var(--c-border); background: var(--c-bg);
  color: var(--c-text); font-size: 14px; outline: none;
  transition: border-color var(--trans);
}
.moe-search-bar input:focus { border-color: var(--c-primary); }
.moe-search-bar button {
  padding: 10px 20px; border-radius: 100px;
  background: var(--c-primary); color: #fff; font-size: 14px;
}
.moe-search-bar button:hover { background: var(--c-primary-h); }

/* ── 设置面板 ── */
.moe-settings-panel {
  position: fixed; top: var(--header-h); right: 16px; z-index: 99;
  width: 240px; background: var(--c-surface-s);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow-h); padding: 16px;
}
.moe-settings-panel h3 { font-size: 14px; color: var(--c-text-2); margin-bottom: 14px; }
.moe-settings-section { margin-bottom: 14px; }
.moe-settings-label { font-size: 13px; color: var(--c-text-2); display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.moe-settings-row { display: flex; align-items: center; justify-content: space-between; }
.moe-settings-row .moe-settings-label { margin-bottom: 0; }
.moe-theme-switcher { display: flex; gap: 6px; }
.moe-theme-btn {
  flex: 1; padding: 6px; border-radius: var(--radius-s);
  font-size: 12px; color: var(--c-text-2);
  border: 1px solid var(--c-border); background: transparent; transition: all var(--trans);
}
.moe-theme-btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.moe-toggle { position: relative; display: inline-block; width: 38px; height: 22px; }
.moe-toggle input { opacity: 0; width: 0; height: 0; }
.moe-toggle span {
  position: absolute; inset: 0; background: var(--c-border);
  border-radius: 100px; transition: all var(--trans); cursor: pointer;
}
.moe-toggle span::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: all var(--trans);
}
.moe-toggle input:checked + span { background: var(--c-primary); }
.moe-toggle input:checked + span::before { transform: translateX(16px); }
.moe-bg-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.moe-bg-item-btn {
  width: 36px; height: 36px; border-radius: 6px;
  border: 2px solid transparent; background: var(--c-border);
  background-size: cover; background-position: center;
  font-size: 11px; transition: border-color var(--trans);
}
.moe-bg-item-btn.active, .moe-bg-item-btn:hover { border-color: var(--c-primary); }
.moe-theme-overlay {
  display: none; position: fixed; inset: 0; z-index: 90;
}
.moe-theme-overlay.active { display: block; }

/* 移动端导航遮罩：默认隐藏，避免在 PC 端阻挡所有点击事件 */
.moe-nav-mask { display: none; }

/* ── 主容器 ── */
.moe-main { min-height: calc(100vh - var(--header-h) - 80px); }
.moe-container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.moe-container--single { padding-top: 30px; }

/* ── 首页布局 ── */
.moe-homepage-body { display: grid; grid-template-columns: 1fr 280px; gap: 24px; margin-top: 24px; }
.moe-content-area { min-width: 0; }

/* ── 轮播图 ── */
/* moe-carousel-section layout moved to extra.css (with sidebar support) */
.moe-carousel {
  border-radius: var(--radius); overflow: hidden;
  position: relative; /* 让子元素 position:absolute 相对于此 */
}
/* 轮播容器：隐藏溢出，仅显示当前 slide */
.moe-carousel .swiper-wrapper {
  display: flex; flex-wrap: nowrap;
  width: 100%; /* 与容器同宽 */
  transition: transform .5s ease;
}
.moe-carousel .swiper-slide {
  flex-shrink: 0;
  width: 100%; /* 每个 slide 与容器等宽 */
  min-width: 100%;
}
.moe-carousel__slide {
  height: 360px; background-size: cover; background-position: center;
  position: relative; display: flex; align-items: flex-end;
  cursor: pointer;
}
.moe-carousel__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%); pointer-events: none; }
.moe-carousel__info { position: relative; z-index: 3; padding: 24px; pointer-events: none; }
.moe-carousel__subtitle { color: rgba(255,255,255,0.7); font-size: 13px; margin-bottom: 6px; }
.moe-carousel__title { color: #fff; font-size: 22px; font-weight: 700; }
/* 链接覆盖层：pointer-events:none 让按钮可正常点击，用 JS 导航 */
.moe-carousel__link { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* 轮播图按钮和圆点（纯 CSS，不依赖 Swiper 库） */
.moe-carousel .swiper-button-prev,
.moe-carousel .swiper-button-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 20; width: 30px; height: 30px;
  background: rgba(0,0,0,0.4); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; color: #fff; font-size: 15px;
  transition: background var(--trans);
  pointer-events: auto;
}
.moe-carousel .swiper-button-prev { left: 6px; }
.moe-carousel .swiper-button-next { right: 6px; }
.moe-carousel .swiper-button-prev::before { content: '‹'; }
.moe-carousel .swiper-button-next::before { content: '›'; }
.moe-carousel .swiper-button-prev:hover,
.moe-carousel .swiper-button-next:hover { background: rgba(0,0,0,0.6); }
.moe-carousel .swiper-pagination {
  position: absolute; bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.moe-carousel .swiper-pagination-bullet {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: background var(--trans), transform var(--trans);
  border: none; padding: 0;
}
.moe-carousel .swiper-pagination-bullet-active {
  background: var(--c-primary); transform: scale(1.3);
}

/* ── 广告位 ── */
.moe-ad-section { margin-bottom: 20px; }
.moe-ad-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; row-gap: 12px; }
.moe-ad-item { position: relative; border-radius: var(--radius-s); overflow: hidden; display: block; }
.moe-ad-item img { width: 100%; height: 90px; object-fit: cover; transition: transform var(--trans); }
.moe-ad-item:hover img { transform: scale(1.03); }
.moe-ad-badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.5); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; z-index: 2; pointer-events: none; }

/* ── 首页进场动画（上滑淡入；IntersectionObserver 由 main.js 控制 .is-visible）── */
/* 缓动用 ease-out-expo (0.16, 1, 0.3, 1)：先快后慢收尾，极顺滑；位移 16px 更轻盈 */
.moe-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.moe-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .moe-reveal { opacity: 1; transform: none; transition: none; }
}

/* ── 分区 ── */
.moe-section { margin-bottom: 32px; }
.moe-section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: nowrap; }
.moe-section__title { font-size: 18px; font-weight: 700; color: var(--c-text); position: relative; padding-left: 12px; }
.moe-section__title::before { content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; background: var(--c-primary); border-radius: 2px; }
.moe-section__desc { font-size: 13px; color: var(--c-text-3); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moe-section__more {
  margin-left: 10px;
  font-size: 13px; color: var(--c-primary); white-space: nowrap; flex-shrink: 0;
  padding: 4px 10px; border-radius: 100px;
  transition: all var(--trans);
}
.moe-section__more:hover { background: rgba(94,179,217,0.12); text-decoration: none; transform: translateX(2px); }

/* ── 文章卡片 ── */
.moe-card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.moe-card {
  background: var(--c-surface); border-radius: var(--radius);
  overflow: hidden; border: none;
  box-shadow: 0 4px 24px rgba(94,179,217,0.06), 0 1px 3px rgba(94,179,217,0.03);
  transition: transform var(--trans), box-shadow var(--trans);
  display: flex; flex-direction: column;
}
.moe-card:hover { 
  box-shadow: 0 12px 32px rgba(94,179,217,0.12), 0 4px 12px rgba(94,179,217,0.06); 
}
.moe-card__thumb-wrap { position: relative; overflow: hidden; aspect-ratio: 16/10; display: block; }
.moe-card__thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s, opacity 0.4s; opacity: 0; }
.moe-card__thumb.loaded { opacity: 1; }
.moe-card:hover .moe-card__thumb { transform: scale(1.04); }

/* 图片加载骨架屏 shimmer（在 .loaded 前显示） */
.moe-card__thumb-wrap { background: linear-gradient(110deg, var(--c-border) 20%, rgba(94,179,217,0.12) 40%, var(--c-border) 60%); background-size: 200% 100%; animation: moe-shimmer 1.4s ease-in-out infinite; }
.moe-card__thumb-wrap:has(.moe-card__thumb.loaded),
.moe-card__thumb-wrap:has(.moe-card__thumb--empty) { animation: none; background: none; }
@keyframes moe-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* 空缩略图：冰蓝渐变 + 居中雪花 ❄ */
.moe-card__thumb--empty {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.moe-card__thumb--empty::after {
  content: '❄';
  font-size: 52px; color: rgba(255,255,255,0.65);
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
  line-height: 1;
}
.moe-card__hover-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.25); opacity: 0; transition: opacity var(--trans); pointer-events: none; z-index: 10; }
.moe-card:hover .moe-card__hover-overlay { opacity: 1; }
.moe-card__body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.moe-card__title { font-size: 14px; font-weight: 600; line-height: 1.45; }
.moe-card__title a { color: var(--c-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.moe-card__title a:hover { color: var(--c-primary); }
.moe-card__meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--c-text-2); margin-top: auto; flex-wrap: wrap; }
.moe-card__meta-item { display: flex; align-items: center; gap: 4px; }
.moe-card__meta-item svg { width: 14px; height: 14px; opacity: 0.85; }

/* ── 侧边栏 ── */
.moe-sidebar { display: flex; flex-direction: column; gap: 16px; }
.moe-widget { 
  background: var(--c-surface); border-radius: var(--radius); border: none; 
  box-shadow: 0 4px 24px rgba(94,179,217,0.06), 0 1px 3px rgba(94,179,217,0.03);
  padding: 16px; 
  transition: transform var(--trans), box-shadow var(--trans);
}
.moe-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(94,179,217,0.1), 0 2px 8px rgba(94,179,217,0.04);
}
.moe-widget__title {
  font-size: 15px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border); color: var(--c-text);
  padding-left: 4px;
}
.moe-widget-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.moe-tags-icon { font-size: 15px; margin-right: 4px; flex-shrink: 0; }
.moe-tag-link { padding: 3px 10px; border-radius: 100px; font-size: 12px; background: rgba(94,179,217,0.22); color: var(--c-primary-h); transition: all var(--trans); display: inline-flex; align-items: center; border: 1px solid rgba(94,179,217,0.18); }
.moe-tag-link:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.moe-widget-adcard img { width: 100%; border-radius: var(--radius-s); transition: opacity var(--trans); }
.moe-widget-adcard:hover img { opacity: 0.9; }
.moe-widget-comments { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.moe-widget-comment__link { font-size: 13px; color: var(--c-text-2); display: block; }
.moe-widget-comment__link:hover { color: var(--c-primary); }
.moe-widget-comment__author { color: var(--c-primary); font-weight: 500; }
.moe-widget-popular { list-style: none; counter-reset: rank; display: flex; flex-direction: column; gap: 8px; }
.moe-widget-popular li { display: flex; align-items: baseline; gap: 8px; counter-increment: rank; font-size: 13px; }
.moe-widget-popular li::before { content: counter(rank); min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--c-border); color: var(--c-text-3); }
.moe-widget-popular li:nth-child(-n+3)::before { background: var(--c-primary); color: #fff; }
.moe-widget-popular a { color: var(--c-text); flex: 1; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.moe-widget-popular__count { font-size: 11px; color: var(--c-text-3); white-space: nowrap; }
.moe-widget-empty { font-size: 13px; color: var(--c-text-3); text-align: center; padding: 10px; }

/* ── 归档页 ── */
.moe-archive-body { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.moe-archive-head { margin-bottom: 20px; }
.moe-archive-head__title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.moe-archive-head__desc { font-size: 14px; color: var(--c-text-2); margin-bottom: 12px; }
.moe-archive-filters { display: flex; gap: 8px; align-items: center; }
.moe-filter-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--c-border); font-size: 13px; color: var(--c-text-2);
  background: var(--c-surface); transition: all var(--trans); text-decoration: none;
}
.moe-filter-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.moe-filter-group { position: relative; }
.moe-filter-dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 4px;
  background: var(--c-surface-s); border: 1px solid var(--c-border);
  border-radius: var(--radius-s); padding: 6px; min-width: 130px;
  box-shadow: var(--shadow); z-index: 10;
}
.moe-filter-dropdown a { display: block; padding: 5px 10px; border-radius: 5px; font-size: 13px; color: var(--c-text-2); }
.moe-filter-dropdown a:hover { background: rgba(94,179,217,0.12); color: var(--c-primary); }
.moe-pagination { list-style: none; display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.moe-pagination .page-numbers { padding: 6px 12px; border-radius: var(--radius-s); border: 1px solid var(--c-border); font-size: 14px; color: var(--c-text-2); background: var(--c-surface); transition: all var(--trans); }
.moe-pagination a.page-numbers:hover { border-color: var(--c-primary); color: var(--c-primary); background: rgba(94,179,217,0.08); transform: translateY(-1px); }
.moe-pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.moe-empty { text-align: center; padding: 40px; color: var(--c-text-3); }

/* ── 文章详情页 ── */
.moe-single-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.moe-single-main { min-width: 0; }
.moe-page-main { min-width: 0; }
.moe-article-bg {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
}
/* 遮罩与首页 .moe-bg::after 同色系，避免视觉割裂（首页浅白、文章页却黑色）*/
.moe-article-bg::after { content: ''; position: absolute; inset: 0; background: rgba(245,246,250,calc(var(--mask) / 100)); }
[data-theme="dark"] .moe-article-bg::after { background: rgba(15,26,36,calc(var(--mask) / 100)); }
.moe-article { background: var(--c-surface); border-radius: var(--radius); padding: 30px; border: 1px solid var(--c-border); }
.moe-article__header { margin-bottom: 24px; }
.moe-article__cats { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.moe-cat-badge { padding: 3px 10px; border-radius: 100px; font-size: 12px; background: rgba(94,179,217,0.14); color: var(--c-primary); }
.moe-article__title { font-size: 24px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; }
.moe-article__meta { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--c-text-3); flex-wrap: wrap; }
.moe-article__meta img { border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 4px; }
.moe-article__content { line-height: 1.85; color: var(--c-text); }
.moe-article__content h2,.moe-article__content h3 { margin: 24px 0 12px; font-weight: 700; }
.moe-article__content p { margin-bottom: 14px; }
.moe-article__content ul,.moe-article__content ol { padding-left: 22px; margin-bottom: 14px; }
.moe-article__content blockquote { border-left: 4px solid var(--c-primary); padding-left: 16px; color: var(--c-text-2); margin: 16px 0; }
.moe-article__content code { background: rgba(94,179,217,0.14); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.moe-article__content pre { background: #0f1a2e; color: #d6e6f2; padding: 16px; border-radius: var(--radius-s); overflow-x: auto; margin: 16px 0; border: 1px solid rgba(94,179,217,0.15); }
.moe-article__content img { border-radius: var(--radius-s); cursor: zoom-in; margin: 12px 0; }
.moe-article__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--c-border); }

/* ── 互动按钮（气泡风）── */
.moe-article__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.moe-action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.moe-action-wrap { position: relative; }
.moe-action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 100px;
  border: 2px solid rgba(94,179,217,0.28);
  color: var(--c-text-2);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
  box-shadow: 0 2px 6px rgba(94,179,217,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  transition: all var(--trans);
  font-size: 12.5px; font-weight: 500;
}
.moe-action-btn:hover {
  border-color: var(--c-primary); color: var(--c-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(94,179,217,0.22), inset 0 1px 0 rgba(255,255,255,1);
}
.moe-action-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(94,179,217,0.15); }
.moe-action-btn.active {
  border-color: var(--c-primary); color: var(--c-primary);
  background: linear-gradient(180deg, #f2f8fb 0%, #e6f2f8 100%);
  box-shadow: 0 3px 10px rgba(94,179,217,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
}
.moe-like-btn.active svg { fill: var(--c-primary); stroke: var(--c-primary); }
.moe-fav-btn.active { border-color: var(--c-danger); color: var(--c-danger); background: linear-gradient(180deg, #fff5f5 0%, #fce8e8 100%); box-shadow: 0 3px 10px rgba(224,92,92,0.18), inset 0 1px 0 rgba(255,255,255,0.9); }
.moe-fav-btn.active svg { fill: var(--c-danger); stroke: var(--c-danger); }
.moe-bubble {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--trans);
}
.moe-action-wrap:hover .moe-bubble { opacity: 1; }
.moe-rating { display: flex; align-items: center; gap: 3px; }
.moe-star { font-size: 22px; color: var(--c-border); transition: color var(--trans); padding: 2px; }
.moe-star.active, .moe-star:hover { color: #f5a623; }
.moe-rating__avg { font-size: 13px; color: var(--c-text-3); margin-left: 6px; }
.moe-rating-wrap { flex-direction: column; align-items: flex-start; gap: 6px; }
.moe-rating-btns { display: flex; gap: 6px; }
.moe-share-popup {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--c-surface-s); border: 1px solid var(--c-border);
  border-radius: var(--radius-s); box-shadow: var(--shadow);
  padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 100px;
}
.moe-share-popup a, .moe-share-popup button {
  font-size: 13px; padding: 5px 10px; border-radius: 5px;
  color: var(--c-text-2); text-align: left;
}
.moe-share-popup a:hover, .moe-share-popup button:hover { background: rgba(94,179,217,0.12); color: var(--c-primary); }
.moe-rating-dist-popup {
  position: relative; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 16px; margin-top: 12px;
}
.moe-rating-dist-popup__close { position: absolute; top: 10px; right: 12px; color: var(--c-text-3); font-size: 16px; }
.moe-related {
  margin-top: 24px; padding: 24px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.moe-related__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }

/* 可视化评分展示 */
.moe-visual-rating {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(245,166,35,0.06), rgba(245,166,35,0.02));
  border: 1px solid rgba(245,166,35,0.15); border-radius: 100px;
}
.moe-visual-rating__stars { display: flex; gap: 1px; align-items: center; }
.moe-vstar { transition: transform 0.15s; }
.moe-vstar:hover { transform: scale(1.15); }
.moe-visual-rating__score {
  font-size: 13px; font-weight: 700; color: #f5a623; line-height: 1;
}
.moe-visual-rating__count {
  font-size: 11px; color: var(--c-text-3);
}
/* 暂无评分时的弱视觉样式 */
.moe-visual-rating--empty {
  background: transparent;
  border-color: rgba(94,179,217,0.18);
}
.moe-visual-rating--empty .moe-vstar--empty polygon { stroke: #9ab5c8; stroke-width: 1.5; }
.moe-visual-rating__score--empty {
  color: var(--c-text-3) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
.moe-card-grid--related { grid-template-columns: repeat(4,1fr); }

/* ── 评论区美化 ── */
.moe-comments { 
  margin-top: 20px; background: var(--c-surface); border-radius: var(--radius); padding: 24px; 
  border: none;
  box-shadow: 0 4px 24px rgba(94,179,217,0.06), 0 1px 3px rgba(94,179,217,0.03);
}
.moe-comments .comments-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--c-border); }
.moe-comments .comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.moe-comments .comment { margin-bottom: 16px; }
.moe-comments .comment-body { 
  background: var(--c-bg); border-radius: var(--radius-s); padding: 14px 16px; 
  border: none;
  box-shadow: 0 2px 12px rgba(94,179,217,0.04);
}
.moe-comments .comment-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.moe-comments .comment-author img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c-border); }
.moe-comments .comment-author .fn { font-weight: 600; font-size: 14px; color: var(--c-text); }
.moe-comments .comment-author a { color: var(--c-text); text-decoration: none; }
.moe-comments .comment-metadata { font-size: 12px; color: var(--c-text-3); }
.moe-comments .comment-metadata a { color: var(--c-text-3); }
.moe-comments .comment-content p { font-size: 14px; line-height: 1.7; color: var(--c-text-2); margin: 0; }
/* Remove old `.moe-comments .comment-reply-link` styles that conflict with `.moe-comment-actions` */
.moe-comments .reply { margin-top: 8px; }
.moe-comments .children { list-style: none; padding-left: 36px; margin-top: 10px; }
.moe-comments #respond { margin-top: 20px; }
.moe-comments .comment-reply-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.moe-comments .comment-reply-title small a { font-size: 12px; color: var(--c-text-3); font-weight: 400; margin-left: 8px; }
.moe-comments .comment-form label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 5px; }
.moe-comments .comment-form input[type="text"],
.moe-comments .comment-form input[type="email"],
.moe-comments .comment-form input[type="url"],
.moe-comments .comment-form textarea {
  width: 100%; padding: 9px 13px; border-radius: var(--radius-s);
  border: 1px solid var(--c-border); background: var(--c-bg); color: var(--c-text);
  font: inherit; font-size: 14px; outline: none; transition: border-color var(--trans);
  box-sizing: border-box;
}
.moe-comments .comment-form input:focus,
.moe-comments .comment-form textarea:focus { border-color: var(--c-primary); }
.moe-comments .comment-form textarea { min-height: 110px; resize: vertical; }
.moe-comments .form-submit input[type="submit"] {
  background: var(--c-primary); color: #fff; border: none; border-radius: var(--radius-s);
  padding: 9px 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity var(--trans);
}
.moe-comments .form-submit input[type="submit"]:hover { opacity: 0.85; }
.moe-comments p.logged-in-as { font-size: 13px; color: var(--c-text-3); margin-bottom: 14px; }
.moe-comments .comment-awaiting-moderation { font-size: 12px; color: var(--c-warn); margin-top: 6px; }

/* ── meta行分类徽章（替代原来头部单独一行的分类） ── */
.moe-meta-cat {
  display: inline-flex; align-items: center; padding: 1px 8px;
  border-radius: 100px; font-size: 11px; font-weight: 500;
  background: rgba(94,179,217,0.22); color: var(--c-primary-h);
  border: 1px solid rgba(94,179,217,0.35); text-decoration: none; transition: all var(--trans);
}
.moe-meta-cat:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ── 短代码样式 ── */
.moe-notice { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--radius-s); margin: 14px 0; border-left: 4px solid; }
.moe-notice--info    { background: rgba(91,163,224,0.1);  border-color: var(--c-info); }
.moe-notice--warn    { background: rgba(224,160,80,0.1);  border-color: var(--c-warn); }
.moe-notice--danger  { background: rgba(224,92,92,0.1);   border-color: var(--c-danger); }
.moe-notice--success { background: rgba(92,184,92,0.1);   border-color: var(--c-success); }
.moe-notice__icon    { font-size: 18px; flex-shrink: 0; }
.moe-notice__body    { flex: 1; }
.moe-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 24px; border-radius: 100px; font-weight: 600; font-size: 14px;
  background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border);
  cursor: pointer; transition: all var(--trans);
  text-decoration: none;
}
.moe-btn:hover { background: var(--c-border); }
.moe-btn--primary {
  background: linear-gradient(135deg, #5eb3d9 0%, #8ed3ed 100%);
  color: #fff; border: none;
  box-shadow: 0 4px 14px rgba(94,179,217,0.3);
}
.moe-btn--primary:hover {
  background: linear-gradient(135deg, #4aa6ce 0%, #7dc9e6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(94,179,217,0.4);
}
.moe-btn:active, .moe-action-btn:active, input[type="submit"]:active { transform: scale(0.95) !important; }
.moe-btn--2 { border: 1px solid var(--c-border); color: var(--c-text-2); background: var(--c-bg); }
.moe-btn--2:hover { border-color: var(--c-primary); color: var(--c-primary); }
.moe-collapse { background: var(--c-bg); border-radius: var(--radius-s); border: 1px solid var(--c-border); margin: 14px 0; overflow: hidden; }
.moe-collapse__title { padding: 10px 14px; cursor: pointer; font-weight: 500; user-select: none; }
.moe-collapse__title:hover { color: var(--c-primary); }
.moe-collapse__body { padding: 12px 14px; border-top: 1px solid var(--c-border); }
.moe-card-title { border-left: 4px solid var(--c-primary); padding: 8px 14px; background: rgba(94,179,217,0.08); border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 14px 0; font-weight: 700; }
.moe-download-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; background: linear-gradient(135deg, var(--c-primary), var(--c-primary-h)); color: #fff; border-radius: var(--radius-s); margin: 10px 0; transition: opacity var(--trans); }
.moe-download-btn:hover { opacity: 0.88; color: #fff; }
.moe-download-btn__size { font-size: 12px; opacity: 0.75; }
.moe-divider { border: none; border-top: 1px solid var(--c-border); margin: 20px 0; }
.moe-divider--2 { border-top-style: dashed; }
.moe-divider--3 { border-top-width: 3px; border-color: var(--c-primary); }
.moe-video-wrap, .moe-bilibili-wrap { position: relative; padding-bottom: 56.25%; border-radius: var(--radius-s); overflow: hidden; margin: 14px 0; }
.moe-video-wrap video, .moe-bilibili-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.moe-login-lock { text-align: center; padding: 28px; background: var(--c-bg); border-radius: var(--radius); border: 1px dashed var(--c-border); }
.moe-login-lock__icon { font-size: 32px; display: block; margin-bottom: 8px; }
.moe-spoiler { position: relative; margin: 14px 0; }
.moe-spoiler__mask { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); border-radius: var(--radius-s); cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; z-index: 1; }
.moe-spoiler.revealed .moe-spoiler__mask { display: none; }
.moe-spoiler__content { padding: 12px; background: var(--c-bg); border-radius: var(--radius-s); }
.moe-quote { border-left: 4px solid var(--c-primary); padding: 12px 18px; background: rgba(94,179,217,0.07); border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 14px 0; }
.moe-quote__cite { font-size: 13px; color: var(--c-text-3); margin-top: 8px; }

/* ── 投稿页 ── */
.moe-submission-page { background: var(--c-surface); border-radius: var(--radius); padding: 28px; border: 1px solid var(--c-border); }
.moe-form-group { margin-bottom: 16px; }
.moe-form-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 6px; }
.moe-form-label .required { color: var(--c-danger); }
.moe-form-input { width: 100%; padding: 10px 14px; border-radius: var(--radius-s); border: 1px solid var(--c-border); background: var(--c-bg); color: var(--c-text); font: inherit; font-size: 14px; outline: none; transition: border-color var(--trans); }
.moe-form-input:focus { border-color: var(--c-primary); }
.moe-form-textarea { resize: vertical; min-height: 150px; }
.moe-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.moe-captcha-section { background: var(--c-bg); border-radius: var(--radius-s); padding: 14px; border: 1px solid var(--c-border); margin-bottom: 16px; }
.moe-captcha-options { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.moe-captcha-option { width: 70px; height: 70px; border-radius: var(--radius-s); overflow: hidden; cursor: pointer; border: 3px solid transparent; transition: border-color var(--trans); }
.moe-captcha-option.selected { border-color: var(--c-primary); }
.moe-captcha-option img { width: 100%; height: 100%; object-fit: cover; }
.moe-captcha-pass { color: var(--c-success); font-size: 14px; }
.moe-img-picker-trigger { display: inline-flex; align-items: center; position: relative; }
.moe-img-picker-trigger .moe-btn { margin: 0; }
.moe-img-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.moe-img-preview-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.moe-img-preview-item { position: relative; width: 80px; height: 80px; border-radius: var(--radius-s); overflow: hidden; }
.moe-img-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.moe-img-preview-item__rm { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.moe-creator-entry { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-border); display: flex; align-items: center; gap: 10px; }
.moe-creator-entry__btn { font-size: 13px; color: var(--c-primary); border: 1px solid var(--c-primary); padding: 5px 12px; border-radius: 100px; }
.moe-creator-entry__tip { font-size: 12px; color: var(--c-text-3); }

/* ── 灯箱 ── */
.moe-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.88); align-items: center; justify-content: center; }
.moe-lightbox:not([hidden]) { display: flex; }
.moe-lightbox__close { position: absolute; top: 16px; right: 20px; color: rgba(255,255,255,0.7); font-size: 24px; }
.moe-lightbox__close:hover { color: #fff; }
.moe-lightbox__img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: var(--radius-s); }

/* ── 回到顶部 ── */
.moe-back-top {
  position: fixed; bottom: 28px; right: 24px; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  box-shadow: 0 3px 14px rgba(94,179,217,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--trans), transform var(--trans), background var(--trans);
  opacity: 0; transform: translateY(10px) scale(0.8);
  pointer-events: none;
  will-change: transform, opacity;
}
.moe-back-top.is-visible {
  opacity: 0.92; transform: translateY(0) scale(1);
  pointer-events: auto;
}
.moe-back-top.is-visible:hover { opacity: 1; transform: translateY(-3px) scale(1.05); background: var(--c-primary-h); }

/* ── Footer ── */
.moe-footer {
  margin-top: 40px; padding: 20px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  backdrop-filter: var(--blur);
}
.moe-footer__inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.moe-footer__copy { font-size: 13px; color: var(--c-text-3); display: flex; align-items: center; gap: 6px; }
.moe-footer__menu { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; }
.moe-footer__menu a { font-size: 13px; color: var(--c-text-3); }
.moe-footer__menu a:hover { color: var(--c-primary); }

/* ── 404 ── */
.moe-404 { text-align: center; padding: 60px 20px; }
.moe-404__code { font-size: 90px; font-weight: 900; color: var(--c-primary); opacity: 0.15; line-height: 1; }
.moe-404__title { font-size: 24px; font-weight: 700; margin: 10px 0 8px; }
.moe-404__desc { color: var(--c-text-2); margin-bottom: 24px; }
.moe-404__actions { margin-bottom: 36px; }
.moe-404__recommend { max-width: 760px; margin: 0 auto; }
.moe-404__recommend h3 { margin-bottom: 16px; }
.moe-404__recommend .moe-card-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.moe-404__recommend .moe-card__thumb-wrap { aspect-ratio: 4/3; }
.moe-404__recommend .moe-card__title { font-size: 12px; -webkit-line-clamp: 1; }
.moe-404__recommend .moe-card__body { padding: 6px 10px; }
@media (max-width: 640px) {
  .moe-404__recommend .moe-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── v1.0.2 样式增强 ── */

/* 用户头像 */
.moe-user-avatar { padding: 4px; position: relative; overflow: visible; }
/* 头部用户头像：固定尺寸，防止 moe-points 插件框图片撑大布局 */
.moe-user-avatar .moe-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; }
/* 压制 header 区域的头像框（只在评论区显示框） */
.moe-user-avatar .moe-av-frame { display: none !important; }
.moe-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }

/* Header 右侧间距优化 */
.moe-header__actions { gap: 2px; }

/* ════════════════════════════════════════════════════════════
 * 头像 & 头像框兜底（轻量 · 不干扰插件自身定位）
 *   - 只保证头像圆形 + 容器 overflow:visible
 *   - 头像框定位完全交还给 moe-points：
 *       · 评论区 .moe-av-frame 由 frontend.js 内联 style 精确像素居中
 *       · 作者卡 / 自己主页 / 公开主页 / 我的框商店 由 profile.css / frontend.css
 *         自带 top:50%+translate(-50%,-50%) 百分比居中
 *   - 主题侧 !important 的 inset/坐标会与上面两套冲突，一律不再添加
 * ════════════════════════════════════════════════════════════ */
/* 头像统一强制圆形 — 必须 !important，否则会被主题/插件零散规则
   （如 .moe-card img { border-radius: X }）改成方形圆角，
   与圆形头像框视觉不匹配（用户原话："方形头像怎么可能佩戴圆形头像框"） */
img.avatar,
.moe-avatar-img,
.moe-comment-avatar,
.moe-author-card-avatar,
.moe-self-avatar,
.moe-public-avatar,
.moe-my-frame-avatar,
.moe-gallery-item {
  border-radius: 50% !important;
  object-fit: cover;
  box-sizing: border-box;
}
.moe-avatar-box,
.moe-public-avatar-box,
.moe-author-card-avatar-box,
.moe-avatar-wrap,
.moe-comment-avatar-wrap,
.moe-my-frame-preview-box {
  position: relative;
  overflow: visible;
}
/* ════════════════════════════════════════════════════════════
   头像框主题侧调整
   ────────────────────────────────────────────────────────────
   【分工原则】评论区 `.moe-av-frame` 完全由 frontend.js 内联 px 控制
   （getBoundingClientRect 实时测头像尺寸 × 1.30 → top/left/width/height
   全用 px 写死），主题**绝对不要碰它**，否则会盖掉 JS 的 px 值导致框
   按百分比撑到意外的定位祖先上。
   
   【主题要修的】author card / profile main / my-frame picker / public
   profile 这四处 frame 完全由 plugin CSS 控制，插件默认 130%（过大且有
   子像素偏移），用户要求改成 3% 外扩（总尺寸 103%）。
   
   【实现】width/height 用 103% + top:50%;left:50%;translate(-50%,-50%) 居中，
   和插件原方案同结构，仅调小百分比 → 保证百分比居中的数学一致性，不会
   像 inset 那样撑到错的定位祖先。
   
   【!important 原因】
   - 插件 CSS 选择器 `.moe-self-frame {...}` 特异性 0,0,1,0，等同于主题，
     不用 !important 按源顺序决胜；插件在主题之后加载时 plugin 胜出，
     所以必须 !important 才能覆盖。
   - 全局 `img { max-width: 100% }` 会钳制 103% 的 width → max-width:none。
   ════════════════════════════════════════════════════════════ */
.moe-self-frame,
.moe-public-frame,
.moe-author-card-frame,
.moe-my-frame-overlay {
  /* 定位/尺寸完全由 main.js moeAlignAllFrames() 写 inline px 控制
     （和评论区 moeInitAvatars 同逻辑：getBoundingClientRect → Math.round → px）。
     CSS 只提供 JS 尚未执行时的安全回退 + 非定位属性。 */
  position:       absolute;
  pointer-events: none;
  z-index:        2;
  max-width:      none !important;   /* 对抗 img{max-width:100%} */
  max-height:     none !important;
  object-fit:     contain;
}

/* 评论区 `.moe-av-frame`：只 unclamp max-width/max-height，不碰其它。
   JS 的 inline `top/left/width/height(px)` 保留。 */
.moe-av-frame,
.moe-avatar-frame-overlay {
  max-width:  none !important;
  max-height: none !important;
}

/* 个人主页"换头像"按钮必须盖在 frame (z-index:2) 之上，否则被 frame 遮挡
   点不到。插件 .moe-avatar-change-btn 没设 z-index，这里补上。 */
.moe-avatar-change-btn,
.moe-avatar-upload-btn {
  z-index: 5 !important;
}
/* Header 头像保持小尺寸、不加框（这里 !important 是必要的，JS 会尝试注入） */
.moe-user-avatar .moe-av-frame,
.moe-user-avatar .moe-avatar-frame-overlay { display: none !important; }


/* 卡片图片容器圆角与缩放裁剪协同 */
.moe-card__thumb-wrap { border-radius: var(--radius) var(--radius) 0 0; }

/* 分类 badge hover */
.moe-cat-badge:hover { background: var(--c-primary); color: #fff; }

/* 文章操作栏垂直居中 */
.moe-article__actions { align-items: flex-start; }

/* 评分区 wrap 布局 */
.moe-rating-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

/* 分享弹窗：用 .is-open 类控制（避免 display:flex 被 hidden 属性覆盖） */
.moe-action-wrap { z-index: 1; position: relative; }
.moe-share-popup { display: none; }
.moe-share-popup.is-open { display: flex; }
.moe-rating-dist-popup {
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.moe-rating-dist-popup.is-open {
  display: block;
  animation: moe-popup-in .2s ease forwards;
}
@keyframes moe-popup-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 页面整体最小宽度兜底 */
.moe-container { min-width: 0; }

/* 侧边栏小工具通知图片 */
.moe-widget-notice__img { width: 100%; border-radius: var(--radius-s); margin-bottom: 8px; }

/* 搜索栏文章无结果 */
.moe-empty { grid-column: 1 / -1; }

/* 翻页居中 */
.moe-pagination ul { list-style: none; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* 文章头部 meta avatar inline */
.moe-article__meta span { display: inline-flex; align-items: center; gap: 4px; }
.moe-article__meta img { border-radius: 50%; width: 20px; height: 20px; }

/* 登录按钮图标对齐 */
.moe-login-btn svg { flex-shrink: 0; }

/* 后台 notice 美化 */
.moe-card .notice { margin: 0 0 12px; }

/* 投稿表单 captcha pass 颜色 */
.moe-captcha-pass { color: var(--c-success); font-weight: 500; }

/* archive 筛选按钮active态 */
.moe-filter-btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* 风控后台表格文字溢出 */
.moe-admin-wrap .wp-list-table code { word-break: break-all; max-width: 140px; display: inline-block; }

/* 深色模式下文章内链接颜色 */
[data-theme="dark"] .moe-article__content a { color: #8ecfea; }
[data-theme="dark"] .moe-article__content a:hover { color: #b8e2f0; }

/* 深色模式评论区 */
[data-theme="dark"] .moe-comments,
[data-theme="dark"] .comment-list .comment-body { color: var(--c-text); }

/* 首页分区标题间距 */
.moe-section:first-child { margin-top: 0; }

/* 卡片简约版不显示meta，但保持高度一致 */
.moe-card--simple .moe-card__body { padding-bottom: 14px; }

/* 气泡在左侧按钮可能被截断时用right定位 */
.moe-header__actions .moe-action-wrap:last-child .moe-bubble { left: auto; right: 0; transform: none; }

/* ── 评分弹窗（modal）── */
.moe-rating-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.moe-rating-modal[hidden] { display: none; }
.moe-rating-modal__inner {
  background: var(--c-surface); border-radius: var(--radius);
  padding: 28px 32px; max-width: 340px; width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}
.moe-rating-modal__close {
  position: absolute; top: 12px; right: 14px;
  font-size: 18px; color: var(--c-text-3); cursor: pointer;
  background: none; border: none; padding: 4px 8px;
}
.moe-rating-modal__close:hover { color: var(--c-text); }
.moe-rating-modal__title { font-size: 16px; font-weight: 700; margin: 0 0 20px; }
.moe-rating-modal__stars { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.moe-modal-star {
  font-size: 32px; color: var(--c-border); cursor: pointer;
  background: none; border: none; padding: 2px; transition: color 0.15s, transform 0.15s;
  line-height: 1;
}
.moe-modal-star.active, .moe-modal-star.hover { color: #f5a623; transform: scale(1.15); }
.moe-rating-modal__hint { font-size: 13px; color: var(--c-text-3); margin: 0 0 16px; min-height: 20px; }
.moe-rating-modal__submit { width: 100%; justify-content: center; }
.moe-rating-modal__submit:disabled { opacity: 0.5; cursor: not-allowed; }
.moe-inline-avg { color: var(--c-primary); font-size: 12px; }
.moe-article__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }

/* ══════════════════════════════════════════
   萌主题 评论区样式（Sakurairo 风格参考）
═══════════════════════════════════════════ */
.moe-comments-wrap { margin-top: 32px; }
.moe-comments-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--c-border);
}
.moe-comments-title__icon { font-size: 20px; }
.moe-comments-count { color: var(--c-primary); }

/* 评论列表 */
.moe-comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.moe-comment-list ol { list-style: none; padding: 0; margin: 0; }

/* 单条评论 */
.moe-comment {
  margin-bottom: 16px;
}
.moe-comment-inner {
  display: flex; gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  overflow: visible;        /* 允许头像框图片溢出（moe-points 插件注入头像框需要） */
  transition: box-shadow var(--trans);
}
.moe-comment-inner:hover { box-shadow: 0 4px 16px rgba(94,179,217,0.1); }

.moe-comment.depth-2 .moe-comment-inner,
.moe-comment.depth-3 .moe-comment-inner {
  background: var(--c-bg);
  border-left: 3px solid var(--c-primary);
}

/* 头像 */
.moe-comment-avatar-wrap { flex-shrink: 0; position: relative; overflow: visible; align-self: flex-start; display: inline-block; line-height: 0; }
.moe-comment-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2px solid var(--c-border);
  transition: border-color var(--trans);
}
.moe-comment-inner:hover .moe-comment-avatar { border-color: var(--c-primary); }
.moe-comment-avatar-wrap .moe-av-frame {
  max-width: none !important;
  object-fit: contain;
  pointer-events: none;
}
.moe-comment-avatar-wrap .moe-comment-avatar { position: relative; z-index: 1; }

/* 评论内容区 */
.moe-comment-body { flex: 1; min-width: 0; }
.moe-comment-header {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px; margin-bottom: 8px;
}
.moe-comment-author {
  font-weight: 600; font-size: 14px; color: var(--c-text);
  max-width: 100%; word-break: break-all;
}
.moe-comment-author a { color: inherit; text-decoration: none; }
.moe-comment-author a:hover { color: var(--c-primary); }

/* 头衔等徽章被前端插入到 author 内，防止长名字挤压它们 */
.moe-comment-author > span { display: inline-block; vertical-align: middle; }

/* 徽章 */
.moe-comment-badge {
  font-size: 11px; padding: 1px 7px; border-radius: 100px; font-weight: 500;
}
.moe-comment-badge--author {
  background: rgba(94,179,217,0.14); color: var(--c-primary);
}

.moe-comment-meta {
  font-size: 12px; color: var(--c-text-3); margin-left: auto; white-space: nowrap;
}

/* 操作按钮 */
.moe-comment-actions {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  margin-top: 8px;
}
.moe-comment-actions a,
.moe-comment-actions button,
.comment-reply-link {
  font-size: 11px; color: var(--c-text-3);
  text-decoration: none; cursor: pointer;
  background: transparent !important; border: none !important; padding: 0 !important;
  border-radius: 0 !important;
  transition: color var(--trans);
}
.moe-comment-actions a:hover,
.moe-comment-actions button:hover,
.comment-reply-link:hover { color: var(--c-primary) !important; background: transparent !important; }
.comment-reply-link::before { content: '↩ '; }
.moe-comment-edit::before { content: '✏ '; }

/* 评论正文 */
.moe-comment-content {
  font-size: 14px; line-height: 1.75; color: var(--c-text-2);
}
.moe-comment-content p { margin: 0 0 8px; }
.moe-comment-content p:last-child { margin-bottom: 0; }
.moe-comment-content a { color: var(--c-primary); }
.moe-comment-pending {
  font-size: 13px; color: var(--c-text-3);
  background: rgba(245,166,35,0.08); padding: 6px 10px;
  border-radius: 6px; margin-bottom: 8px;
}

/* 关闭 & 翻页 */
.moe-comment-closed {
  text-align: center; color: var(--c-text-3); padding: 20px 0;
  font-size: 14px;
}
.moe-comment-nav {
  display: flex; justify-content: space-between; margin-bottom: 24px;
  font-size: 13px;
}
.moe-comment-nav a { color: var(--c-primary); }

/* ── 评论表单 ── */
#respond { margin-top: 8px; }
#reply-title {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.moe-form-title-icon { font-size: 18px; }

#cancel-comment-reply-link {
  font-size: 13px; color: var(--c-text-3); margin-left: 10px;
  font-weight: 400; text-decoration: none;
}
#cancel-comment-reply-link:hover { color: var(--c-danger); }

.moe-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.moe-form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.moe-form-field label {
  font-size: 13px; font-weight: 500; color: var(--c-text-2);
}
.moe-form-field input,
.moe-form-field textarea,
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  background: var(--c-bg); color: var(--c-text);
  transition: border-color var(--trans), box-shadow var(--trans);
  box-sizing: border-box; resize: vertical;
  outline: none;
}
#respond input:focus,
#respond textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(94,179,217,0.15);
}
#respond textarea { min-height: 120px; }

.required { color: var(--c-danger); margin-left: 2px; }

/* 提交按钮 */
.moe-comment-submit,
#respond .submit {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary); color: #fff !important;
  border: none; border-radius: 100px;
  padding: 10px 32px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity var(--trans), transform var(--trans);
  letter-spacing: 0.5px;
}
.moe-comment-submit:hover,
#respond .submit:hover { opacity: 0.88; transform: translateY(-1px); }

#respond .comment-form-cookies-consent { display: none; }

/* 深色模式适配 */
[data-theme="dark"] .moe-comment-inner { background: var(--c-surface-s); }
[data-theme="dark"] .moe-comment.depth-2 .moe-comment-inner { background: var(--c-surface); }

/* 移动端评论 */
@media (max-width: 600px) {
  .moe-form-row { grid-template-columns: 1fr; }
  .moe-comment-inner { padding: 12px; gap: 10px; }
  .moe-comment-avatar { width: 40px; height: 40px; }

  /* 移动端：操作按钮原本在右上角，现在移到了最底部，不需要绝对定位了 */
  .moe-comment-actions { margin-top: 4px; }
}

/* ── 友链申请 ── */
.moe-link-apply-box {
  margin-top: 32px; padding: 22px 24px;
  background: linear-gradient(135deg, #eaf6ff 0%, #f5fbff 100%);
  border: 1.5px solid rgba(94,179,217,0.2);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(94,179,217,0.08);
  text-align: center;
}
.moe-link-apply-box__title { margin: 0 0 10px; font-size: 17px; color: var(--c-primary-h); }
.moe-link-apply-box__notice { font-size: 13px; color: var(--c-text-2); line-height: 1.6; margin: 0 0 14px; white-space: pre-line; }
.moe-link-apply-box #moe-link-apply-open {
  background: linear-gradient(135deg, #5eb3d9 0%, #8ed3ed 100%);
  color: #fff; padding: 10px 24px; font-weight: 500;
  box-shadow: 0 4px 14px rgba(94,179,217,0.4);
  transition: transform 0.15s cubic-bezier(.34,1.56,.64,1), box-shadow 0.15s;
}
.moe-link-apply-box #moe-link-apply-open:hover {
  transform: translateY(-1px); box-shadow: 0 6px 20px rgba(94,179,217,0.5);
}

/* 弹窗 */
.moe-link-apply-modal {
  position: fixed; inset: 0; z-index: 9100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.moe-link-apply-modal[hidden] { display: none; }
.moe-link-apply-modal__mask {
  position: absolute; inset: 0; background: rgba(26,40,56,0.55); backdrop-filter: blur(4px);
  animation: moe-fade-in 0.2s ease-out;
}
.moe-link-apply-modal__inner {
  position: relative; max-width: 440px; width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
  border: 1.5px solid rgba(94,179,217,0.25);
  border-radius: 20px; padding: 26px 28px;
  box-shadow: 0 20px 50px rgba(26,95,140,0.25);
  animation: moe-modal-in 0.28s cubic-bezier(.34,1.56,.64,1);
  max-height: 90vh; overflow-y: auto;
}
@keyframes moe-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes moe-modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.moe-link-apply-modal__close {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(94,179,217,0.12); border: none; cursor: pointer;
  color: var(--c-primary-h); font-size: 14px; line-height: 1;
  transition: background 0.15s;
}
.moe-link-apply-modal__close:hover { background: rgba(94,179,217,0.25); }
.moe-link-apply-modal__title { margin: 0 0 6px; font-size: 18px; color: var(--c-primary-h); text-align: center; }
.moe-link-apply-modal__tip { margin: 0 0 20px; font-size: 12px; color: var(--c-text-3); text-align: center; }

.moe-link-apply-form label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--c-text-2); margin: 12px 0 5px;
}
.moe-link-apply-form label .required { color: var(--c-danger); }
.moe-link-apply-form input {
  width: 100%; padding: 9px 12px;
  border: 1px solid rgba(94,179,217,0.25);
  border-radius: 10px; font-size: 13px;
  background: #f7fcff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.moe-link-apply-form input:focus {
  outline: none; border-color: var(--c-primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(94,179,217,0.18);
}
.moe-link-apply-form__hint {
  display: block; font-size: 11px; color: var(--c-text-3); margin-top: 4px;
}
.moe-link-apply-form__actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px;
}
.moe-link-apply-form__result { margin: 12px 0 0; font-size: 13px; min-height: 18px; text-align: center; }
.moe-link-apply-form__result--success { color: var(--c-success); }
.moe-link-apply-form__result--error   { color: var(--c-danger); }

/* 深色模式 */
[data-theme="dark"] .moe-link-apply-box { background: linear-gradient(135deg, #1f3040 0%, #1a2838 100%); border-color: rgba(94,179,217,0.2); }
[data-theme="dark"] .moe-link-apply-modal__inner { background: linear-gradient(180deg, #1a2838 0%, #16202e 100%); border-color: rgba(94,179,217,0.2); }
[data-theme="dark"] .moe-link-apply-form input { background: rgba(255,255,255,0.04); color: var(--c-text); }
[data-theme="dark"] .moe-link-apply-form input:focus { background: rgba(255,255,255,0.08); }

/* 移动端 */
@media (max-width: 480px) {
  .moe-link-apply-modal { padding: 0; align-items: flex-end; }
  .moe-link-apply-modal__inner { border-radius: 20px 20px 0 0; max-height: 85vh; animation: moe-modal-slide-up 0.28s cubic-bezier(.34,1.56,.64,1); }
  @keyframes moe-modal-slide-up {
    from { transform: translateY(100%); } to { transform: translateY(0); }
  }
}

/* ════════════════════════════════════════════════════════════════════
 * 文章页专属主题 — 浅蓝二次元 gal 风 (Ice Blue Galgame Theme)
 * 作用域：.moe-single-main 下所有元素；其他页面不受影响
 * 色板：
 *   --ice-1: #F5FBFF  极淡底色
 *   --ice-2: #E8F5FB  次底色
 *   --ice-3: #C2E4F2  装饰浅
 *   --ice-4: #7BC5E3  主色
 *   --ice-5: #5AA7CE  主色深
 *   --ice-6: #3E87AE  文本深
 * ════════════════════════════════════════════════════════════════════ */

.moe-single-main {
  --ice-1: #F5FBFF;
  --ice-2: #E8F5FB;
  --ice-3: #C2E4F2;
  --ice-4: #7BC5E3;
  --ice-5: #5AA7CE;
  --ice-6: #3E87AE;
  /* 装饰 SVG（data URI 内联，零外部请求）*/
  --sparkle-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237BC5E3'><path d='M12 0L14 10L24 12L14 14L12 24L10 14L0 12L10 10Z'/></svg>");
  --snowflake-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237BC5E3' stroke-width='1.4' stroke-linecap='round'><path d='M12 2v20M3.34 7L20.66 17M3.34 17L20.66 7'/><circle cx='12' cy='12' r='1.5' fill='%237BC5E3'/></svg>");
}
[data-theme="dark"] .moe-single-main {
  --ice-1: #13202e;
  --ice-2: #182b3c;
  --ice-3: #2b4a64;
  --ice-4: #8ED3ED;
  --ice-5: #A8DEF0;
  --ice-6: #C8ECFA;
  --sparkle-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238ED3ED'><path d='M12 0L14 10L24 12L14 14L12 24L10 14L0 12L10 10Z'/></svg>");
  --snowflake-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ED3ED' stroke-width='1.4' stroke-linecap='round'><path d='M12 2v20M3.34 7L20.66 17M3.34 17L20.66 7'/><circle cx='12' cy='12' r='1.5' fill='%238ED3ED'/></svg>");
}

/* ── 容器：浅冰蓝底 + 柔光边框 + 角饰 ── */
.moe-single-main .moe-article {
  position: relative;
  background: var(--c-surface);
  border: none;
  border-radius: 20px;
  padding: 38px 42px 10px;
  box-shadow: 0 4px 24px rgba(94,179,217,0.06), 0 1px 3px rgba(94,179,217,0.03);
  overflow: hidden;
}
[data-theme="dark"] .moe-single-main .moe-article {
  box-shadow:
    0 16px 40px -8px rgba(0,0,0,0.5),
    0 10px 30px -12px rgba(0,0,0,0.4);
}
/* 右上角装饰雪花（淡浮动）*/
.moe-single-main .moe-article::before {
  content: '';
  position: absolute;
  top: 14px; right: 18px;
  width: 32px; height: 32px;
  background: var(--snowflake-svg) no-repeat center / contain;
  opacity: 0.35;
  pointer-events: none;
  animation: moe-float-rotate 14s linear infinite;
}
/* 左下角装饰星芒 */
.moe-single-main .moe-article::after {
  content: '';
  position: absolute;
  bottom: 18px; left: 20px;
  width: 18px; height: 18px;
  background: var(--sparkle-svg) no-repeat center / contain;
  opacity: 0.25;
  pointer-events: none;
  animation: moe-twinkle 3.2s ease-in-out infinite;
}
@keyframes moe-float-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes moe-twinkle {
  0%, 100% { opacity: 0.18; transform: scale(0.9); }
  50%      { opacity: 0.45; transform: scale(1.15); }
}

/* ── 文章头 ── */
.moe-single-main .moe-article__header {
  position: relative;
  margin-bottom: 28px;
  padding-bottom: 18px;
}
/* 标题下方：渐变横线 + 居中装饰星 */
.moe-single-main .moe-article__header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--ice-3) 20%,
    var(--ice-4) 50%,
    var(--ice-3) 80%,
    transparent 100%);
}

.moe-single-main .moe-article__title {
  position: relative;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 14px;
  /* 标题用浅蓝渐变 */
  background: linear-gradient(135deg, var(--ice-6) 0%, var(--ice-5) 50%, var(--ice-4) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  /* 文字自身保留柔光 */
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.6));
  padding-left: 22px;
}
[data-theme="dark"] .moe-single-main .moe-article__title {
  background: linear-gradient(135deg, #ffffff 0%, var(--ice-5) 50%, var(--ice-4) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(142,211,237,0.3));
}
/* 标题前小星芒 */
.moe-single-main .moe-article__title::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 14px; height: 14px;
  background: var(--sparkle-svg) no-repeat center / contain;
  animation: moe-twinkle 2.4s ease-in-out infinite;
}

/* ── meta 行 ── */
.moe-single-main .moe-article__meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13.5px;
  color: var(--ice-6);
  flex-wrap: wrap;
  justify-content: flex-start;
}
.moe-single-main .moe-article__meta > span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--ice-2);
  border: 1px solid var(--ice-3);
  border-radius: 100px;
  transition: background 0.2s, border-color 0.2s;
}
.moe-single-main .moe-article__meta > span:hover {
  background: var(--ice-3);
  border-color: var(--ice-4);
}
[data-theme="dark"] .moe-single-main .moe-article__meta > span {
  background: rgba(142,211,237,0.08);
  border-color: rgba(142,211,237,0.2);
  color: var(--ice-5);
}
.moe-single-main .moe-article__meta .moe-meta-cat {
  order: -1;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--ice-4), var(--ice-5));
  color: #fff;
  border: none;
  border-radius: 100px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(94,167,206,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.moe-single-main .moe-article__meta .moe-meta-cat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(94,167,206,0.4);
  color: #fff;
}

/* ── 正文排版 ── */
.moe-single-main .moe-article__content {
  font-size: 15px;
  line-height: 1.9;
  color: var(--c-text);
}
/* H2/H3 前小装饰星（gal 剧情章节感）*/
.moe-single-main .moe-article__content h2,
.moe-single-main .moe-article__content h3 {
  position: relative;
  padding-left: 22px;
  color: var(--ice-6);
  margin: 32px 0 14px;
}
.moe-single-main .moe-article__content h2::before,
.moe-single-main .moe-article__content h3::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background: var(--sparkle-svg) no-repeat center / contain;
}
.moe-single-main .moe-article__content h2 {
  font-size: 20px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--ice-3);
}
.moe-single-main .moe-article__content h3 { font-size: 17px; }
[data-theme="dark"] .moe-single-main .moe-article__content h2,
[data-theme="dark"] .moe-single-main .moe-article__content h3 {
  color: var(--ice-5);
}

/* 段落首字放大（只对第一段生效）*/
.moe-single-main .moe-article__content > p:first-of-type::first-letter {
  font-size: inherit;
  font-weight: inherit;
  float: none;
  line-height: inherit;
  padding: 0;
  color: inherit;
  font-family: inherit;
}

/* blockquote：左侧浅蓝渐变条 + 角落引号 + 浅底 */
.moe-single-main .moe-article__content blockquote {
  position: relative;
  background: linear-gradient(135deg, var(--ice-2) 0%, var(--ice-1) 100%);
  border: none;
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--ice-4), var(--ice-3)) 1;
  padding: 18px 22px 18px 26px;
  margin: 20px 0;
  border-radius: 0 14px 14px 0;
  color: var(--c-text-2);
  font-style: italic;
  box-shadow: 0 2px 8px rgba(94,167,206,0.08);
}
.moe-single-main .moe-article__content blockquote::before {
  content: '"';
  position: absolute;
  top: -12px; left: 12px;
  font-size: 52px;
  color: var(--ice-4);
  opacity: 0.45;
  font-family: Georgia, serif;
  line-height: 1;
  font-style: normal;
}
[data-theme="dark"] .moe-single-main .moe-article__content blockquote {
  background: linear-gradient(135deg, rgba(142,211,237,0.08) 0%, rgba(142,211,237,0.02) 100%);
}

/* 行内代码 */
.moe-single-main .moe-article__content code {
  background: var(--ice-2);
  border: 1px solid var(--ice-3);
  color: var(--ice-6);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 0.88em;
}
[data-theme="dark"] .moe-single-main .moe-article__content code {
  background: rgba(142,211,237,0.1);
  border-color: rgba(142,211,237,0.2);
  color: var(--ice-5);
}
/* 代码块：保留深色但更柔和 */
.moe-single-main .moe-article__content pre {
  background: linear-gradient(180deg, #1a2d42 0%, #0f1e30 100%);
  border: 1px solid rgba(142,211,237,0.15);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(14,29,46,0.25);
}
.moe-single-main .moe-article__content pre code {
  background: transparent;
  border: none;
  color: #d6e6f2;
  padding: 0;
}

/* 图片：边框 + 柔光 */
.moe-single-main .moe-article__content img {
  border-radius: 12px;
  box-shadow: 0 6px 20px -6px rgba(94,167,206,0.3), 0 2px 4px rgba(0,0,0,0.05);
  border: 1px solid var(--ice-3);
  transition: transform 0.25s cubic-bezier(.22,.8,.36,1), box-shadow 0.25s;
}
.moe-single-main .moe-article__content img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(94,167,206,0.4), 0 4px 8px rgba(0,0,0,0.08);
}

/* 列表：项前面用浅蓝小圆点 */
.moe-single-main .moe-article__content ul li::marker {
  color: var(--ice-4);
}

/* 超链接：柔化下划线 */
.moe-single-main .moe-article__content a:not(.moe-btn) {
  color: var(--ice-5);
  border-bottom: 1px dashed var(--ice-3);
  transition: color 0.15s, border-color 0.15s;
}
.moe-single-main .moe-article__content a:not(.moe-btn):hover {
  color: var(--ice-6);
  border-bottom-color: var(--ice-4);
  border-bottom-style: solid;
}

/* ── 互动按钮区（操作栏）── */
.moe-single-main .moe-article__actions {
  position: relative;
  margin-top: 28px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--ice-1) 0%, rgba(255,255,255,0.7) 100%);
  border: 1px solid var(--ice-3);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(94,179,217,0.18), 0 1px 6px rgba(94,179,217,0.06);
}
[data-theme="dark"] .moe-single-main .moe-article__actions {
  background: linear-gradient(135deg, rgba(142,211,237,0.04) 0%, rgba(142,211,237,0.01) 100%);
  border-color: rgba(142,211,237,0.18);
}

/* 操作按钮：更柔的边框 + 蓝色辉光 */
.moe-single-main .moe-action-btn {
  border-color: var(--ice-3);
  color: var(--ice-6);
  background: rgba(255,255,255,0.6);
}
.moe-single-main .moe-action-btn:hover {
  border-color: var(--ice-4);
  color: var(--ice-5);
  background: #fff;
  box-shadow: 0 6px 16px rgba(94,167,206,0.22), inset 0 1px 0 rgba(255,255,255,1);
}
.moe-single-main .moe-action-btn.active {
  border-color: var(--ice-4);
  color: var(--ice-5);
  background: linear-gradient(180deg, #f0f9fd 0%, var(--ice-2) 100%);
  box-shadow: 0 3px 12px rgba(94,167,206,0.25), inset 0 1px 0 rgba(255,255,255,0.9);
}
[data-theme="dark"] .moe-single-main .moe-action-btn {
  background: rgba(142,211,237,0.05);
  border-color: rgba(142,211,237,0.2);
  color: var(--ice-5);
}
[data-theme="dark"] .moe-single-main .moe-action-btn:hover {
  background: rgba(142,211,237,0.1);
  border-color: var(--ice-4);
}

/* 点赞激活态：粉心效果更柔 */
.moe-single-main .moe-like-btn.active {
  /* Removed custom pink styling so it falls back to global blue active theme */
}
.moe-single-main .moe-fav-btn.active {
  color: #d88f8f;
  border-color: #f2c5c5;
  background: linear-gradient(180deg, #fef6f6 0%, #fde6e6 100%);
}

/* ── 标签区 ── */
.moe-single-main .moe-article__tags {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--ice-1);
  border: 1px dashed var(--ice-3);
  border-radius: 14px;
  align-items: center;
}
.moe-single-main .moe-tags-icon {
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(123,197,227,0.3));
}
.moe-single-main .moe-tag-link {
  transition: transform 0.15s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s;
}
.moe-single-main .moe-tag-link:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 10px rgba(94,167,206,0.2);
}
[data-theme="dark"] .moe-single-main .moe-article__tags {
  background: rgba(142,211,237,0.04);
  border-color: rgba(142,211,237,0.18);
}

/* ── 相关文章区 ── */
.moe-single-main .moe-related {
  position: relative;
  margin-top: 28px;
  padding: 28px 32px;
  background: var(--c-surface);
  border: none;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(94,179,217,0.06), 0 1px 3px rgba(94,179,217,0.03);
}
.moe-single-main .moe-related__title {
  position: relative;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-left: 24px;
  padding-right: 16px;
  color: var(--ice-6);
  display: inline-block;
}
.moe-single-main .moe-related__title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: var(--sparkle-svg) no-repeat center / contain;
  animation: moe-twinkle 2.6s ease-in-out infinite;
}
/* 标题右侧延伸渐变线（gal 章节分隔感）*/
.moe-single-main .moe-related__title::after {
  content: '';
  position: absolute;
  left: calc(100% + 12px);
  top: 50%; transform: translateY(-50%);
  width: 60vw; max-width: 360px;
  height: 1px;
  background: linear-gradient(90deg, var(--ice-4) 0%, var(--ice-3) 40%, transparent 100%);
}
[data-theme="dark"] .moe-single-main .moe-related__title { color: var(--ice-5); }

/* 相关文章卡片 hover 时浮起 */
.moe-single-main .moe-related .moe-card-grid--related > * {
  transition: transform 0.25s cubic-bezier(.22,.8,.36,1), box-shadow 0.25s;
}
.moe-single-main .moe-related .moe-card-grid--related > *:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -10px rgba(94,167,206,0.3);
}

/* ── 评分弹窗 ── */
.moe-single-main .moe-rating-modal__inner,
.moe-rating-modal__inner {
  background: linear-gradient(180deg, #ffffff 0%, var(--ice-1, #F5FBFF) 100%);
  border: 1.5px solid var(--ice-3, #C2E4F2);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(94,167,206,0.35);
}
.moe-single-main .moe-rating-modal__title {
  color: var(--ice-6);
}
[data-theme="dark"] .moe-rating-modal__inner {
  background: linear-gradient(180deg, #1a2838 0%, #16202e 100%);
  border-color: rgba(142,211,237,0.2);
}

/* 可视化评分 */
.moe-single-main .moe-visual-rating {
  background: var(--ice-2);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--ice-3);
}
.moe-single-main .moe-visual-rating__score {
  color: var(--ice-6);
  font-weight: 700;
}
[data-theme="dark"] .moe-single-main .moe-visual-rating {
  background: rgba(142,211,237,0.08);
  border-color: rgba(142,211,237,0.2);
}
[data-theme="dark"] .moe-single-main .moe-visual-rating__score { color: var(--ice-5); }

/* ── 评论区容器 ── */
.moe-single-main .moe-comments {
  margin-top: 28px;
  padding: 28px 32px;
  background: var(--c-surface);
  border: none;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(94,179,217,0.06), 0 1px 3px rgba(94,179,217,0.03);
}

/* ── 响应式：移动端收紧 padding，隐藏较大的装饰 ── */
@media (max-width: 768px) {
  .moe-single-main .moe-article { padding: 24px 20px; border-radius: 16px; }
  .moe-single-main .moe-article__title { font-size: 22px; padding-left: 18px; }
  .moe-single-main .moe-article__title::before { width: 12px; height: 12px; top: 8px; }
  .moe-single-main .moe-article::before { width: 24px; height: 24px; top: 10px; right: 12px; }
  .moe-single-main .moe-article::after { display: none; }
  .moe-single-main .moe-article__content { font-size: 14.5px; line-height: 1.85; }
  .moe-single-main .moe-article__content h2 { font-size: 18px; }
  .moe-single-main .moe-article__content h3 { font-size: 16px; }
  .moe-single-main .moe-article__actions { padding: 14px; border-radius: 12px; }
  .moe-single-main .moe-related { padding: 20px; border-radius: 16px; }
  .moe-single-main .moe-related__title::after { display: none; }
  .moe-single-main .moe-comments { padding: 18px; border-radius: 16px; }
  /* 首字放大在窄屏会挤，关掉 */
  .moe-single-main .moe-article__content > p:first-of-type::first-letter {
    font-size: 1em; float: none; padding: 0; color: inherit;
  }
}

/* 降低动画偏好：关掉所有装饰动画 */
@media (prefers-reduced-motion: reduce) {
  .moe-single-main .moe-article::before,
  .moe-single-main .moe-article::after,
  .moe-single-main .moe-article__title::before,
  .moe-single-main .moe-related__title::before {
    animation: none !important;
  }
}

.moe-single-main--article .moe-article__header {
  position: static;
  margin-bottom: 24px;
  padding-bottom: 0;
}
.moe-single-main--article .moe-article__header::after,
.moe-single-main--article .moe-article__title::before,
.moe-single-main--article .moe-article__content h2::before,
.moe-single-main--article .moe-article__content h3::before,
.moe-single-main--article .moe-related__title::before,
.moe-single-main--article .moe-related__title::after,
.moe-single-main--article .moe-article::after,
.moe-single-main--article .moe-article__content blockquote::before {
  content: none;
  display: none;
}
.moe-single-main--article .moe-article__title {
  position: static;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: unset;
  color: var(--c-text);
  filter: none;
  padding-left: 0;
}
[data-theme="dark"] .moe-single-main--article .moe-article__title {
  background: none;
  -webkit-text-fill-color: unset;
  color: var(--c-text);
  filter: none;
}
.moe-single-main--article .moe-article__meta {
  gap: 14px;
  font-size: 13px;
  color: var(--c-text-3);
  justify-content: flex-start;
}
.moe-single-main--article .moe-article__meta > span {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.moe-single-main--article .moe-article__meta > span:hover {
  background: none;
  border-color: transparent;
}
[data-theme="dark"] .moe-single-main--article .moe-article__meta > span {
  background: none;
  border: none;
  color: var(--c-text-3);
}
.moe-single-main--article .moe-article__meta .moe-meta-cat {
  order: -1;
  padding: 1px 8px;
  background: rgba(94,179,217,0.12);
  color: var(--c-primary);
  border: 1px solid rgba(94,179,217,0.25);
  border-radius: 100px;
  font-weight: 500;
  box-shadow: none;
}
.moe-single-main--article .moe-article__meta .moe-meta-cat:hover {
  transform: none;
  box-shadow: none;
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.moe-single-main--article .moe-article__content {
  font-size: inherit;
  line-height: 1.85;
  color: var(--c-text);
}
.moe-single-main--article .moe-article__content h2,
.moe-single-main--article .moe-article__content h3 {
  position: static;
  padding-left: 0;
  color: var(--c-text);
  margin: 24px 0 12px;
}
.moe-single-main--article .moe-article__content h2 {
  font-size: 1.5em;
  padding-bottom: 0;
  border-bottom: none;
}
.moe-single-main--article .moe-article__content h3 {
  font-size: 1.17em;
}
[data-theme="dark"] .moe-single-main--article .moe-article__content h2,
[data-theme="dark"] .moe-single-main--article .moe-article__content h3 {
  color: var(--c-text);
}
.moe-single-main--article .moe-article__content blockquote {
  position: static;
  background: none;
  border: none;
  border-left: 4px solid var(--c-primary);
  border-image: none;
  padding: 0 0 0 16px;
  margin: 16px 0;
  border-radius: 0;
  color: var(--c-text-2);
  font-style: normal;
  box-shadow: none;
}
.moe-single-main--article .moe-article__content code {
  background: rgba(94,179,217,0.14);
  border: none;
  color: inherit;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
[data-theme="dark"] .moe-single-main--article .moe-article__content code {
  background: rgba(94,179,217,0.14);
  border: none;
  color: var(--c-text);
}
.moe-single-main--article .moe-article__content pre {
  background: #0f1a2e;
  border: 1px solid rgba(94,179,217,0.15);
  border-radius: var(--radius-s);
  padding: 16px;
  box-shadow: none;
}
.moe-single-main--article .moe-article__content pre code {
  background: transparent;
  border: none;
  color: #d6e6f2;
  padding: 0;
}
.moe-single-main--article .moe-article__content img {
  border-radius: var(--radius-s);
  box-shadow: none;
  border: none;
}
.moe-single-main--article .moe-article__content img:hover {
  transform: none;
  box-shadow: none;
}
.moe-single-main--article .moe-article__content a:not(.moe-btn) {
  color: var(--c-primary);
  border-bottom: none;
}
.moe-single-main--article .moe-article__content a:not(.moe-btn):hover {
  color: var(--c-primary-h);
  border-bottom: none;
}
.moe-single-main--article .moe-article__actions {
  display: flex;
  justify-content: center;
  position: static;
  margin-top: 36px;
  padding: 20px 16px;
  background: var(--c-surface);
  border: 1px solid rgba(94,179,217,0.2);
  border-radius: 12px;
  -webkit-backdrop-filter: none;
  box-shadow: 0 2px 12px rgba(94,179,217,0.04);
}
[data-theme="dark"] .moe-single-main--article .moe-article__actions {
  background: var(--c-surface);
  border: 1px solid rgba(142,211,237,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.moe-single-main--article .moe-action-btn {
  border-color: rgba(94,179,217,0.28);
  color: var(--c-text-2);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
  box-shadow: 0 2px 6px rgba(94,179,217,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
.moe-single-main--article .moe-action-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
  box-shadow: 0 5px 14px rgba(94,179,217,0.22), inset 0 1px 0 rgba(255,255,255,1);
}
[data-theme="dark"] .moe-single-main--article .moe-action-btn {
  border-color: rgba(94,179,217,0.28);
  color: var(--c-text-2);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
}
.moe-single-main--article .moe-article__tags {
  margin-top: 24px;
  padding: 16px 0 12px;
  background: none;
  border: none;
  border-top: 1px dashed var(--c-border);
  border-radius: 0;
}
.moe-single-main--article .moe-tags-icon {
  font-size: 15px;
  margin-right: 4px;
  filter: none;
}
.moe-single-main--article .moe-tag-link {
  transform: none;
  box-shadow: none;
}
.moe-single-main--article .moe-tag-link:hover {
  transform: none;
  box-shadow: none;
}
/* Removed unification block to restore individual cards.
   We now let .moe-related inherit the galgame container style,
   matching .moe-article and .moe-comments. */

.moe-single-main--article .moe-related__title {
  position: static;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 0;
  color: var(--c-text);
}
[data-theme="dark"] .moe-single-main--article .moe-related__title {
  color: var(--c-text);
}
.moe-single-main--article .moe-related .moe-card-grid--related > * {
  transition: none;
}
.moe-single-main--article .moe-related .moe-card-grid--related > *:hover {
  transform: none;
  box-shadow: none;
}
