@import "./common_callout.css";
@import "./links.css";
@import "./color-variables.css";

/* callout样式 */
:root {
  --un-ring-offset-shadow: 0 0 transparent;
  --un-ring-shadow: 0 0 transparent;
}
.custom-callout {
  --un-shadow: var(--un-shadow-inset) 0 1px 3px 0
      var(--un-shadow-color, hsla(0, 0%, 50%, 0.1)),
    var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, hsla(0, 0%, 50%, 0.1));
  border-left: 3px solid;
  border-radius: var(--callout-radius);
  box-shadow: var(--un-ring-offset-shadow), var(--un-ring-shadow),
    var(--un-shadow);
  margin: 1rem 0;
  padding: 0;
}

/* 设置文字内容 :nth-child(1)的作用是选择第几个 */
.el-input.el-input--small.el-input-group.el-input-group--prepend:nth-child(
    1
  ):before {
  content: "输入QQ号会自动获取昵称和头像🐧";
}

.el-input.el-input--small.el-input-group.el-input-group--prepend:nth-child(
    2
  ):before {
  content: "收到回复将会发送到您的邮箱📧";
}

.el-input.el-input--small.el-input-group.el-input-group--prepend:nth-child(
    3
  ):before {
  content: "填写后可以点击昵称访问您的网站🔗";
}

/* 当用户点击输入框时显示 */
.el-input.el-input--small.el-input-group.el-input-group--prepend:focus-within::before,
.el-input.el-input--small.el-input-group.el-input-group--prepend:focus-within::after {
  display: block;
}

/* 主内容区 */
.el-input.el-input--small.el-input-group.el-input-group--prepend::before {
  /* 先隐藏起来 */
  display: none;
  /* 绝对定位 */
  position: absolute;
  /* 向上移动60像素 */
  top: -60px;
  /* 文字强制不换行，防止left:50%导致的文字换行 */
  white-space: nowrap;
  /* 圆角 */
  border-radius: 10px;
  /* 距离左边50% */
  left: 50%;
  /* 然后再向左边挪动自身的一半，即可实现居中 */
  transform: translate(-50%);
  /* 填充 */
  padding: 14px 18px;
  background: #444;
  color: #fff;
}

/* 小角标 */
.el-input.el-input--small.el-input-group.el-input-group--prepend::after {
  display: none;
  content: "";
  position: absolute;
  /* 内容大小（宽高）为0且边框大小不为0的情况下，每一条边（4个边）都是一个三角形，组成一个正方形。
    我们先将所有边框透明，再给其中的一条边添加颜色就可以实现小三角图标 */
  border: 12px solid transparent;
  border-top-color: #444;
  left: 50%;
  transform: translate(-50%, -48px);
}

.el-input.el-input--small.el-input-group.el-input-group--prepend::before,
.el-input.el-input--small.el-input-group.el-input-group--prepend::after {
  z-index: 9999; /* 提高层级，确保内容显示在最前 */
}

/* footer 字数统计样式 */
.post-count {
  /*font-weight: 500;*/
  /*font-size: 0.8125rem;*/
  scrollbar-width: none;
  color: var(--text-p4);
}

.totalcount {
  color: var(--text-p4);
}

/* 设置字体 */
.LXGWMode {
  font-family: "LXGW WenKai Screen", system-ui, "Helvetica Neue", sans-serif;
}

.custom-button {
  display: inline-block;
  padding: 5px 10px;
  /*margin: 10px;
    background-color: #f2f2f2; /* Light grey background, change as needed */
  font-family: inherit; /* Inherits the font-family from parent container */
  color: var(--tag-text-color);
  background-color: var(--tag-bg-color);
  text-align: center;
  cursor: pointer;
  /*border: 2px solid #ccc; /* Grey border */
  border-radius: 16px; /* Rounded corners */
  transition: all 0.3s ease;
}

.custom-button:hover {
  background-color: #e9e9e9; /* Slightly darker on hover */
  @media (prefers-color-scheme: dark) {
    background-color: #333; /* Darker background on hover */
  }
  border-color: #999; /* Darker border on hover */
}

/* toggle-font 提示框的样式 */

.tooltip {
  position: relative;
  cursor: pointer; /* 可选，让用户知道这是一个可以互动的元素 */
}

.tooltip:hover::before {
  white-space: nowrap;
  line-height: 18px;
  content: attr(data-msg);
  position: absolute;
  padding: 0 8px;
  display: block;
  color: #ffffff;
  background: #656565;
  border-radius: 6px;
  font-size: 12px;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000; /* 确保提示框在其他元素之上 */
}

.tooltip:hover::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #656565;
}

/* toggle-font 按钮的样式 */

.widget-wrapper.toggle-font {
  background: none;
  /* Add other styles specific to the toggle-font widget here */
}

