/* =====================================================================
   SeoZen 主题样式
   - 通过 [data-theme="dark"] 切换暗色，:root 为亮色
   - 全部颜色走 CSS 变量，切换零闪烁、易扩展
   ===================================================================== */

/* ---------- 主题变量 ---------- */
:root {
    --bg: #ffffff;
    --bg-soft: #f5f7fa;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --border: #e6e8eb;
    --text: #1f2329;
    --text-soft: #4b5563;
    --text-muted: #8a94a6;
    --primary: #2f6fed;
    --primary-soft: #eaf1ff;
    --link: #2f6fed;
    --link-hover: #1d4fd0;
    --code-bg: #f3f4f6;
    --code-text: #b3115b;
    --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --radius: 12px;
    --radius-sm: 8px;
    --maxw: 1180px;
    --header-h: 60px;
    --tag-bg: #eef1f5;
    --tag-text: #5b6573;
}

[data-theme="dark"] {
    --bg: #0f1115;
    --bg-soft: #161a21;
    --bg-elevated: #1a1f27;
    --surface: #1a1f27;
    --border: #2a313c;
    --text: #e6e9ef;
    --text-soft: #b8c0cc;
    --text-muted: #7c8696;
    --primary: #5b8cff;
    --primary-soft: #1c2942;
    --link: #7aa2ff;
    --link-hover: #a9c0ff;
    --code-bg: #1c222c;
    --code-text: #ff8ab0;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --tag-bg: #232b36;
    --tag-text: #aeb8c6;
}

/* ---------- 四组主题色（暗/亮均适配） ---------- */
:root[data-accent="indigo"],
[data-theme="light"][data-accent="indigo"] {
    --primary: #2f6fed; --primary-soft: #eaf1ff; --link: #2f6fed; --link-hover: #1d4fd0;
}
[data-theme="dark"][data-accent="indigo"] {
    --primary: #5b8cff; --primary-soft: #1c2942; --link: #7aa2ff; --link-hover: #a9c0ff;
}
:root[data-accent="violet"],
[data-theme="light"][data-accent="violet"] {
    --primary: #7c3aed; --primary-soft: #f3e8ff; --link: #7c3aed; --link-hover: #5b21b6;
}
[data-theme="dark"][data-accent="violet"] {
    --primary: #a78bfa; --primary-soft: #2e1065; --link: #a78bfa; --link-hover: #c4b5fd;
}
:root[data-accent="teal"],
[data-theme="light"][data-accent="teal"] {
    --primary: #0d9488; --primary-soft: #e0f2f1; --link: #0f766e; --link-hover: #115e59;
}
[data-theme="dark"][data-accent="teal"] {
    --primary: #2dd4bf; --primary-soft: #0c2a2a; --link: #2dd4bf; --link-hover: #5eead4;
}
:root[data-accent="amber"],
[data-theme="light"][data-accent="amber"] {
    --primary: #d97706; --primary-soft: #fffbeb; --link: #b45309; --link-hover: #92400e;
}
[data-theme="dark"][data-accent="amber"] {
    --primary: #fbbf24; --primary-soft: #3a2600; --link: #fbbf24; --link-hover: #fde047;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4, h5, h6 { line-height: 1.35; color: var(--text); font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
blockquote {
    margin: 1.2em 0; padding: .6em 1em;
    border-left: 4px solid var(--primary);
    background: var(--bg-soft); color: var(--text-soft); border-radius: var(--radius-sm);
}
code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: var(--code-bg); color: var(--code-text);
    padding: .15em .4em; border-radius: 4px; font-size: .92em;
}
pre { background: var(--code-bg); padding: 1em; border-radius: var(--radius-sm); overflow: auto; }
pre code { background: none; padding: 0; color: var(--text); }
table { width: 100%; border-collapse: collapse; margin: 1em 0; }
th, td { border: 1px solid var(--border); padding: .55em .7em; text-align: left; }
hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- 布局容器 ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); }
.brand img { height: 32px; width: auto; border-radius: 6px; }
.brand:hover { color: var(--text); }

