/* 现代化页面视觉与兼容规则；由 site.css 后续加载以保持历史层叠顺序。 */
/* v16.5：修复客户端全站背景图被 body 背景盖住 */
body.has-site-bg{
  position:relative;
  isolation:isolate;
}
.site-bg-layer{
  z-index:0 !important;
}
.site-header,
.container,
.footer{
  position:relative;
  z-index:1;
}
body.has-site-bg::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:var(--bg);
}


/* v16.5：朋友主页横幅支持原图虚化铺底 + 主图完整覆盖 */
.friend-cover-blurfill{
  position:relative;
  overflow:hidden;
  background-image:none !important;
  background-color:var(--panel-2);
}
.friend-cover-blurfill .friend-cover-bg,
.friend-cover-blurfill .friend-cover-main{
  position:absolute;
  inset:0;
  background-image:var(--friend-cover-image);
  background-position:center;
  background-repeat:no-repeat;
}
.friend-cover-blurfill .friend-cover-bg{
  background-size:cover;
  filter:blur(22px);
  transform:scale(1.12);
  opacity:.62;
}
.friend-cover-blurfill .friend-cover-bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(255,253,250,.14), rgba(255,253,250,.38)),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.30), transparent 46%);
}
body.dark .friend-cover-blurfill .friend-cover-bg{
  opacity:.48;
}
body.dark .friend-cover-blurfill .friend-cover-bg::after{
  background:
    linear-gradient(180deg, rgba(15,23,42,.16), rgba(15,23,42,.52)),
    radial-gradient(circle at 50% 0%, rgba(125,211,252,.10), transparent 46%);
}
.friend-cover-blurfill .friend-cover-main{
  z-index:1;
  background-size:contain;
  filter:none;
}
.friend-cover-blurfill::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  box-shadow:inset 0 -1px 0 var(--border);
}
@media(max-width:620px){
  .friend-cover{
    min-height:220px;
  }
}