.meta.cap > #post-meta {
  font-size: 12px;
  color: var(--text-meta); /* 或 --text-p2，设置为灰色 */
}

/* 设置图标颜色 */
/* 白天模式，默认填充色为黑色 */
.theme-icon {
  fill: var(--text);
}

.social-wrap .social img {
  fill: var(--text);
}

/* 文章内链接：链接不使用文本颜色，下划线半透明 */
.md-text.content a:not([class]), /*{% post_link 文件名 title %} 也能识别*/
li:not([class]) a:not([class]),
p:not([class]) a:not([class]),
table a:not([class]) {
  /*color: var(--tag-text-color); */
  /* color: var(--text-p1); */
  /*padding-bottom: 0.1em; /* 增加底部padding，以适应下划线 */
  /* font-weight: 600; */
  padding-right: 1px;
  margin-right: auto;
  background: linear-gradient(0, var(--theme-link), var(--theme-link)) no-repeat
    center bottom / 100% 0.1em;
}

.tag-plugin.tabs .nav-tabs .tab a {
  background: none;
}

/* 文章内链接：为链接使用荧光笔下划线效果 
li:not([class]) a:not([class]),
p:not([class]) a:not([class]),
table a:not([class]) {
  padding-bottom: 0.1rem;
  background: linear-gradient(0, var(--theme-link-opaq), var(--theme-link-opaq)) no-repeat center bottom / 100% 40%;
}
*/

.md-text a :not([class]) {
  /* font-weight: 500; */
  padding-right: 1px;
  margin-right: auto;
}

/* 选中文本：使用超链接高亮的背景色 */
::selection {
  background: var(--theme-link-opa);
}

/* toc高亮样式 */
.widget-wrapper.toc .toc a.toc-link.active {
  background: var(--block-hover);
}

/*
.md-text .highlight {
  max-height: 400px; 
  overflow: auto; 
}
*/

/* 暗黑模式图标反色 */
@media (prefers-color-scheme: dark) {
  .dark-mode-invert {
    filter: invert(1);
  }
}

.md-text img.dark-mode-invert {
  margin: 0; /* 移除自动边距 */
  display: inline;
  vertical-align: text-top;
}

/* 导航栏提示框 */
.nav-item {
  position: relative; /* 确保可以相对定位提示框 */
  cursor: pointer;
}

.nav-item::before {
  content: attr(title); /* 使用元素的 title 属性作为内容 */
  position: absolute;
  white-space: nowrap;
  color: #ffffff;
  background: #656565;
  padding: 4px 8px;
  border-radius: 4px;
  display: block; /* 始终保持显示，但使用 opacity 控制可见性 */
  transform: translateX(-50%); /* 将提示框向左移动自身宽度的50%，以居中 */
  top: 100%; /* 将提示框放置在元素的底部 */
  left: 50%; /* 开始于元素的中心位置 */
  opacity: 0; /* 初始为透明，不可见 */
  transition: opacity 0.2s ease-in-out; /* 仅对透明度应用过渡效果 */
  pointer-events: none; /* 确保提示框不会影响鼠标事件 */
  margin-top: 5px; /* 在元素下方留一点间隙 */
  z-index: 9999; /* 确保提示在最上层显示 */
}

.nav-item:hover::before {
  opacity: 1; /* 鼠标悬停时全不透明，完全可见 */
}

/* 代码块样式，远程 host */
.highlightcode-meta {
  background-color: var(--tag-bg-color) !important;
  color: var(--tag-text-color) !important;
}

.highlightcode-meta a[href] {
  color: var(--theme-link) !important;
  background: none !important;
}

/*推荐文章标题颜色调整为白*/
.related-posts .item .title {
  color: var(--text);
}

/* cursor动画 */
.logo__cursor {
  -webkit-animation: cursor 1s infinite;
  animation: cursor 1s infinite;
  background: var(--text-banner);
  border-radius: 1px;
  display: inline-flex;
  align-items: flex-end;
  height: 1.22rem;
  margin-left: 7px;
  width: 10px;
}

@-webkit-keyframes cursor {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes cursor {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* 爱心动画 */
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }

  10%,
  30% {
    transform: scale(0.9);
  }

  20%,
  40%,
  50%,
  60%,
  70%,
  80% {
    transform: scale(1.1);
  }
}

.footer-icon {
  animation: heartbeat 1.33s ease-in-out infinite;
  fill: rgb(255, 124, 180) !important;
}

/* from https://github.com/weekdaycare/weekdaycare.github.io/blob/main/css/scrollbar.css */

/* 基础滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  opacity: 0; /* 初始设为完全透明 */
  transition: opacity 0.5s; /* 渐变效果 */
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
  background-color: rgba(200, 155, 155, 0);
  border-radius: 2em;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
  background-color: #c3c0c1;
  border-radius: 2em;
  opacity: 1; /* 滑块不透明 */
}