.site-nav { flex: 1; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
    display: block; padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 600; font-size: 15px;
}
.site-nav a:hover, .site-nav .current a { background: var(--primary-soft); color: var(--primary); }
.site-nav .has-child { position: relative; }
.site-nav .sub-nav {
    position: absolute; top: 100%; left: 0; min-width: 170px; margin: 0; padding: 6px 0; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); display: none; z-index: 120;
}
.site-nav .has-child:hover > .sub-nav,
.site-nav .has-child:focus-within > .sub-nav { display: block; }
.site-nav .sub-nav a { padding: 8px 16px; border-radius: 0; white-space: nowrap; }
.site-nav .caret { font-size: 10px; margin-left: 4px; opacity: .65; }
/* 大分类 hover 时才展开子分类（已在 .has-child:hover 控制 .sub-nav 显示） */

/* 文章底部标签 */
.post-tags-label { font-weight: 700; font-size: 14px; color: var(--text); align-self: center; margin-right: 2px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-soft);
    cursor: pointer; font-size: 17px; transition: .15s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn[data-state="dark"] .i-sun { display: inline; }
.icon-btn[data-state="light"] .i-moon { display: inline; }
.i-sun, .i-moon { display: none; }

.menu-toggle { display: none; }

/* ---------- 搜索框 ---------- */
.header-search { position: relative; }
.header-search input {
    width: 200px; max-width: 46vw; padding: 8px 12px 8px 34px;
    border: 1px solid var(--border); border-radius: 20px; background: var(--bg-soft);
    color: var(--text); font-size: 14px; outline: none;
}
.header-search input:focus { border-color: var(--primary); background: var(--surface); }
.header-search::before {
    content: "🔍"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6;
}

/* ---------- 主体栅格 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 28px 0 48px; }
.main-col { min-width: 0; }
.side-col { min-width: 0; }

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 4px 0 18px; }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb .sep { margin: 0 7px; opacity: .5; }
.breadcrumb .cur { color: var(--text); }

/* ---------- 文章列表(博客流) ---------- */
.post-list { display: flex; flex-direction: column; gap: 18px; }
.post-card {
    display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-card.no-thumb { grid-template-columns: 1fr; }
.post-thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); aspect-ratio: 16/10; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb .ph {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bg-soft), var(--border)); color: var(--text-muted); font-size: 13px;
}
.post-body { min-width: 0; }
.post-title { margin: .1em 0 .35em; font-size: 19px; line-height: 1.4; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); }
.post-meta { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: .5em; }
.post-meta a { color: var(--text-muted); }
.post-meta a:hover { color: var(--primary); }
.post-excerpt { color: var(--text-soft); font-size: 14.5px; margin: 0 0 .4em; }

/* ---------- 文章列表(CMS 网格) ---------- */
.cms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.cms-grid .post-card {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; height: 100%;
}
.cms-grid .post-thumb { aspect-ratio: 16/9; border-radius: 0; }
.cms-grid .post-body { padding: 14px 16px 18px; display: flex; flex-direction: column; }
.cms-grid .post-excerpt { flex: 1; }
.cms-grid .post-title { font-size: 17px; }

/* ---------- 分类/标签页标题 ---------- */
.archive-head { margin: 0 0 22px; }
.archive-head h1 { font-size: 24px; margin: 0 0 .2em; }
.archive-head p { color: var(--text-muted); margin: 0; }

/* ---------- 分页 ---------- */
.pagination { margin: 26px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination a, .pagination span, .pagebar a, .pagebar span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
    padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-soft); background: var(--surface); font-size: 14px;
}
.pagination a:hover, .pagebar a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current, .pagebar .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled, .pagebar .disabled { opacity: .45; pointer-events: none; }

