/* ============================================================
   Joe Theme · 现代美化层 v3  (joe.beauty.css)
   主色：深厚紫 #8b5cf6 (violet)
   组成：① 设计 token  ② 排版基础  ③ 导航毛玻璃
         ④ 卡片悬浮  ⑤ 文章阅读体验  ⑥ 表单/按钮/滚动条
         ⑦ 首屏 Hero 区  ⑧ 阅读进度条
   部署：在 include.php 末尾 JCustomHeadEnd 之前加
         <link rel="stylesheet" href="...assets/css/joe.beauty.css">
   回滚：删除该 <link> 即可，主题源码无侵入。
   ============================================================ */

/* ============================================================
   ① 设计 Token —— 亮色（深厚紫 #8b5cf6）
   覆盖 joe.mode.min.css 中 html{} 的默认值
   ============================================================ */
html {
  --theme: #8b5cf6 !important;
  --theme-soft: #ede9fe !important;
  --theme-hover: #7c3aed !important;
  --theme-shadow: rgba(139, 92, 246, 0.35) !important;

  --background: #ffffff !important;
  --background-alt: #faf9fc !important;
  --main: #1f2329 !important;
  --routine: #4e5969 !important;
  --minor: #86909c !important;
  --seat: #c9cdd4 !important;

  --classA: #e5e6eb !important;
  --classB: #eaebed !important;
  --classC: #f0f1f2 !important;
  --classD: #f7f8fa !important;

  --radius-wrap: 14px !important;
  --radius-inner: 10px !important;

  --box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px -4px rgba(0, 0, 0, 0.08) !important;
  --box-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 28px -6px rgba(139, 92, 246, 0.18) !important;
  --text-shadow: none !important;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Source Han Sans SC", sans-serif !important;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Liberation Mono",
    Menlo, "Courier New", monospace !important;
}

/* ============================================================
   ② 设计 Token —— 暗色（GitHub 深邃风 + 深厚紫）
   Joe 把暗色 token 挂在 html[data-night='night'] body 上（优先级高），
   必须用同选择器 + !important 才能覆盖
   ============================================================ */
html[data-night='night'],
html[data-night='night'] body {
  --theme: #a78bfa !important;
  --theme-soft: #2e1065 !important;
  --theme-hover: #c4b5fd !important;
  --theme-shadow: rgba(167, 139, 250, 0.35) !important;

  --background: #0d1117 !important;
  --background-alt: #161b22 !important;
  --main: #e6edf3 !important;
  --routine: #b9c0cf !important;
  --minor: #8b949e !important;
  --seat: #6e7681 !important;

  --classA: #30363d !important;
  --classB: #262c36 !important;
  --classC: #1c2230 !important;
  --classD: #161b22 !important;

  --box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px -4px rgba(0, 0, 0, 0.5) !important;
  --box-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 28px -6px rgba(167, 139, 250, 0.25) !important;
  --text-shadow: none !important;
}

/* 暗色模式整页背景（覆盖 joe.mode 中 body::before 的 #121212） */
html[data-night='night'] body::before {
  background: #0d1117 !important;
}

/* ============================================================
   ③ 清理硬编码旧蓝 (#409eff / #ecf5ff)
   ============================================================ */
.joe_detail__article .term .content .user .author a,
.joe_comment .comment-list__item-container .user .author a {
  color: var(--theme) !important;
}
@keyframes joeProgress {
  to { background-color: var(--theme) !important; }
}
*[style*="#409eff"], span[style*="color:#409eff"] {
  color: var(--theme) !important;
}

/* ============================================================
   ④ 基础排版
   ============================================================ */
