/* ========== amoit.top 视觉升级层 ==========
   风格：现代清爽 · 浅色 + 紫蓝主色
   统一放在这一个文件里，不需要时只要把 _config.butterfly.yml 里对应的 inject 行注释掉即可回滚。
   ========================================== */

:root {
  --brand: #5b5bd6;                                   /* 主色：紫蓝 */
  --brand-light: #7b7ce8;
  --brand-gradient: linear-gradient(135deg, #6b72ff 0%, #9b5cf6 100%);
  --bg-soft: #f7f8fc;                                 /* 页面底色偏冷一点点，留白更干净 */
  --card-bg: rgba(255, 255, 255, .82);
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-s: 0 2px 8px rgba(91, 91, 214, .06);
  --shadow: 0 6px 20px rgba(91, 91, 214, .10);
  --shadow-hover: 0 12px 32px rgba(91, 91, 214, .18);
  --transition: all .3s cubic-bezier(.25, .8, .25, 1);
}

/* ---------- 1. 全局基调：彩色光斑背景（玻璃质感的前提） ----------
   玻璃 = 半透明卡片 + blur + 背后有东西可透。
   之前 body 是实色，卡片再透明也看不出效果；现在用多层 radial-gradient
   色斑模拟 starlitn 的背景图，卡片透出的就是这些颜色。 */
body {
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(107, 114, 255, .16), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 20%, rgba(155, 92, 246, .13), transparent 60%),
    radial-gradient(ellipse 55% 50% at 75% 85%, rgba(64, 173, 255, .10), transparent 60%),
    radial-gradient(ellipse 45% 40% at 10% 80%, rgba(255, 122, 217, .08), transparent 60%),
    var(--bg-soft);
  background-attachment: fixed;
}
[data-theme='dark'] body {
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(107, 114, 255, .12), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 20%, rgba(155, 92, 246, .10), transparent 60%),
    radial-gradient(ellipse 55% 50% at 75% 85%, rgba(64, 173, 255, .07), transparent 60%),
    var(--global-bg, #0d0d0d);
  background-attachment: fixed;
}
[data-theme='lilac'] body {
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(139, 124, 246, .22), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 25%, rgba(201, 164, 247, .18), transparent 60%),
    radial-gradient(ellipse 55% 50% at 70% 85%, rgba(124, 77, 255, .12), transparent 60%),
    radial-gradient(ellipse 45% 40% at 8% 75%, rgba(255, 170, 250, .10), transparent 60%),
    #ece5f9;
  background-attachment: fixed;
}

/* 选中文字用主色，细节处更统一 */
::selection {
  background: rgba(91, 91, 214, .22);
  color: var(--brand);
}

/* 链接悬停 */
#article-container a:hover,
#aside-content a:hover,
#recent-posts a:hover .article-title {
  color: var(--brand) !important;
}

/* 滚动条 */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* ---------- 2. 顶部玻璃拟态导航 ---------- */
#nav {
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: var(--transition);
}
#nav.show,
.nav-fixed #nav {
  box-shadow: 0 4px 24px rgba(91, 91, 214, .12);
}
#nav .site-page,
#page-header #nav .site-page {
  position: relative;
}
/* 注意：必须带上 :not(.child) 才能压过主题原生的下划线规则
   （原规则写死了浅蓝色 #80c8f8，特异性更高，不这样写会盖不住） */
#nav .site-page:not(.child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-gradient);
  transition: var(--transition);
  transform: translateX(-50%);
}
#nav .site-page:not(.child):hover::after {
  width: 60%;
}

/* 作者名保留主色渐变（在文章页深色头图上） */
.author-info__name {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition);
}

/* 首页头图上的站点标题：头图偏浅，渐变字会糊掉，改为白色 + 加深阴影 */
#page-header #site-title {
  background: none;
  color: #fff;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .35), 0 1px 4px rgba(0, 0, 0, .25);
}

/* ---------- 3. 圆角卡片 + 悬浮微动效 ---------- */
.card-widget,
.recent-post-item,
.post-card,
.category-lists,
#post > .post-content > .tag_share,
.layout > div > div.card-box {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-s);
  transition: var(--transition);
}

.card-widget:hover,
.recent-post-item:hover {
  box-shadow: var(--shadow-hover);
  /* 玻璃风格：悬停只加深阴影，不做位移（避免波动感） */
}

/* 文章卡片：封面保持原尺寸（玻璃风格不做缩放动画） */
.recent-post-item:hover .post_cover img,
.post-card:hover .post_cover img {
  transform: none;
}
.post_cover img {
  border-radius: var(--radius) 0 0 var(--radius);
  transition: transform .5s ease;
}