/* ---------- 单篇文章 ---------- */
.single-header { margin-bottom: 18px; }
.single-title { font-size: 30px; line-height: 1.3; margin: .1em 0 .4em; }
.single-meta { font-size: 14px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 14px; }
.single-meta a { color: var(--text-muted); }
.single-meta a:hover { color: var(--primary); }
.post-content { font-size: 17px; line-height: 1.9; color: var(--text); word-wrap: break-word; }
.post-content img { border-radius: var(--radius-sm); margin: 1.2em auto; }
.post-content h2 { margin: 1.6em 0 .6em; font-size: 24px; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.post-content h3 { margin: 1.4em 0 .5em; font-size: 20px; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { padding-left: 1.6em; }
.post-content li { margin: .3em 0; }

/* 文章底部标签 */
.post-tags { margin: 26px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a {
    background: var(--tag-bg); color: var(--tag-text); padding: 5px 12px; border-radius: 20px; font-size: 13px;
}
.post-tags a:hover { background: var(--primary-soft); color: var(--primary); }

/* 上下篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; }
.post-nav a {
    display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text-soft); font-size: 14px;
}
.post-nav a:hover { border-color: var(--primary); color: var(--primary); }
.post-nav .label { font-size: 12px; color: var(--text-muted); display: block; }
.post-nav .next { text-align: right; }

/* 相关文章 */
.related { margin: 30px 0; }
.related h3 { font-size: 20px; margin: 0 0 14px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-item { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.related-item a { color: var(--text); font-weight: 600; }
.related-item .rmeta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* 分享按钮 */
.share-bar { display: flex; align-items: center; gap: 10px; margin: 22px 0; flex-wrap: wrap; }
.share-bar .label { font-size: 14px; color: var(--text-muted); }
.share-btn {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%; color: var(--text-soft); font-size: 15px;
}
.share-btn:hover { color: #fff; border-color: transparent; }
.share-btn.weibo:hover { background: #e6162d; }
.share-btn.weixin:hover { background: #07c160; }
.share-btn.qzone:hover { background: #ffce00; color: #000; }
.share-btn.copy:hover { background: var(--primary); }

/* ---------- 目录 TOC ---------- */
.toc { display: none; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 22px; }
.toc.is-active { display: block; }
.toc-title { font-weight: 700; margin: 0 0 8px; font-size: 15px; color: var(--text); }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-item a { color: var(--text-soft); font-size: 14px; display: block; padding: 3px 0; }
.toc-item a:hover { color: var(--primary); }
.toc-sub a { padding-left: 16px; font-size: 13px; }

/* ---------- 侧边栏 ---------- */
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.widget-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--primary); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.widget li:last-child { border-bottom: none; }
.widget li a { color: var(--text-soft); }
.widget li a:hover { color: var(--primary); }
.widget .count { float: right; color: var(--text-muted); font-size: 12px; }
.widget-search input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-soft); color: var(--text); outline: none;
}
.widget-search input:focus { border-color: var(--primary); }

/* 标签云：按文章量做「热度色阶 + 字号梯度 + 精致浮动」
   --heat(0~1) 越大 => 颜色越接近主题色、字号越大，直观表达“含此标签的文章越多” */
.tag-cloud {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  align-items: center; justify-content: center; padding: 12px 2px;
}
.tag-cloud a {
  --heat: 0.5; --delay: 0s; --dur: 6s;
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; line-height: 1.4;
  font-weight: 600; white-space: nowrap; cursor: pointer;
  color: color-mix(in srgb, var(--tag-text), var(--primary) calc(var(--heat) * 75%));
  background: color-mix(in srgb, var(--tag-bg), var(--primary-soft) calc(var(--heat) * 100%));
  border: 1px solid color-mix(in srgb, transparent, var(--primary) calc(var(--heat) * 38%));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  animation: tagFloat var(--dur) ease-in-out var(--delay) infinite;
  will-change: transform;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.tag-cloud a::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
  background: color-mix(in srgb, var(--tag-text), var(--primary) calc(var(--heat) * 85%));
  opacity: .75;
}
.tag-cloud a:hover {
  transform: translateY(-3px) scale(1.06);
  color: #fff; background: var(--primary); border-color: var(--primary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 42%, transparent);
  animation-play-state: paused;
}
.tag-cloud a:hover::before { background: #fff; opacity: .95; }
@keyframes tagFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tag-cloud a { animation: none !important; }
}

/* 统计 */
.stat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-list div { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat-list b { display: block; font-size: 18px; color: var(--primary); }
.stat-list span { font-size: 12px; color: var(--text-muted); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 34px 0 26px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.footer-grid h4 { font-size: 15px; margin: 0 0 12px; }
.footer-grid a { color: var(--text-soft); font-size: 14px; display: block; padding: 3px 0; }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.footer-bottom a { color: var(--text-muted); }

/* 友情链接（footer 全宽 band） */
.footer-links { display: flex; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; margin: 28px 0 0; }
.footer-links__label { flex: 0 0 auto; font-weight: 600; color: var(--text); font-size: 14px; padding-top: 4px; }
.footer-links__list { display: flex; flex-wrap: wrap; gap: 8px 10px; flex: 1 1 auto; }
.footer-links__list a { display: inline-block; padding: 5px 13px; font-size: 13px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; text-decoration: none; transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease; }
.footer-links__list a:hover, .footer-links__list a:focus-visible { color: #fff; border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, transparent); transform: translateY(-1px); }

/* ---------- 阅读进度条 ---------- */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--primary); z-index: 200; transition: width .1s linear; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
    position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none; cursor: pointer; font-size: 20px;
    box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
    z-index: 150; display: flex; align-items: center; justify-content: center;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px 20px; }
.notfound h1 { font-size: 90px; margin: 0; color: var(--primary); }
.notfound p { color: var(--text-muted); margin: 10px 0 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .cms-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .menu-toggle { display: inline-flex; }
    .site-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        max-height: 0; overflow: hidden; transition: max-height .25s ease;
    }
    .site-nav.is-open { max-height: 70vh; overflow: auto; }
    .site-nav ul { flex-direction: column; padding: 8px 14px; }
    .site-nav .sub-nav { position: static; display: block; box-shadow: none; border: none; padding-left: 14px; }
    .site-nav .sub-nav a { padding: 7px 0; }
    .header-search input { width: 130px; }
    .post-card { grid-template-columns: 1fr; }
    .post-thumb { aspect-ratio: 16/9; }
    .single-title { font-size: 24px; }
    .post-nav { grid-template-columns: 1fr; }
    .cms-grid, .related-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 设计美化增强（Phase 4b：文章配图 + UI 润色） ---------- */

/* 文章页 Hero 封面图 */
.single-hero {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--bg-soft);
    aspect-ratio: 16 / 9;
}
.single-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.single-hero:hover img { transform: scale(1.02); }

/* 文章 Hero 视觉变体：按文章 ID 轮换（hero-v1~v4），让封面风格偶尔变化、避免千篇一律 */
.single-hero { position: relative; }
.single-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(14,165,233,.08));
  transition: background .4s ease;
}
.single-hero.hero-v2 { border-radius: 28px; }
.single-hero.hero-v2::after { background: linear-gradient(135deg, rgba(245,158,11,.20), rgba(239,68,68,.10)); }
.single-hero.hero-v2 img { filter: saturate(1.12) contrast(1.04); }
.single-hero.hero-v3 { border-radius: 6px; }
.single-hero.hero-v3::after { background: linear-gradient(135deg, rgba(16,185,129,.16), rgba(5,150,105,.08)); }
.single-hero.hero-v3 img { filter: saturate(.92) contrast(1.06); }
.single-hero.hero-v4 { box-shadow: 0 0 0 3px rgba(139,92,246,.32), var(--shadow-sm); }
.single-hero.hero-v4::after { background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(217,70,239,.08)); }

/* 文章卡片分类徽章 */
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}
.category-chip a {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary);
    line-height: 1.2;
}
.category-chip a:hover {
    background: var(--primary);
    color: #fff;
}

/* 无缩略图时的占位图更有质感 */
.post-thumb .ph {
    background: linear-gradient(135deg, var(--primary-soft), var(--bg-soft));
    color: var(--primary);
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 700;
}

/* 文章首段加大（导语/lead） */
.post-content > p:first-of-type {
    font-size: 1.15em;
    color: var(--text-soft);
    line-height: 1.8;
}

/* 给长文安全/提示类段落预留的彩色强调块（未来可直接在正文用 class） */
.admonition {
    margin: 1.4em 0;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    background: var(--bg-soft);
    color: var(--text);
}
.admonition-title { font-weight: 700; margin-bottom: .3em; }
.admonition.tip { border-left-color: #10b981; background: rgba(16, 185, 129, .08); }
.admonition.warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, .08); }
.admonition.danger { border-left-color: #ef4444; background: rgba(239, 68, 68, .08); }

/* 正文表格更好读 */
.post-content table {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.post-content th {
    background: var(--bg-soft);
    font-weight: 700;
    color: var(--text);
}
.post-content tr:nth-child(even) td { background: var(--bg-soft); }

/* 页脚自定义分类导航 */
.footer-cats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.footer-cats li a {
    font-size: 14px;
    color: var(--text-soft);
}
.footer-cats li a:hover { color: var(--primary); }

/* 站点统计小部件强化 */
.stat-list b { font-size: 22px; }

/* 分类/归档页标题区 */
.archive-head {
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* ---------- 打印 ---------- */
@media print {
    .site-header, .side-col, .site-footer, .share-bar, .post-nav, .related, .back-to-top, .reading-progress { display: none !important; }
    .layout { display: block; }
    body { color: #000; background: #fff; }
}

/* =====================================================================
   SeoZen 专业级视觉与动效升级 (Phase 5)
   - 首页 Hero（动态渐变 + 浮动光球 + 网格）
   - 滚动揭示 (IntersectionObserver 触发 .is-visible)
   - 卡片微交互（图放大 / 描边高亮 / 新徽章）
   - 导航下划线动效 / 焦点环 / 小部件精致化 / 页脚精修
   - 全部遵循 prefers-reduced-motion
   ===================================================================== */

/* ---------- 焦点可见性（可访问性） ---------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- 滚动揭示 ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
    will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- 首页 Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    margin: 0 auto 30px;
    max-width: var(--maxw);
    border-radius: 20px;
    padding: 64px 24px 56px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(120% 140% at 15% 0%, #1e3a8a 0%, transparent 55%),
        radial-gradient(120% 140% at 85% 10%, #0e7490 0%, transparent 50%),
        linear-gradient(135deg, #0b1220 0%, #15233f 55%, #0d1b34 100%);
    box-shadow: 0 20px 60px -20px rgba(13, 27, 52, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
    isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; will-change: transform; }
.hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 75%);
    mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; will-change: transform; }
.orb-1 { width: 320px; height: 320px; left: -60px; top: -80px; background: radial-gradient(circle, #3b82f6, transparent 70%); animation: orbFloat1 14s ease-in-out infinite; }
.orb-2 { width: 280px; height: 280px; right: -40px; top: -40px; background: radial-gradient(circle, #06b6d4, transparent 70%); animation: orbFloat2 18s ease-in-out infinite; }
.orb-3 { width: 360px; height: 360px; left: 40%; bottom: -160px; background: radial-gradient(circle, #6366f1, transparent 70%); animation: orbFloat3 20s ease-in-out infinite; }
@keyframes orbFloat1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(40px, 30px); } }
@keyframes orbFloat2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 40px); } }
@keyframes orbFloat3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -30px); } }

.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: #bfdbfe; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hero-title {
    font-size: clamp(30px, 5vw, 52px); line-height: 1.12; margin: 0 0 14px;
    font-weight: 800; letter-spacing: -.02em; color: #fff;
    text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.hero-sub { font-size: clamp(15px, 2.2vw, 19px); color: #dbe4f3; margin: 0 auto 26px; max-width: 600px; }
.hero-search {
    display: flex; gap: 8px; max-width: 540px; margin: 0 auto 22px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 16px; padding: 8px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, .5);
}
.hero-search input {
    flex: 1; border: none; background: transparent; color: #fff;
    font-size: 16px; padding: 10px 14px; outline: none;
}
.hero-search input::placeholder { color: rgba(219, 228, 243, .7); }
.hero-search button {
    border: none; cursor: pointer; padding: 10px 22px; border-radius: 11px;
    font-size: 15px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.hero-search button:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 8px 22px -6px rgba(37, 99, 235, .7); }
.hero-search button:active { transform: translateY(0) scale(.98); }
.hero-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-cats a {
    font-size: 13px; font-weight: 600; color: #e2e8f5;
    padding: 6px 13px; border-radius: 999px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.hero-cats a:hover { background: #fff; color: #15233f; transform: translateY(-2px); }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin: 30px auto 0; max-width: 560px; }
.hero-stats .hs { padding: 0 22px; text-align: center; position: relative; }
.hero-stats .hs + .hs::before { content: ""; position: absolute; left: 0; top: 18%; height: 64%; width: 1px; background: rgba(255, 255, 255, .18); }
.hero-stats b { display: block; font-size: 26px; font-weight: 800; color: #fff; line-height: 1.1; }
.hero-stats span { font-size: 12.5px; color: #b9c6dc; }

@media (max-width: 720px) {
    .hero { padding: 44px 16px 40px; border-radius: 16px; }
    .hero-stats .hs { padding: 0 12px; }
    .hero-search { flex-direction: column; }
    .hero-search button { width: 100%; }
}

/* ---------- 文章卡片微交互 ---------- */
.post-card { position: relative; }
.post-thumb { overflow: hidden; }
.post-thumb img { transition: transform .55s cubic-bezier(.16, 1, .3, 1); }
.post-card:hover .post-thumb img { transform: scale(1.06); }
.post-card::after {
    content: ""; position: absolute; inset: 0; border-radius: var(--radius);
    border: 1px solid transparent; pointer-events: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.post-card:hover::after {
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    box-shadow: 0 14px 36px -16px color-mix(in srgb, var(--primary) 55%, transparent);
}
.post-card.is-new .post-thumb::before {
    content: "新"; position: absolute; top: 10px; left: 10px; z-index: 2;
    font-size: 12px; font-weight: 800; color: #fff; letter-spacing: .05em;
    padding: 3px 9px; border-radius: 8px;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    box-shadow: 0 4px 12px -3px rgba(239, 68, 68, .6);
}
.post-list .post-card { border-left: 3px solid transparent; transition: transform .18s ease, box-shadow .18s ease, border-color .2s ease; }
.post-list .post-card:hover { border-left-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- 导航下划线动效 ---------- */
.site-nav a { position: relative; }
.site-nav a::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
    background: var(--primary); border-radius: 2px;
    transform: scaleX(0); transform-origin: left center;
    transition: transform .26s cubic-bezier(.16, 1, .3, 1);
}
.site-nav a:hover::after,
.site-nav .current a::after,
.site-nav .has-child:hover > a::after { transform: scaleX(1); }
.site-nav .sub-nav a::after { left: 16px; right: 16px; bottom: 6px; }

/* ---------- 小部件精致化 ---------- */
.widget { transition: box-shadow .2s ease; }
.widget:hover { box-shadow: var(--shadow); }
.widget-title {
    position: relative;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), transparent);
    margin: -16px -16px 12px; padding: 14px 16px;
    border-left: 3px solid var(--primary); border-radius: var(--radius) var(--radius) 0 0;
}
.widget-list li, .widget li { transition: padding-left .18s ease, color .18s ease; border-radius: 6px; }
.widget-list li:hover, .widget li:hover { padding-left: 6px; }
.widget-list li:hover a, .widget li:hover a { color: var(--primary); }

/* ---------- 作者署名卡（文章页） ---------- */
.author-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; margin: 26px 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.author-card .avatar {
    width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px; color: #fff;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
}
.author-card .meta { min-width: 0; }
.author-card .name { font-weight: 800; color: var(--text); }
.author-card .desc { font-size: 13px; color: var(--text-muted); }

/* ---------- 页脚精修 ---------- */
.site-footer { position: relative; }
.site-footer::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: .5;
}
.footer-grid h4 { position: relative; padding-left: 12px; }
.footer-grid h4::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 2px; background: var(--primary); }
.footer-bottom a:hover { color: var(--primary); }

/* ---------- 归档/标签页标题区入场 ---------- */
.archive-head { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .orb { animation: none !important; }
    .hero-bg { transform: none !important; }
    .post-card:hover .post-thumb img { transform: none; }
    .site-nav a::after { transition: none; }
}

/* =====================================================================
   球形浮动标签云 (3D Tag Sphere)
   - JS 读取 #tagSphereData，将标签按斐波那契球均匀分布并自转
   - 通过 z 深度做缩放/透明度/模糊，营造真实球体体积感
   - 无 JS / 减弱动效：回退到 .tag-cloud--fallback 平面浮动云
   ===================================================================== */
.tag-sphere {
    position: relative;
    margin: 6px 0 2px;
    height: 360px;
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(120% 85% at 50% 6%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 58%),
        radial-gradient(90% 70% at 50% 108%, color-mix(in srgb, var(--primary-soft) 26%, transparent), transparent 72%),
        linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #0b1224), var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 34px -20px rgba(8, 15, 35, .55);
    isolation: isolate;
}
.tag-sphere::before {            /* 中心柔光，强化球体体积感 */
    content: ""; position: absolute; left: 50%; top: 50%; width: 62%; height: 62%;
    transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 0;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary) 32%, transparent), transparent 70%);
    filter: blur(20px); opacity: .5;
}
.tag-sphere__scene {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
    perspective: 760px;
}
.tag-sphere__ball {
    position: relative; width: 0; height: 0; transform-style: preserve-3d;
}
.tag-sphere__tag {
    position: absolute; left: 0; top: 0;
    font-weight: 700; white-space: nowrap; cursor: pointer; text-decoration: none;
    font-size: var(--fs, 15px);
    color: color-mix(in srgb, var(--tag-text), var(--primary) calc(var(--heat) * 80%));
    transform: translate(-50%, -50%);
    transition: color .2s ease, filter .2s ease;
    font-size: var(--fs, 15px);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--tag-text), var(--primary) calc(45% + var(--heat) * 55%)),
        color-mix(in srgb, var(--tag-text), #22d3ee calc(45% + var(--heat) * 55%)));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 0 16px color-mix(in srgb, var(--primary) calc(var(--heat) * 45%), transparent);
    will-change: transform, opacity;
    transition: filter .2s ease;
    user-select: none;
}
.tag-sphere__tag:hover, .tag-sphere__tag.is-hover {
    filter: brightness(1.28) drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 65%, transparent));
}
/* 默认隐藏平面回退云，JS 渲染球体后由其显示逻辑控制；减弱动效/无 JS 时显示 */
.tag-cloud--fallback { display: none; }
.tag-sphere.is-static .tag-cloud--fallback { display: flex; }
.tag-sphere.is-static .tag-sphere__scene { display: none; }
@media (prefers-reduced-motion: reduce) {
    .tag-sphere { height: auto; min-height: 60px; background: none; border: 0; box-shadow: none; }
    .tag-sphere::before { display: none; }
    .tag-sphere__scene { display: none; }
    .tag-cloud--fallback { display: flex; padding: 12px 2px; }
}