body {
  font-family: var(--font-sans) !important;
  background: var(--background-alt) !important;
  color: var(--main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.005em;
  font-feature-settings: "tnum" on;
}
body::before {
  background: none !important;
}

/* ============================================================
   ⑤ 顶部导航 —— 毛玻璃效果
   ============================================================ */
.joe_header {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: none !important;
  border-bottom: 1px solid var(--classC);
}
html[data-night='night'] .joe_header {
  background: rgba(13, 17, 23, 0.82) !important;
  border-bottom-color: var(--classA);
}
.joe_header__above-nav .item,
.joe_header__above .item {
  font-weight: 500;
  color: var(--routine) !important;
  transition: color 0.2s ease;
}
.joe_header__above-nav .item:hover,
.joe_header__above-nav .item.active,
.joe_header__above .item:hover,
.joe_header__above .item.active {
  color: var(--main) !important;
}
.joe_header__above-nav .item::after,
.joe_header__above .item.active::after {
  background: var(--theme) !important;
  height: 2px !important;
  border-radius: 2px;
}

/* ============================================================
   ⑥ 卡片 / 列表项 —— 现代悬浮效果
   ============================================================ */
.joe_list .item,
.joe_index .joe_list .item,
.joe_card,
.joe_aside .joe_aside__item {
  background: var(--background) !important;
  border: 1px solid var(--classC);
  border-radius: var(--radius-wrap) !important;
  box-shadow: var(--box-shadow) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.joe_list .item:hover,
.joe_index .joe_list .item:hover,
.joe_card:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-hover) !important;
  border-color: var(--classA);
}

/* 文章标题字重 */
.joe_list .item .title,
.joe_detail__title {
  font-weight: 650 !important;
  letter-spacing: -0.01em;
  color: var(--main) !important;
}
.joe_list .item .title a:hover {
  color: var(--theme) !important;
}
.joe_list .item .thumbnail img {
  border-radius: var(--radius-inner) !important;
}

/* ============================================================
   ⑦ 文章正文 —— 阅读体验核心
   ============================================================ */
.joe_detail,
.joe_detail__article {
  background: var(--background);
  border: 1px solid var(--classC);
  border-radius: var(--radius-wrap);
  box-shadow: var(--box-shadow);
}
.joe_detail__article {
  font-size: 16px;
  line-height: 1.85;
  color: var(--main);
  letter-spacing: 0.01em;
}
.joe_detail__article p { margin: 1.1em 0; }
.joe_detail__article h1,
.joe_detail__article h2,
.joe_detail__article h3,
.joe_detail__article h4 {
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--main);
  margin-top: 1.8em;
  margin-bottom: 0.8em;
}
.joe_detail__article h2 {
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--classC);
}
.joe_detail__article h3 { font-size: 1.25em; }

.joe_detail__article blockquote {
  border-left: 3px solid var(--theme);
  background: var(--theme-soft);
  border-radius: 0 var(--radius-inner) var(--radius-inner) 0;
  padding: 12px 18px;
  color: var(--routine);
}
.joe_detail__article code {
  font-family: var(--font-mono);
  background: var(--theme-soft);
  color: var(--theme);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.88em;
  border: none;
}
.joe_detail__article pre {
  border-radius: var(--radius-inner);
  border: 1px solid var(--classC);
}
.joe_detail__article pre code {
  background: transparent;
  color: inherit;
}
.joe_detail__article a {
  color: var(--theme);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.joe_detail__article a:hover {
  border-bottom-color: var(--theme);
}
.joe_detail__article ul,
.joe_detail__article ol {
  padding-left: 1.5em;
  margin: 1.1em 0;
}
.joe_detail__article img {
  border-radius: var(--radius-inner);
}

/* ============================================================
   ⑧ 按钮 / 标签 / 表单
   ============================================================ */
.joe_btn,
button[class*="joe"] {
  border-radius: var(--radius-inner) !important;
  transition: all 0.2s ease;
}
.joe_btn-primary {
  background: var(--theme) !important;
  box-shadow: 0 4px 12px -2px var(--theme-shadow);
}
.joe_btn-primary:hover {
  background: var(--theme-hover) !important;
  box-shadow: 0 6px 16px -2px var(--theme-shadow);
}
.joe_list .item .tags a,
.joe_detail__article .tag {
  border-radius: 6px !important;
  font-size: 0.78em;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  border-radius: var(--radius-inner) !important;
  border-color: var(--classA) !important;
  background: var(--background);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--theme) !important;
  box-shadow: 0 0 0 3px var(--theme-soft);
}