/* v16.6：前台整体现代化设计刷新 */
:root{
  --glass:rgba(255,253,250,.70);
  --glass-strong:rgba(255,253,250,.88);
  --glow:0 22px 70px rgba(37,99,235,.12);
  --soft-ring:0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
body.dark{
  --glass:rgba(17,28,46,.66);
  --glass-strong:rgba(17,28,46,.84);
  --glow:0 22px 70px rgba(56,189,248,.10);
}
.modern-site-header{
  height:auto !important;
  border-bottom:0 !important;
  background:transparent !important;
  backdrop-filter:none !important;
  padding:16px 24px 0;
}
.modern-navbar{
  min-height:70px;
  max-width:min(var(--max), calc(100vw - 32px)) !important;
  border:1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  border-radius:999px;
  padding:10px 16px 10px 18px !important;
  background:color-mix(in srgb, var(--glass-strong) 78%, transparent);
  backdrop-filter:blur(22px) saturate(1.15);
  -webkit-backdrop-filter:blur(22px) saturate(1.15);
  box-shadow:0 18px 52px rgba(55,84,120,.10);
}
body.dark .modern-navbar{
  background:rgba(15,23,42,.72);
  box-shadow:0 18px 52px rgba(0,0,0,.24);
}
.logo{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:22px !important;
}
.logo-text{
  max-width:180px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.header-icons{
  gap:8px !important;
}
.icon-btn{
  width:42px;
  height:42px;
  background:color-mix(in srgb, var(--panel-2) 60%, transparent) !important;
  border:1px solid color-mix(in srgb, var(--accent) 12%, var(--border)) !important;
  transition:transform .18s ease,box-shadow .18s ease,color .18s ease;
}
.icon-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 26px rgba(55,84,120,.12);
}
.card,
.page-hero,
.hero-banner,
.tool-card{
  backdrop-filter:blur(16px) saturate(1.08);
  -webkit-backdrop-filter:blur(16px) saturate(1.08);
  background:var(--glass);
  border-color:color-mix(in srgb, var(--accent) 12%, var(--border));
}
.card:hover,
.tool-card:hover,
.small-friend:hover,
.featured-card:hover{
  box-shadow:var(--glow);
  border-color:color-mix(in srgb, var(--accent) 32%, var(--border));
}
.hero-banner{
  min-height:380px !important;
  border-radius:34px !important;
  padding:64px !important;
  box-shadow:var(--glow);
}
.hero-banner::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 28%),
    radial-gradient(circle at 12% 86%, color-mix(in srgb, #f59e0b 14%, transparent), transparent 32%);
  pointer-events:none;
}
.section-head{
  padding-left:4px;
}
.section-head h2{
  letter-spacing:.02em;
}
.tools-command-center{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,420px);
  gap:16px 22px;
  align-items:center;
  padding:24px;
  margin:0 0 22px;
}
.tools-command-center h2{
  margin:4px 0 4px;
  font-size:28px;
}
.tools-command-center p{
  margin:0;
  color:var(--muted);
}
.tools-searchbox{
  width:100%;
  border:1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius:999px;
  background:color-mix(in srgb, var(--panel) 82%, transparent);
  color:var(--text);
  padding:13px 17px;
  font:inherit;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22);
}
.tools-searchbox:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.modern-tools-grid .tool-card{
  position:relative;
  overflow:hidden;
}
.modern-tools-grid .tool-card::before{
  content:"";
  position:absolute;
  width:180px;
  height:180px;
  right:-70px;
  top:-70px;
  border-radius:999px;
  background:color-mix(in srgb, var(--accent) 13%, transparent);
  transition:transform .22s ease, opacity .22s ease;
  opacity:.72;
}
.modern-tools-grid .tool-card:hover::before{
  transform:scale(1.18);
  opacity:1;
}
.tool-card-icon{
  position:relative;
  z-index:1;
  box-shadow:0 12px 26px color-mix(in srgb, var(--accent) 12%, transparent);
}
.tools-empty-state{
  display:none;
  padding:24px;
  text-align:center;
  color:var(--muted);
  grid-column:1/-1;
}
.reveal-item{
  opacity:0;
  transform:translateY(12px);
}
.reveal-item.is-visible{
  opacity:1;
  transform:none;
  transition:opacity .46s ease, transform .46s ease;
}
@media(prefers-reduced-motion: reduce){
  .reveal-item{
    opacity:1 !important;
    transform:none !important;
  }
}
@media(max-width:980px){
  .modern-navbar{
    border-radius:28px;
    flex-wrap:wrap;
  }
  .tools-command-center{
    grid-template-columns:1fr;
  }
}
@media(max-width:720px){
  .modern-site-header{
    padding:10px 12px 0;
  }
  .modern-navbar{
    max-width:calc(100vw - 24px) !important;
    padding:10px !important;
  }
  .logo-text{
    max-width:128px;
  }
  .hero-banner{
    min-height:330px !important;
    padding:34px 26px !important;
    border-radius:28px !important;
  }
}