/* 当滚动时，滚动条显示 */
body:hover ::-webkit-scrollbar {
  opacity: 1; /* 鼠标悬停在页面上时显示滚动条 */
}

/* 适应暗色主题的滚动条滑块 */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: #1f1f1f;
}

span[style*="background:#"] {
  color: black !important;
}

/* 打印样式优化 */

@media print {
  /* 隐藏元素 */
  .l_left,
  .l_right,
  .top.bread-nav.footnote,
  div#read-next,
  div#post-ai,
  div#related-posts,
  div#comments,
  section#license,
  section#share,
  footer {
    display: none;
  }
  .md-text psw {
    color: unset;
    background: unset;
    border: 3px dashed #ccc;
  }
  /* 隐藏锚点 */
  .markdownIt-Anchor {
    display: none; /* 隐藏原始链接内容 */
  }
  /* 修改背景和边框 */
  .article.banner {
    background: none;
    border-bottom: 1px dashed #ccc;
  }

  /* 调整边框圆角和内边距 */
  .banner,
  .banner.top {
    border-radius: 0;
  }

  .banner .bottom {
    padding: 0rem;
  }

  /* 取消grid布局 */
  #start {
    display: unset;
  }
  /* 调整字的上下边距 */
  p {
    margin: 0 !important;
  }
  /* 调整标题的上外边距 */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 0 !important;
  }

  /* 限制图片高度 */
  img {
    max-height: 100vh;
  }
}

/* home 导航 */
.post-card.post .meta.cap span#post-words span.sep:before {
  content: "|";
}

.post-card.post .meta.cap span#post-words span.updated {
  visibility: hidden;
}

.post-card.post:hover .meta.cap span#post-words span.updated {
  visibility: visible;
}

/* telegram timeline */

.tag-plugin.timeline.ds-telegram .body p:first-child {
  margin-top: 2px;
}
.tag-plugin.timeline.ds-telegram .body p:last-child {
  margin-bottom: 2px;
}
.tag-plugin.timeline.ds-telegram .body img {
  margin: 0.5rem 0;
  max-height: 128px;
  cursor: zoom-in;
}
.tag-plugin.timeline.ds-telegram .body .tag-plugin.image {
  display: flex;
}
.tag-plugin.timeline.ds-telegram .body .tag-plugin.image .image-bg + .image-bg {
  margin-left: 4px;
}

/* 限制图片宽度 */
.md-text
  img:not(.tag-plugin.gallery.grid-box img):not(.tk-content img):not(
    .tk-avatar-img
  ):not(.tag-plugin.emoji img):not(.tag-plugin.timeline img)
  :not(#customAudioPlayerContainer img) {
  max-width: 80% !important; /* 限制横向图片的最大宽度 */
  max-height: 500px !important; /* 限制竖向图片的最大高度 */
}

.md-text img.tk-avatar-img,
.md-text.tag-plugin.emoji img {
  border-radius: 0px;
}

.md-text p:not([class]) {
  img :not(tk-avatar-img img):not(.tag-plugin.emoji img) {
    max-width: 80%;
    max-height: 500px;
  }
}

.tag-plugin.image img:not(.tag-plugin.timeline img) {
  max-width: 80%;
  max-height: 500px;
}

@media (max-width: 768px) {
  .tag-plugin.image img:not(.tag-plugin.timeline img) {
    max-width: 100%;
  }
}

/* 删除线样式 */
.md-text del {
  color: var(--text-meta);
  text-decoration: line-through var(--text-meta);
}

.md-text s {
  color: var(--text-meta);
  /*  text-decoration: line-through var(--text-meta);*/
}

/* topic 标签样式 */
.topic-label {
  display: inline-flex;
  white-space: nowrap;
  font-size: 0.6em;
  background-color: var(--block);
  color: var(--text-meta);
  @media (prefers-color-scheme: dark) {
    /* background-color: #262626; */
    /* color: #c1c1c1; */
  }
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 10px;
  vertical-align: middle;
}

/* 彩蛋样式 */
.easter-egg {
  display: none !important;
}

.easter-egg.show {
  display: block !important;
}

.easter-egg-revealed {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 密码输入框样式 */
#password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlay-content {
  background-color: var(--card);
  color: var(--text);
  padding: 20px;
  border-radius: 5px;
  text-align: center;
}

#easter-egg-password,
#submit-password,
#close-overlay {
  margin: 10px;
  padding: 5px 10px;
}