/* ============ 交易所排名页 ============ */
.exchange-page { max-width: 980px; margin: 0 auto; }
.exchange-sub { color: var(--text-soft); font-size: 15px; margin: 6px 0 0; }
.exchange-intro { color: var(--text-soft); font-size: 14.5px; line-height: 1.8; margin: 18px 0 22px;
    background: color-mix(in srgb, var(--primary) 7%, transparent); border-left: 3px solid var(--primary);
    padding: 12px 16px; border-radius: 0 10px 10px 0; }
.exchange-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border);
    background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,.06); }
.exchange-table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 14px; }
.exchange-table thead th { background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 80%, #000));
    color: #fff; font-weight: 700; text-align: left; padding: 13px 16px; white-space: nowrap; }
.exchange-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.exchange-table tbody tr:last-child td { border-bottom: 0; }
.exchange-table tbody tr { transition: background-color .18s ease; }
.exchange-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.exchange-table .col-rank { width: 64px; text-align: center; }
.exchange-table .col-vol { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.exchange-table .col-star { width: 120px; }
.exchange-table .col-name { font-weight: 700; }
.exchange-table .col-type { color: var(--text-soft); }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
    padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: 13px; background: var(--bg); color: var(--text-muted); }
tr.is-top10 .rank-badge { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
tr.is-top3 .rank-badge { background: linear-gradient(135deg, #ffd166, #ff8a3d); color: #3a2400; box-shadow: 0 4px 12px rgba(255,138,61,.35); }
tr.is-top3 { background: color-mix(in srgb, #ffd166 6%, transparent); }
/* 星级（CSS 宽度填充，支持 .5） */
.stars { --score: 5; display: inline-block; position: relative; font-size: 15px; line-height: 1; letter-spacing: 1px; }
.stars::before { content: "\2605\2605\2605\2605\2605"; color: var(--border); }
.stars::after { content: "\2605\2605\2605\2605\2605"; color: #f5a623; position: absolute; left: 0; top: 0;
    width: calc(var(--score) / 5 * 100%); overflow: hidden; white-space: nowrap; }
.exchange-note { margin-top: 22px; font-size: 13px; color: var(--text-muted); line-height: 1.8;
    background: color-mix(in srgb, #ff5a5f 8%, transparent); border: 1px solid color-mix(in srgb, #ff5a5f 25%, transparent);
    padding: 12px 16px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .exchange-table tbody tr { transition: none; } }

/* ============ 置顶文章区块（品牌色强调，取消标红） ============ */
:root { --sticky: var(--primary); --sticky-deep: color-mix(in srgb, var(--primary) 72%, #000); }
[data-theme="dark"] { --sticky: var(--primary); --sticky-deep: color-mix(in srgb, var(--primary) 72%, #000); }
.sticky-section { margin: 28px 0 0; }
.sticky-title { font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; color: var(--sticky); font-weight: 700; }
.sticky-title::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--sticky), var(--sticky-deep)); }
.sticky-section .post-card.is-sticky { position: relative; border: 1px solid color-mix(in srgb, var(--sticky) 45%, var(--border)); background: color-mix(in srgb, var(--sticky) 6%, var(--surface)); box-shadow: 0 6px 22px color-mix(in srgb, var(--sticky) 16%, transparent); }
.sticky-section .post-card.is-sticky:hover { border-color: var(--sticky); box-shadow: 0 10px 28px color-mix(in srgb, var(--sticky) 26%, transparent); }
.post-card .sticky-ribbon { position: absolute; top: 10px; left: -6px; z-index: 2; background: linear-gradient(135deg, var(--sticky), var(--sticky-deep)); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px 3px 10px; border-radius: 0 6px 6px 0; box-shadow: 0 4px 10px color-mix(in srgb, var(--sticky) 45%, transparent); }
.post-card .sticky-ribbon::after { content: ""; position: absolute; left: 0; bottom: -6px; border: 3px solid transparent; border-top-color: var(--sticky-deep); border-right-color: var(--sticky-deep); }
.post-card.is-sticky .post-title a { color: var(--sticky-deep); }
.post-card.is-sticky .category-chip a { font-weight: 700; color: var(--sticky-deep); }
/* 置顶文章图片居中：博客流改为居中特写卡片，CMS 网格确保图片居中 */
/* 置顶文章仅以边框/角标区分，尺寸与普通文章卡片完全一致 */
.cms-grid .post-card.is-sticky .post-thumb img { object-position: center; }
@media (prefers-reduced-motion: reduce) { .sticky-section .post-card.is-sticky { transition: none; } }

/* ============================================================
 * 首页文章展示形式：纯图（mode-img）/ 纯文（mode-text）
 * 由主题设置「首页文章展示形式」控制，seozen_post_card() 输出对应 class
 * ============================================================ */
.post-card.mode-img {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
}
.post-card.mode-img .post-thumb.is-pure {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}
.post-card.mode-img .post-thumb.is-pure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.post-card.mode-img:hover .post-thumb.is-pure img { transform: scale(1.06); }
.post-card.mode-img .img-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 14px 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  background: linear-gradient(to top, rgba(8, 12, 24, .85), rgba(8, 12, 24, 0));
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.post-card.mode-text { grid-template-columns: 1fr; }
.post-card.mode-text .post-body { padding: 18px 18px 20px; }
.post-card.mode-text:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