/* v16.7：修复 v16.6 导航过度突出、缩放不协调、active 高亮不完整 */
.modern-site-header{
  padding:0 !important;
  position:sticky;
  top:0;
  z-index:40;
  background:color-mix(in srgb, var(--bg) 72%, transparent) !important;
  backdrop-filter:blur(18px) saturate(1.08) !important;
  -webkit-backdrop-filter:blur(18px) saturate(1.08) !important;
  border-bottom:1px solid color-mix(in srgb, var(--accent) 10%, var(--border)) !important;
}
body.dark .modern-site-header{
  background:rgba(15,23,42,.70) !important;
}
.modern-navbar{
  width:min(var(--max), calc(100vw - 32px)) !important;
  max-width:none !important;
  min-height:72px;
  margin:0 auto !important;
  border:0 !important;
  border-radius:0 !important;
  padding:10px 0 !important;
  background:transparent !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
.logo{
  flex:0 0 auto;
}
.logo-text{
  max-width:210px;
}
.header-icons{
  flex:0 0 auto;
}
@media(max-width:980px){
  .modern-navbar{
    width:calc(100vw - 24px) !important;
    padding:9px 0 !important;
    gap:10px !important;
  }
}
@media(max-width:520px){
  .modern-navbar{
    width:calc(100vw - 18px) !important;
  }
  .logo-text{
    max-width:118px;
  }
}


/* v16.8：修复文章阅读正文被 reveal 隐藏，并收敛首页 Hero 为更极简风 */
.article-shell,
.article-shell .card,
.article-reader,
.article-reader.markdown-body,
.markdown-body{
  opacity:1 !important;
  transform:none !important;
  visibility:visible !important;
}
.article-reader.reveal-item,
.article-toc.reveal-item,
.article-shell .reveal-item{
  opacity:1 !important;
  transform:none !important;
}
.hero-banner{
  box-shadow:0 18px 54px rgba(55,84,120,.08) !important;
}
body.dark .hero-banner{
  box-shadow:0 18px 54px rgba(0,0,0,.18) !important;
}
.hero-banner::after{
  opacity:.55;
}


/* v16.9：交互与极简视觉修正 */
.logo,
.logo-text{
  line-height:1.28 !important;
  overflow:visible !important;
  padding-bottom:2px;
}
.logo{
  align-items:center !important;
}
.modern-navbar{
  overflow:visible !important;
}
.tools-command-center{
  grid-template-columns:minmax(0,1fr) minmax(260px,460px) !important;
  padding:22px 24px !important;
}
.tools-command-center h2{
  margin:0 0 4px !important;
}
.tools-command-center p{
  font-size:14px;
}
@media(max-width:720px){
  .tools-command-center{
    grid-template-columns:1fr !important;
  }
}

@media(max-width:760px){
  .container{
    padding:18px 14px 28px !important;
  }
  .page-grid,
  .article-shell,
  .panel-two{
    grid-template-columns:1fr !important;
    gap:18px !important;
  }
  .sidebar{
    gap:18px !important;
  }
  .hero-banner,
  .page-hero{
    min-height:240px !important;
    padding:28px 22px !important;
    border-radius:24px !important;
  }
  .page-hero h1{
    font-size:36px !important;
  }
  .page-hero p{
    font-size:16px !important;
  }
  .all-friends,
  .featured-friends,
  .tools-grid{
    grid-template-columns:1fr !important;
  }
  .article-reader{
    padding:22px 18px !important;
  }
  .article-toc{
    position:relative !important;
    top:auto !important;
    max-height:none !important;
  }
}
.article-list .post-card:first-child::before{
  content:none !important;
  display:none !important;
}
/* v17.5：文章阅读页 <br> 兜底可见换行 */
.markdown-body br,
.markdown-body br.md-hard-break{
  display:block;
  content:"";
  margin:.36em 0;
}
.markdown-body p br,
.markdown-body li br{
  margin:.28em 0;
}


/* v18.0：文章卡片摘要裁剪 + hover 统一兜底 */
.post-card .post-info p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  line-clamp:3;
  overflow:hidden;
  text-overflow:ellipsis;
}
.post-card{
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.post-card:hover,
.post-card:focus-visible{
  transform:translateY(-3px);
  border-color:rgba(14,165,233,.34);
  box-shadow:0 22px 52px rgba(55,84,120,.14), 0 0 0 1px rgba(14,165,233,.10) inset;
}
body.dark .post-card:hover,
body.dark .post-card:focus-visible{
  background:rgba(23,45,76,.96);
  border-color:rgba(125,211,252,.42);
  box-shadow:0 20px 48px rgba(0,0,0,.30), 0 0 0 1px rgba(125,211,252,.16) inset;
}

/* v19.6：除首页外，子页 Hero 改为极简文字标题，后续留给新的艺术形式 */
.page-hero.minimal-page-hero{
  min-height:auto !important;
  padding:22px 4px 18px !important;
  margin-bottom:24px !important;
  background:transparent !important;
  background-image:none !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
  overflow:visible !important;
}
.page-hero.minimal-page-hero::before,
.page-hero.minimal-page-hero::after{
  display:none !important;
  content:none !important;
}
.page-hero.minimal-page-hero h1{
  margin:0 !important;
  font-size:42px !important;
  line-height:1.12 !important;
  letter-spacing:.04em;
}
.page-hero.minimal-page-hero p{
  display:none !important;
}
@media(max-width:760px){
  .page-hero.minimal-page-hero{
    padding:16px 2px 12px !important;
    margin-bottom:18px !important;
  }
  .page-hero.minimal-page-hero h1{
    font-size:34px !important;
  }
}


/* v20.2.1：Markdown 冒号缩进语法。
   : 文本 => 1em，:: 文本 => 2em，最多 6em。 */
.markdown-body p.md-indent,
.article-reader p.md-indent,
.md-live-preview p.md-indent,
.preview p.md-indent{
  text-indent:var(--md-indent-size, 2em);
}
.markdown-body p.md-indent-1,
.article-reader p.md-indent-1,
.md-live-preview p.md-indent-1,
.preview p.md-indent-1{--md-indent-size:1em;}
.markdown-body p.md-indent-2,
.article-reader p.md-indent-2,
.md-live-preview p.md-indent-2,
.preview p.md-indent-2{--md-indent-size:2em;}
.markdown-body p.md-indent-3,
.article-reader p.md-indent-3,
.md-live-preview p.md-indent-3,
.preview p.md-indent-3{--md-indent-size:3em;}
.markdown-body p.md-indent-4,
.article-reader p.md-indent-4,
.md-live-preview p.md-indent-4,
.preview p.md-indent-4{--md-indent-size:4em;}
.markdown-body p.md-indent-5,
.article-reader p.md-indent-5,
.md-live-preview p.md-indent-5,
.preview p.md-indent-5{--md-indent-size:5em;}
.markdown-body p.md-indent-6,
.article-reader p.md-indent-6,
.md-live-preview p.md-indent-6,
.preview p.md-indent-6{--md-indent-size:6em;}


/* 全站页面标题英文标识统一。 */
html body .page-hero > .eyebrow{
  margin:0 0 10px !important;
  letter-spacing:.18em !important;
  text-transform:uppercase !important;
  font-size:12px !important;
  font-weight:900 !important;
  color:color-mix(in srgb, var(--accent) 72%, var(--muted)) !important;
}


/* v20.3.5：全站图标系统统一为纯黑白线条风格 */
.ui-line-icon,
.logo-line-icon,
.icon-btn svg,
.section-icon svg,
.back-icon-link svg,
.tool-card-arrow svg,
.meta-icon-item svg,
.admin-back-icon svg,
.btn-ico svg,
.snake-mobile-pad svg{
  width:1.05em;
  height:1.05em;
  display:inline-block;
  vertical-align:-0.17em;
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.75 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
  flex:0 0 auto;
}
.logo-line-icon{
  width:22px !important;
  height:22px !important;
}
.logo-mark.line-logo-mark,
.logo-mark{
  color:var(--text);
  background:transparent !important;
  border:1px solid color-mix(in srgb, currentColor 22%, transparent);
  box-shadow:none !important;
  display:grid;
  place-items:center;
}
.logo-mark.line-logo-mark{
  width:36px;
  height:36px;
  border-radius:999px;
}
.icon-btn{
  color:var(--text);
}
.icon-btn svg{
  width:20px !important;
  height:20px !important;
}
.section-icon{
  display:inline-grid;
  place-items:center;
  color:var(--text);
}
.section-icon svg{
  width:22px !important;
  height:22px !important;
}
.back-icon-link{
  display:inline-grid !important;
  place-items:center !important;
  color:var(--text) !important;
}
.back-icon-link svg{
  width:19px !important;
  height:19px !important;
}
.meta-icon-item{
  display:inline-flex !important;
  align-items:center;
  gap:5px;
}
.meta-icon-item svg{
  width:15px !important;
  height:15px !important;
}
.tool-card-arrow{
  display:inline-grid;
  place-items:center;
  color:var(--text);
}
.tool-card-arrow svg{
  width:19px !important;
  height:19px !important;
}
.more{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.more svg{
  width:15px !important;
  height:15px !important;
}
.back-to-top-button svg,
.scroll-to-bottom-button svg{
  width:20px !important;
  height:20px !important;
}
body.dark .logo-mark.line-logo-mark{
  border-color:color-mix(in srgb, currentColor 24%, transparent) !important;
}


/* v20.3.5：修正 v20.2.5 图标大改的副作用。
   1) 保留用户自定义 logo 图片，不再替换成系统线条 logo。
   2) 英文标识在新补齐的页面中使用同一套轻量样式。 */
html body .logo .logo-icon{
  display:inline-block !important;
  width:34px !important;
  height:34px !important;
  object-fit:cover !important;
  border-radius:12px !important;
}
html body .logo .line-logo-mark{
  display:grid !important;
  place-items:center !important;
}
html body .hero-banner .eyebrow,
html body .friend-detail-hero .eyebrow,
html body .page-hero .eyebrow,
html body .card > .eyebrow{
  margin:0 0 10px !important;
  letter-spacing:.18em !important;
  text-transform:uppercase !important;
  font-size:12px !important;
  font-weight:900 !important;
  color:color-mix(in srgb, var(--accent) 72%, var(--muted)) !important;
}
html body .card > .eyebrow{
  display:block !important;
}


/* v20.3.5：导航栏 Logo 尺寸统一；自定义 logo 不再被线条系统压小。 */
html body .site-header .logo-icon,
html body .modern-site-header .logo-icon,
html body .site-header .logo-mark,
html body .modern-site-header .logo-mark{
  width:36px !important;
  height:36px !important;
  min-width:36px !important;
  min-height:36px !important;
  border-radius:12px !important;
  box-sizing:border-box !important;
}
html body .site-header .logo-icon,
html body .modern-site-header .logo-icon{
  display:block !important;
  object-fit:cover !important;
}
html body .site-header .logo-line-icon,
html body .modern-site-header .logo-line-icon{
  width:21px !important;
  height:21px !important;
}
.ui-icon{
  --ui-icon-size:1.05em;
  display:inline-grid;
  place-items:center;
  width:var(--ui-icon-size);
  height:var(--ui-icon-size);
  line-height:1;
  color:inherit;
  vertical-align:-0.17em;
  flex:0 0 auto;
}
.ui-icon > svg,
.ui-icon .ui-line-icon{
  width:100% !important;
  height:100% !important;
  display:block !important;
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.75 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}
.icon-btn .ui-icon{ --ui-icon-size:20px; }
.logo-mark .ui-icon{ --ui-icon-size:21px; }
.section-icon .ui-icon{ --ui-icon-size:22px; }
.back-icon-link .ui-icon{ --ui-icon-size:19px; }
.meta-icon-item .ui-icon{ --ui-icon-size:15px; }
.tool-card-arrow .ui-icon{ --ui-icon-size:19px; }
.more .ui-icon{ --ui-icon-size:15px; }
.snake-mobile-pad .ui-icon{ --ui-icon-size:22px; }


/* v20.3.5：收回所有页面标题上方的英文 eyebrow 标识。 */
html body .eyebrow{
  display:none !important;
}


/* v20.3.5：页面标题描述收敛 + 搜索图标接口统一 + 阅读目录层级修正。 */
html body .page-title-plain > .meta,
html body .tools-command-center > div > p,
html body .page-hero.minimal-page-hero > p{
  display:none !important;
}
html body .site-search-icon{
  width:38px !important;
  min-width:38px !important;
  height:38px !important;
  display:grid !important;
  place-items:center !important;
  color:var(--muted) !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  font-size:0 !important;
  line-height:1 !important;
}
html body .site-search-icon .ui-icon{
  --ui-icon-size:19px !important;
  width:19px !important;
  height:19px !important;
}
html body .site-search-icon svg{
  width:19px !important;
  height:19px !important;
  stroke-width:1.75 !important;
}
html body .friend-search-box:focus-within .site-search-icon{
  color:var(--accent) !important;
}
html body .article-toc nav li{
  margin-top:5px !important;
  margin-bottom:5px !important;
}
html body .article-toc .toc-depth-1{
  margin-left:0 !important;
  font-weight:850 !important;
}
html body .article-toc .toc-depth-2{
  margin-left:14px !important;
  font-weight:760 !important;
}
html body .article-toc .toc-depth-3{
  margin-left:28px !important;
  font-weight:680 !important;
}
html body .article-toc .toc-depth-4{
  margin-left:42px !important;
  font-weight:620 !important;
}
html body .article-toc .toc-depth-5{
  margin-left:56px !important;
}
html body .article-toc .toc-depth-6{
  margin-left:70px !important;
}
html body .article-toc li:not([data-toc-depth]).toc-level-1{
  margin-left:0 !important;
  font-weight:850 !important;
}
html body .article-toc li:not([data-toc-depth]).toc-level-2{
  margin-left:14px !important;
  font-weight:760 !important;
}
html body .article-toc li:not([data-toc-depth]).toc-level-3{
  margin-left:28px !important;
  font-weight:680 !important;
}
html body .article-toc li:not([data-toc-depth]).toc-level-4{
  margin-left:42px !important;
  font-weight:620 !important;
}
html body .article-toc nav a{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
html body .page-hero > h1 + p{
  display:none !important;
}
