@layer utilities {
  .float-animation-1 { animation: float1 6s ease-in-out infinite; }
  .float-animation-2 { animation: float2 7s ease-in-out infinite; }
  .btn-hover {
    transition: all 0.3s ease;
  }
  .btn-hover:hover,
  .btn-hover:active { /* 移动端长按/点击也有效果 */
    color: #000 !important;
    background-color: #fff !important;
  }
  .avatar-pulse {
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -40px); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-50px, 50px); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); }
  50% { box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}

.btnhonver{
  transition: all .3s;
}
.btnhonver:hover{
  background-color: #fff;
  color: black;
}

/* ====================== 基础排版 ====================== */
.post {
  margin-top: 2em;
  max-width: 38rem; /* 比原来的 29em 更舒适的可读宽度 */
  margin-left: auto;
  margin-right: auto;
}

.post code {
  background: #333;
  color: #ddd;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
.post code::before { content: "<"; }
.post code::after  { content: ">"; }

.post-link {
  color: #D8B9A4;
  text-decoration: none;
  transition: color 0.3s ease;
}
.post-link:hover,
.post-link:focus {
  color: #fff;
}

/* ====================== 文章卡片 ====================== */
.post-card {
  background: rgba(51, 51, 51, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* Safari 支持 */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 1.75rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, background, border-color; /* 优化动画性能 */
}

.post-card:hover,
.post-card:focus-within { /* 支持键盘导航 */
  background: rgba(51, 51, 51, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-8px);
}

.post-card time {
  font-size: 0.875rem;
  opacity: 0.8;
  display: block;
  margin-bottom: 0.5rem;
}

.post-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.3;
}

.post-card p {
  opacity: 0.9;
  line-height: 1.7;
  margin: 0;
}

.post-card-infomation{
  display: flex;
  flex-direction: row
}

/* ====================== 文章正文容器（标题 + 正文） ====================== */
.post-header{
  width: 90vw;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2.5rem 3rem;
  
  border-radius: 16px;
  
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.post-main,.comments {
  width: 90vw;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2.5rem 3rem;
  background: #1F1F1F;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.post-header {
  padding-bottom: 1.5rem;
}

.post-header-infomation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.post-header-time,
.post-header-class {
  font-size: 0.85rem;
}

.post-header-title {
  font-size: clamp(2rem, 5vw, 2.8rem); /* 自适应超大标题 */
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  color: #fff;
}

/* ====================== 响应式优化 ====================== */
@media (max-width: 1024px) {
  .post-header,
  .post-main {
    padding: 2rem 2.5rem;
  }
}

@media (max-width: 768px) {
  .post-header,
  .post-main {
    width: 94vw;
    max-width: none;
    margin: 1.5rem auto;
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  .post-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  .post-card h3 {
    font-size: 1.35rem;
  }

  .post-header-infomation {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .post-header,
  .post-main {
    padding: 1.75rem 1.25rem;
  }

  .post-card {
    padding: 1.25rem;
  }

  .post-header-title {
    font-size: 1.9rem;
  }

  .post code {
    font-size: 0.85em;
    word-break: break-all;
  }
}

/* ====================== 优化触摸反馈（移动端） ====================== */
@media (hover: none) and (pointer: coarse) {
  .post-card:active,
  .btn-hover:active {
    transform: translateY(-4px) scale(0.98);
    transition: transform 0.1s;
  }
}

/* ====================== 评论区整体容器 ====================== */
#comments {
  margin: 3rem auto;
  max-width: 900px;
  padding: 0 1rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ====================== 单条评论主体 ====================== */
.comment-body {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.comment-body:first-child { margin-top: 0; }

#comment-520 { /* 任意 comment id 都适用，可删 */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: rgba(40, 40, 40, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* 鼠标悬停 + 键盘焦点 + 移动端点击反馈 */
.comment-body:hover > #comment-520,
.comment-body:focus-within > #comment-520,
.comment-body:active > #comment-520 {
  background: rgba(50, 50, 50, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* ====================== 作者信息区 ====================== */
.comment-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.comment-author .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: border 0.3s;
}

.comment-author:hover .avatar {
  border-color: #D8B9A4;
}

.comment-author cite.fn {
  font-weight: 600;
  font-style: normal;
  font-size: 1rem;
  color: #fff;
}

.comment-author cite.fn a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s;
}

.comment-author cite.fn a:hover {
  color: #D8B9A4;
  border-color: #D8B9A4;
}

/* ====================== 元信息（时间 + 回复） ====================== */
.comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.comment-meta a {
  color: inherit;
  text-decoration: none;
}

.comment-meta a:hover {
  color: #D8B9A4;
}

.comment-reply a {
  background: rgba(216, 185, 164, 0.15);
  color: #D8B9A4;
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
}

.comment-reply a:hover,
.comment-reply a:focus {
  background: #D8B9A4;
  color: #000;
}

/* ====================== 评论正文 ====================== */
.comment-body p {
  margin: 0;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.92);
  word-break: break-word;
}

/* 代码高亮（如果评论里有 code） */
.comment-body p code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ====================== 子评论（无限层级） ====================== */
.comment-children {
  margin: 1.5rem 0 0 2.5rem; /* 左侧缩进形成树状 */
  padding-left: 0;
  border-left: 2px solid rgba(216, 185, 164, 0.25);
}

.comment-children .comment-body {
  margin: 1rem 0;
}

/* 越深的层级越窄，防止无限右移 */
.comment-children .comment-children {
  margin-left: 2rem;
}

/* ====================== 移动端极致优化 ====================== */
@media (max-width: 768px) {
  .comment-children {
    margin-left: 1.5rem;
  }
  
  .comment-children .comment-children {
    margin-left: 1rem;
  }
  
  #comment-520 {
    padding: 1rem;
    border-radius: 1rem;
  }
  
  .comment-author .avatar {
    width: 38px;
    height: 38px;
  }
  
  .comment-meta {
    font-size: 0.8rem;
    gap: 0.75rem;
  }
  
  .comment-reply a {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  #comments { padding: 0 0.75rem; }
  
  .comment-children {
    margin-left: 1rem;
    border-left-width: 1.5px;
  }
  
  .comment-author {
    gap: 0.65rem;
  }
  
  .comment-author cite.fn {
    font-size: 0.95rem;
  }
}

/* ====================== 移动端点击反馈 ====================== */
@media (hover: none) and (pointer: coarse) {
  .comment-body:active > #comment-520 {
    transform: translateY(-2px) scale(0.99);
    transition: transform 0.15s;
  }
}

/* ====================== 加载中状态（可选） ====================== */
.comment-body.loading {
  opacity: 0.6;
  pointer-events: none;
}
.comment-body.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ====================== 尊重用户减少动画偏好 ====================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Post CSS */
.article-main>blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em 1em 2em;
    border-left: 5px solid #d8b9a4;  /* 主色可改 */
    background-color: #444;
    font-style: italic;
    color: white;
    line-height: 1.6;
    position: relative;
}

/* 可选：加上大引号装饰 */
.article-main>blockquote:before {
    content: "“";
    font-size: 4em;
    color: #d8b9a4;
    opacity: 0.3;
    position: absolute;
    left: 0px;
    top: -10px;
    font-family: Georgia, serif;
}

.article-main>h1{
  font-size: 3em;
}
.article-main>h2{
  font-size: 2.5em;
}
.article-main>h3{
  font-size: 2em;
}
.article-main>h4{
  font-size: 1.5em;
}
.article-main>h5{
  font-size: 1em;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  background-color: #000;
  padding: 0.1em 0.5em;
  margin: 0 0.3em;
  border-radius: 0.3em;
}

ul {
  list-style: none;
  padding-left: 1.5rem;
}

li {
  position: relative;
  padding-left: 1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: #d8b9a4;        /* 蓝色小圆点，可改颜色 */
  border-radius: 50%;
}

.article-main>p>a{
  color: #D8B9A4 !important;
}

/* ====================== Markdown 内容核心样式 ====================== */
/* 作用范围限定在文章正文，防止影响后台或其它页面 */
.article-main {
    line-height: 1.85;
    font-size: 1.1rem;
    color: #e0e0e0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 段落 */
.article-main p {
    margin: 1.4em 0;
}

/* 标题 - 与整体层级协调 */
.article-main h1,
.article-main h2,
.article-main h3,
.article-main h4,
.article-main h5,
.article-main h6 {
    margin: 2.2em 0 1em 0;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
}

.article-main h1 { font-size: 2.2em; color: #ffffff; }
.article-main h2 { font-size: 1.9em; color: #ffffff; border-bottom: 1px solid #444; padding-bottom: .4em; }
.article-main h3 { font-size: 1.65em; color: #ffffff; }
.article-main h4 { font-size: 1.45em; color: #ffffff; }
.article-main h5 { font-size: 1.25em; }
.article-main h6 { font-size: 1.1em; color: #ffffff; }

/* 标题锚点小图标（可选） */
.article-main h1:hover::before,
.article-main h2:hover::before,
.article-main h3:hover::before,
.article-main h4:hover::before {
    content: "#";
    color: #d8b9a4;
    position: absolute;
    left: -1.2em;
    opacity: 0;
    transition: opacity .2s;
}
.article-main h1:hover::before,
.article-main h2:hover::before,
.article-main h3:hover::before,
.article-main h4:hover::before { opacity: 1; }

/* 链接 */
.article-main a {
    color: #d8b9a4;
    text-underline-offset: none;
    word-break: break-all;
    transition: all .3s;
}
.article-main a:hover {
    color: #ffffff;
    background: rgba(127, 191, 255, 0.15);
    border-radius: 4px;
    padding: 0 4px;
    margin: 0 -4px;
}

/* 强调 */
.article-main strong,
.article-main b {
    color: #ffffff;
    font-weight: 700;
}

/* 行内代码 */
.article-main code:not([class*="language-"]) {
    background: rgba(255,255,255,0.12);
    color: #ff9d9d;
    padding: 0.2em 0.45em;
    border-radius: 6px;
    font-size: 0.92em;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    border: 1px solid rgba(255,255,255,0.08);
}

/* 代码块 */
.article-main pre {
    margin: 1.8em 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    position: relative;
}

.article-main pre code {
    display: block;
    padding: 1.6em;
    padding: 1.4em;
    background: #0d1117 !important;
    color: #e6edf3;
    font-size: 0.94em;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    line-height: 1.6;
}

/* Prism.js / Highlight.js 兼容（如果你用了代码高亮插件） */
.article-main pre[class*="language-"] {
    margin: 1.8em 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 代码块左上角语言标签（可选美化） */
.article-main pre::before {
    content: attr(class);
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.1);
    color: #aaa;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 0 0 0 8px;
    backdrop-filter: blur(4px);
}
.article-main pre[class*="language-"]::before { content: attr(class); content: attr(class) / "" !important; }

/* 引用块 */
.article-main blockquote {
    margin: 2em 0;
    padding: 1.2em 1.5em 1.2em 2em;
    border-left: 6px solid #d8b9a4;
    background: #d8b9a41a;
    border-radius: 0 12px 12px 0;
    position: relative;
    font-style: normal;
}

.article-main blockquote p {
    margin: 0.8em 0;
    color: #bbbbbb;
}

/* 大引号装饰 */
.article-main blockquote::before {
    content: "“";
    font-family: Georgia, serif;
    font-size: 5em;
    color: #d8b9a476;
    opacity: 0.15;
    position: absolute;
    left: 10px;
    top: -20px;
    line-height: 1;
}

/* 列表 */
.article-main ul,
.article-main ol {
    margin: 1.6em 0;
    padding-left: 2em;
}

.article-main ul li,
.article-main ol li {
    margin: 0.6em 0;
    position: relative;
}

.article-main ul li::before {
    content: "";
    position: absolute;
    left: -1.6em;
    top: 0.75em;
    width: 7px;
    height: 7px;
    background: #d8b9a4;
    border-radius: 50%;
}

.article-main ol {
    counter-reset: ol-counter;
}

.article-main ol li {
    counter-increment: ol-counter;
}

.article-main ol li::before {
    content: counter(ol-counter) ".";
    position: absolute;
    left: -2em;
    color: #7fbfff;
    font-weight: bold;
    width: 2em;
    text-align: right;
}

/* 任务列表 */
.article-main input[type="checkbox"] {
    margin-right: 0.6em;
    accent-color: #d8b9a4;
    transform: scale(1.2);
}

/* 分隔线 */
.article-main hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #555, transparent);
    margin: 3em 0;
}

/* 表格 */
.article-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 0.95em;
    border-radius: 1px solid #444;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.article-main th,
.article-main td {
    padding: 1em;
    text-align: left;
    border-bottom: 1px solid #444;
}

.article-main th {
    background: #d8b9a4;
    color: #ffffff;
    font-weight: 600;
}

.article-main tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

.article-main tr:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* 图片 */
.article-main img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: transform 0.3s ease;
}

.article-main img:hover {
    transform: scale(1.02);
}

/* 图注（Markdown 标准写法 <img alt="xxx"> 或 <figure>） */
.article-main figure {
    margin: 2.5em 0;
    text-align: center;
}

.article-main figcaption {
    margin-top: 0.8em;
    color: #888;
    font-size: 0.9em;
    font-style: italic;
}

/* 删除线 */
.article-main del,
.article-main s {
    color: #888;
    text-decoration: line-through;
}

/* 脚注（如果用了脚注插件） */
.article-main .footnote-ref a {
    color: #7fbfff;
    font-size: 0.8em;
    vertical-align: super;
}
.article-main .footnote-item {
    font-size: 0.9em;
    color: #aaa;
}

/* 响应式表格在手机上横向滚动 */
@media (max-width: 768px) {
    .article-main table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}