/* 科幻风格弹窗 */
#password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 0, 50, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  font-family: "Courier New", monospace;
}
.overlay-content {
  background-color: rgba(60, 10, 100, 0.8);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(180, 100, 255, 0.5);
  max-width: 90%;
  width: 400px;
  text-align: center;
  color: #e0c0ff;
  border: 2px solid #9040ff;
}
.overlay-content p {
  margin: 10px 0;
}
.overlay-content img {
  border: 2px solid #9040ff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(180, 100, 255, 0.5);
}
#easter-egg-password {
  background-color: rgba(90, 30, 150, 0.3);
  border: 1px solid #9040ff;
  color: #e0c0ff;
  padding: 10px;
  margin: 10px 0;
  width: 80%;
  font-family: inherit;
  border-radius: 5px;
}
#easter-egg-password::placeholder {
  color: #b080ff;
}
.input-label {
  background-color: rgba(120, 60, 200, 0.3);
  border: 1px solid #9040ff;
  color: #e0c0ff;
  padding: 10px 20px;
  margin: 10px 5px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s;
  font-family: inherit;
  font-size: 0.8rem;
}
.input-label:hover {
  background-color: rgba(150, 80, 230, 0.5);
  box-shadow: 0 0 10px rgba(180, 100, 255, 0.5);
}
#password-error {
  color: #ff60e0;
  margin-top: 10px;
  font-size: 0.9rem;
}

/* topic 高亮样式 */
.callout-body .widget-wrapper {
  margin-bottom: 0;
  margin: 0;
  padding: 10px 0px 15px 0px;
}

.callout-body .widget-wrapper.post-list .widget-body a {
  font-size: 1rem;
  padding: 3px 16px;
}

/* status analysis , debugging 星际航程日志 样式 */
:root {
  --bg-color: #ffffff;
  --stats-bg-color: #f5f5f5;
  --text-color: #333333;
  --border-color: #e0e0e0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --stats-bg-color: #2a2a2a;
    --text-color: #e0e0e0;
    --border-color: #444444;
  }
}

.widget-wrapper.status {
  /* background-color: var(--bg-color); */
  color: var(--text-color);
  /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; */
  /* padding: 20px; */
}

/* .widget-wrapper.status .widget-header {
  margin-bottom: 15px;
} */

/* .widget-wrapper.status .widget-header .name {
  font-size: 1.2em;
  font-weight: bold;
} */

.widget-wrapper.status .widget-body {
  background-color: var(--card);
  box-shadow: 0 0px 12px -4px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 18px 12px;
}

.widget-wrapper.status .blog-stats-widget h2 {
  display: none;
}

.widget-wrapper.status .stats-container {
  display: flex;
  justify-content: space-between;
}

.widget-wrapper.status .stat-item {
  flex: 1;
  text-align: center;
}

.widget-wrapper.status .stat-label {
  font-size: 0.9em;
  color: var(--text);
  margin-bottom: 8px;
}

.widget-wrapper.status .stat-value {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--text);
}

/* 调整列表字体大小 
.md-text ul li {
  font-size: 'calc(%s)' % var(--fsp)
}

.md-text ol li {
  font-size: 'calc(%s)' % var(--fsp)
}

*/

.flex.right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  /* margin-top: 10px; */
}

.item.comments.last {
  color: inherit;
  border-width: 1px;
  border-style: solid;
  /* margin: 2px; */
  border-radius: 4px;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  /* border-color: #f4511e */
}

.item.comments.last:hover {
  background: var(--block-hover);
}

.item.comments {
  background: var(--block);
  border-color: var(--block-border);
  text-decoration: none;
}

.item.comments svg {
  width: 0.8rem;
  height: 0.8rem;
  vertical-align: middle;
}

/* .l_left footer.footer {
  position: sticky;
  bottom: 0.5rem;
} */

/* theme switcher */
.toast {
  z-index: 9999 !important;
}

.post-list .md-text p {
  color: var(--text-meta);
}



/* 更改脚注样式 */

.md-text sup,
.md-text sub {
  color: var(--theme);
  line-height: 1;
  font-weight: 400;
  /* font-family: Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif; */
}

.footnote-ref a {
  /* 链接样式 */
  color: var(--tag-text-color) !important;
  text-decoration: none;
  background: none !important;
  font-size: 0.85rem; /* 12px if base is 16px */
  margin: 0 0.2em;
}

/* 可选的悬停效果 */
.footnote-ref a:hover {
  text-decoration: underline;
  background: linear-gradient(0deg, var(--theme-link-opa), var(--theme-link-opa)) no-repeat left 100%/100% 100% !important;
}

.footnotes {
  width: 100%;
  margin-top: 2rem;
}

/* 直接针对 footnote-item 内的 p 标签 */
.footnotes .footnote-item p {
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* 为序号设置颜色 */
.footnotes .footnote-item::marker {
  font-size: 0.9rem;
  color: var(--text-meta);
}

/* 设置列表样式 */
.footnotes .footnotes-list {
  padding-left: 2rem;
}