/* 侧栏头像：主色描边 + 悬停旋转 */
.avatar-img {
  border: 2px solid transparent;
  transition: var(--transition);
}
.avatar-img:hover {
  border-color: var(--brand);
  transform: rotate(360deg) scale(1.05);
}

/* ---------- 4. 文章排版 ---------- */
#article-container {
  line-height: 1.85;
  letter-spacing: .2px;
}

#article-container p {
  margin: .9rem 0;
}

/* 标题前加一道主色竖线，层级更清楚 */
#article-container h1::before,
#article-container h2::before,
#article-container h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: .9em;
  margin-right: 10px;
  border-radius: 3px;
  background: var(--brand-gradient);
  vertical-align: -.1em;
}

/* 引用块 */
#article-container blockquote {
  border-radius: var(--radius-s);
  border-left: 4px solid var(--brand);
  background: rgba(91, 91, 214, .05);
}

/* 代码块 */
#article-container figure.highlight {
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-s);
}
#article-container code {
  border-radius: 5px;
}

/* 表格 */
#article-container table {
  border-radius: var(--radius-s);
  overflow: hidden;
}

/* ---------- 5. 标签与分类 ---------- */
#aside-content .tags-cloud-list a,
.tag-cloud-list a,
.tag-cloud a {
  border-radius: 20px;
  transition: var(--transition);
}
#aside-content .tags-cloud-list a:hover {
  background: var(--brand);
  color: #fff !important;
}

/* 分类 / 归档导航栏 */
.categoryBar-list-item,
.article-sort-item-title:hover {
  color: var(--brand);
}

/* 归档年份标记 */
.article-sort-item-year {
  color: var(--brand);
  font-weight: 600;
}

/* ---------- 6. 按钮与翻页 ---------- */
.btn-beautify,
.read-more,
#post #pagination a:hover,
.pagination a:hover {
  background: var(--brand-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  border-radius: 20px;
  transition: var(--transition);
}
.pagination a:hover {
  box-shadow: var(--shadow);
}

/* 阅读进度条 */
.progress-bar,
.headroom--not-top .progress {
  background: var(--brand-gradient) !important;
}

/* 右侧按钮组：悬停/按压时铺主色底，图标必须同步变白
   （主题原生只换背景不换字色，淡紫模式下会紫底深字看不清） */
#rightside > div > button,
#rightside > div > a {
  box-shadow: var(--shadow);
  transition: var(--transition);
}
#rightside > div > button:hover,
#rightside > div > button:focus,
#rightside > div > button:active,
#rightside > div > a:hover {
  background: var(--brand);
  color: #fff;
}

/* ---------- 7. 首页顶部大图 ---------- */
#page-header::before {
  background: linear-gradient(180deg,
      rgba(107, 114, 255, .28) 0%,
      rgba(155, 92, 246, .10) 40%,
      rgba(247, 248, 252, 0) 100%);
}
#page-header #site-title,
#page-header #site_subtitle {
  text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

/* ---------- 8. 页脚 ---------- */
#footer {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: 0 -2px 20px rgba(91, 91, 214, .06);
}

/* ---------- 9. 追番页适配主色 ---------- */
#article-container .bangumi-tab.bangumi-active {
  background: var(--brand-gradient) !important;
  color: #fff !important;
  border-radius: 20px;
}
#article-container .bangumi-item {
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow-s);
  transition: var(--transition);
}
#article-container .bangumi-item:hover {
  box-shadow: var(--shadow-hover);
}

/* ---------- 10. 移动端收窄圆角，避免溢出 ---------- */
@media screen and (max-width: 768px) {
  :root {
    --radius: 10px;
    --radius-l: 12px;
  }
  .card-widget:hover,
  .recent-post-item:hover {
    transform: none;
  }
}

/* ---------- 11. 页脚萌ICP备案号 ---------- */
#footer-wrap .footer_custom_text {
  margin-top: 6px;
  text-align: center;
}
#footer-wrap .icp-line a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--font-color, #4c4948);
  background: rgba(139, 124, 246, .10);
  border: 1px solid rgba(139, 124, 246, .22);
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
#footer-wrap .icp-line a:hover {
  background: rgba(139, 124, 246, .20);
  color: #8b7cf6;
}
#footer-wrap .icp-line i {
  font-size: 12px;
  color: #8b7cf6;
}

/* 页脚文字可读性：版权行/框架行原本偏淡 */
#footer-wrap .copyright,
#footer-wrap .framework-info {
  color: #6b6285;
}
[data-theme='dark'] #footer-wrap .copyright,
[data-theme='dark'] #footer-wrap .framework-info {
  color: #b9b3cf;
}
#footer-wrap .framework-info a {
  color: inherit;
  border-bottom: 1px dotted currentColor;
}