/* ============================================================
   ⑨ 滚动条 / 表格 / 分隔线
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--classA);
  border-radius: 10px;
  border: 2px solid var(--background-alt);
}
::-webkit-scrollbar-thumb:hover { background: var(--seat); }

.joe_detail__article table {
  border-radius: var(--radius-inner);
  overflow: hidden;
  border: 1px solid var(--classC);
}
.joe_detail__article th {
  background: var(--classD);
  font-weight: 600;
}
.joe_detail__article hr {
  border: none;
  height: 1px;
  background: var(--classC);
  margin: 2.2em 0;
}

/* ============================================================
   ⑩ 主题色元素跟随
   ============================================================ */
.joe_header__above-menu .active,
.joe_pagination .active,
[class*="current"] {
  color: var(--theme) !important;
}

/* ============================================================
   ⑪ 首屏 Hero 区（仅首页第一页显示，HTML 由 index.php 注入）
   ============================================================ */
.joe_hero {
  position: relative;
  margin: 0 auto 24px;
  padding: 56px 24px 56px;
  border-radius: var(--radius-wrap);
  background:
    radial-gradient(circle at 20% 0%, var(--theme-soft) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, var(--theme-soft) 0%, transparent 50%),
    var(--background);
  border: 1px solid var(--classC);
  box-shadow: var(--box-shadow);
  text-align: center;
  overflow: hidden;
}
.joe_hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--theme-soft) 0%, transparent 30%, transparent 70%, var(--theme-soft) 100%);
  opacity: 0.4;
  pointer-events: none;
}
.joe_hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}
.joe_hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--main);
  margin: 0 0 12px;
  line-height: 1.2;
}
.joe_hero__title .accent {
  background: linear-gradient(135deg, var(--theme) 0%, var(--theme-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.joe_hero__motto {
  font-size: 1.05rem;
  color: var(--routine);
  margin: 0;
  letter-spacing: 0.02em;
  font-weight: 400;
}
/* Hero 暗色模式：增强对比 */
html[data-night='night'] .joe_hero {
  background:
    radial-gradient(circle at 20% 0%, rgba(167, 139, 250, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(167, 139, 250, 0.10) 0%, transparent 50%),
    var(--background);
}
html[data-night='night'] .joe_hero::before {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08) 0%, transparent 30%, transparent 70%, rgba(167, 139, 250, 0.08) 100%);
}

/* Hero 仅首页第一页显示（第二页以后隐藏由 PHP 控制，CSS 兜底） */
@media (max-width: 768px) {
  .joe_hero {
    padding: 40px 16px 36px;
  }
}

/* ============================================================
   ⑫ 阅读进度条（顶部固定，所有页面显示）
   ============================================================ */
.joe_reading_progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--theme) 0%, var(--theme-hover) 100%);
  box-shadow: 0 0 8px var(--theme-shadow);
  z-index: 9999;
  transition: width 0.08s ease-out, opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
}
.joe_reading_progress.is-visible {
  opacity: 1;
}
/* 文章页才显示进度条（body 加 class 由 JS 控制） */
body:not(.joe_page-post) .joe_reading_progress {
  display: none;
}

/* ============================================================
   ⑬ 站点 slogan / aside 作者卡片美化
   ============================================================ */
.joe_aside__item.author .joe_aside__item-author .author {
  border-radius: var(--radius-wrap);
  overflow: hidden;
}
.joe_aside__item.author .joe_aside__item-author .avatar {
  box-shadow: 0 4px 12px -2px var(--theme-shadow);
  border: 2px solid var(--background);
}

/* ============================================================
   ⑭ 文章页标题区美化
   ============================================================ */
.joe_detail__title {
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--classC);
  margin-bottom: 0.6em;
}
