@charset "UTF-8";
/*----在此处修改背景图片，可为明暗模式设置不同的背景图片----*/
/* 图片路径，请将图片存放至主题文件夹下的source/img */
:root {
  --vh: 1vh;
}

body {
  color: #0d122b;
}

html[data-theme=dark] body {
  color: #c7bebe;
}

/* New pseudo-element for the fixed background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none; /* 避免攔截點擊 */
  background:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
    url('https://raw.githubusercontent.com/slhs1121505/slhs1121505/refs/heads/main/G1HuJgLaQAEJBTT.jpg');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

html[data-theme=dark] body::before {
  background: 
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
    url('https://raw.githubusercontent.com/slhs1121505/slhs1121505/refs/heads/main/G1HuJgLaQAEJBTT.jpg');
    /* var(--background-img-dark); */
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

/*----以上 在此处修改背景图片，可为明暗模式设置不同的背景图片----*/

::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-corner {
  background-color: #fff;
}

::-webkit-scrollbar-thumb {
  background: #d3d3d4;
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

* {
  transition: background-color 75ms ease-in, border-color 75ms ease-in;
}

.notransition {
  transition: none;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
hr,
dl,
dd,
ol,
ul,
figure {
  margin-bottom: 10px;
  padding: 0;
}



html, body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  
  /*background: #fff;*/
  font: 500 18px/1.85 lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "LXGW Neo ZhiSong","Microsoft JhengHei", "MicrMicrosoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -o-font-feature-settings: "kern" 1;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  box-sizing: border-box;
}



strong,
b {
  font-weight: 700;
  color: #0d122b;
}

hr {
  border-bottom: 0;
  border-style: solid;
  border-color: #ececec;
}

kbd {
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border: 1px solid #ececec;
  border-radius: 2px;
  color: #0d122b;
  display: inline-block;
  font-size: 14px;
  line-height: 1.4;
  font-family: consolas, Menlo, "PingFang SC","Microsoft JhengHei", "Microsoft YaHei", monospace, Helvetica Neue For Number;
  margin: 0 0.1em;
  font-weight: 700;
  padding: 0.01em 0.4em;
  text-shadow: 0 1px 0 #fff;
}

img {
  max-width: 100%;
  vertical-align: middle;
  -webkit-user-drag: none;
  margin: 0 auto;
  text-align: center;
}

figure {
  position: relative;
}

figure > img {
  display: block;
  position: relative;
}

figcaption {
  font-size: 13px;
  text-align: center;
}


ul li {
  display: list-item;
  text-align: -webkit-match-parent;
}


ol {
 padding-left: 0; /* 去除内边距 */
}

.content .toc li {
 display: flex; /* 使用 flexbox 布局 */
 align-items: center; /* 垂直居中对齐内容 */
 margin-bottom: 10px; /* 为每个列表项添加下边距 */
}



ul,
ol {
  margin-top: 0;
}

li {
  padding-bottom: 1px;
  padding-top: 1px;
}
li:before {
  color: #0d122b;
}
li > ul,
li > ol {
  margin-bottom: 2px;
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #0d122b;
  font-weight: 700;
}
h1 + ul, h1 + ol,
h2 + ul,
h2 + ol,
h3 + ul,
h3 + ol,
h4 + ul,
h4 + ol,
h5 + ul,
h5 + ol,
h6 + ul,
h6 + ol {
  margin-top: 10px;
}
@media screen and (max-width: 768px) {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    scroll-margin-top: 65px;
  }
}

h1 > a,
h2 > a,
h3 > a,
h4 > a,
h5 > a,
h6 > a {
  text-decoration: none;
  border: none;
}
h1 > a:hover,
h2 > a:hover,
h3 > a:hover,
h4 > a:hover,
h5 > a:hover,
h6 > a:hover {
  text-decoration: none;
  border: none;
}

a {
  color: inherit;
  text-decoration-color: #d2c7c7;
  text-decoration: none;
}
a:hover {
  color: #f66;
}
a:focus {
  outline: 3px solid rgba(0, 54, 199, 0.6);
  outline-offset: 2px;
}

del {
  color: inherit;
}

em {
  color: inherit;
}

blockquote {
  color: #6b7886;
  text-align: center;
  opacity: 0.9;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
  padding: 10px;
  margin-left: 10px;
  margin-right: 10px;
  font-size: 1em;
}
blockquote > :last-child {
  margin-bottom: 0;
  margin-top: 0;
}

.wrapper {
  max-width: calc(890px - 30px * 2);
  position: relative;
  margin-right: auto;
  margin-left: auto;
  padding-right: 30px;
  padding-left: 30px;
}
@media screen and (max-width: 768px) {
  .wrapper {
    max-width: calc(720px - (30px));
    padding-right: 20px;
    padding-left: 20px;
    margin-top: 50px;
  }
  .wrapper.blurry {
    animation: 0.2s ease-in forwards blur;
    -webkit-animation: 0.2s ease-in forwards blur;
    filter: blur(5px);
    -webkit-filter: blur(5px);
    position: static; 
    z-index: auto;    
  }
}

/* Mobile: use initial viewport height to avoid background resizing on scroll */

@media screen and (max-width: 768px) {
  body::before {
    /* 使用 head 裡腳本在載入時設定的 --vh 值，避免滾動時背景尺寸跳動 */
    height: calc(var(--vh, 1vh) * 100);
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto; /* 使用 height 來決定高度，不用 bottom:0 */
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
  }
}



u {
  text-decoration-color: #d2c7c7;
}

small {
  font-size: 14px;
}

sup {
  border-radius: 10%;
  top: -3px;
  left: 2px;
  font-size: small;
  position: relative;
  margin-right: 2px;
}

.overflow-table {
  overflow-x: auto;
}

table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
  font-size: 14px;
}
table thead {
  font-weight: 700;
  color: #0d122b;
  border-bottom: 1px solid #ececec;
}
table th,
table td,
table tr {
  padding: 2px 7px;
  text-align: center;
}

.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.6);
}

.image-preview-modal .modal-backdrop {
    position: absolute;
    top:0; left:0;
    width:100%; height:100%;
    background: rgba(0,0,0,0.6);
    z-index: -1;
}

.image-preview-modal .modal-content {
    position: relative;
    z-index: 1;
}

.post-item:after, .navbar:after, .wrapper:after {
  content: "";
  display: table;
  clear: both;
}

::-moz-selection {
  background: #fffba0;
  color: #0d122b;
}

mark,
::selection {
  background: #fffba0;
  color: #0d122b;
}

.gist table {
  border: 0;
}
.gist table tr,
.gist table td {
  border: 0;
}

/*------------------Navbar----------------------*/

.navbar {
  height: auto;
  max-width: calc(890px - 30px * 2);
  max-width: -webkit-calc(890px - (30px * 2));
  position: relative;
  margin-right: auto;
  margin-left: auto;
  border-bottom: 1px solid #ececec;
  padding: 15px 30px;
  /* Ensure navbar is above other content */
  z-index: 1000; /* Increased z-index */
}

.menu {
  -moz-user-select: none;
       user-select: none;
  -ms-user-select: none;
  -webkit-user-select: none;
}
.menu a#mode {
  float: left;
  left: 8px;
  top: 6px;
  position: relative;
  clear: both;
  transform: scale(1, 1);
  opacity: 0.7;
  z-index: 1;
}
.menu a#mode:hover {
  cursor: pointer;
  opacity: 1;
}
.menu a#mode:active {
  transform: scale(0.9, 0.9);
}
.menu a#mode .mode-moon {
  display: block;
}
.menu a#mode .mode-moon line {
  stroke: #0d122b;
  fill: none;
}
.menu a#mode .mode-moon circle {
  fill: #0d122b;
  stroke: #0d122b;
}
.menu a#mode .mode-sunny {
  display: none;
}
.menu a#mode .mode-sunny line {
  stroke: #eaeaea;
  fill: none;
}
.menu a#mode .mode-sunny circle {
  fill: none;
  stroke: #eaeaea;
}
.menu .trigger {
  float: right;
  /* Ensure trigger is above other content */
  z-index: 1001; /* Increased z-index */
}
.menu .menu-trigger {
  display: none;
}
.menu .menu-icon {
  display: none;
}
.menu .menu-link {
  color: #0d122b;
  line-height: 2.25;
  text-decoration: none;
  padding: 5px 8px;
  opacity: 0.7;
  letter-spacing: 0.3px;
  font-style: normal;
}
/* 保证菜单项不换行，容器内容可收缩 */
.trigger-container {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
}
.trigger-container .menu-link {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu .menu-link:hover {
  opacity: 1;
}
.menu .menu-link:not(:last-child) {
  margin-right: 5px;
}
.menu .menu-link.rss {
  position: relative;
  bottom: -3px;
  outline: none;
}
@media screen and (max-width: 768px) {
  .menu .menu-link {
    opacity: 0.8;
  }
}
.menu .menu-link.active {
  opacity: 1;
  font-weight: 600;
}
@media screen and (max-width: 768px) {
  .menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    text-align: center;
    height: 50px;
    background-color: #fff;
    border-bottom: 1px solid #ececec;
    z-index: 1000;
  }
  .menu a#mode {
    left: 10px;
    top: 12px;
  }
  .menu .menu-icon {
    display: block;
    position: absolute;
    right: 0;
    width: 50px;
    height: 23px;
    line-height: 0;
    padding-top: 13px;
    padding-bottom: 15px;
    cursor: pointer;
    text-align: center;
    z-index: 1001;
  }
  .menu .menu-icon > svg {
    fill: #0d122b;
    opacity: 0.7;
  }
  .menu .menu-icon:hover > svg {
    opacity: 1;
  }
  .menu .menu-icon:active {
    transform: scale(0.9, 0.9);
  }
  .menu input[type=checkbox]:not(:checked) ~ .trigger {
    clear: both;
    visibility: hidden;
  }
  .menu input[type=checkbox]:checked ~ .trigger {
    position: fixed;
    animation: 0.2s ease-in forwards fadein;
    -webkit-animation: 0.2s ease-in forwards fadein;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    height: 100vh;
    width: 100%;
    top: 0;
    z-index: 999;
  }
  .menu .menu-link {
    display: block;
    box-sizing: border-box;
    font-size: 1.1em;
  }
  .menu .menu-link:not(:last-child) {
    margin: 0;
    padding: 2px 0;
  }
}

/* 移动设备菜单项换行显示 */
@media screen and (max-width: 768px) {
  .trigger-container {
    flex-wrap: wrap; /* 允许换行 */
    flex-direction: column; /* 垂直排列 */
    align-items: stretch;   /* 拉伸到100%宽 */
  }
  .trigger-container .menu-link {
    white-space: normal;    /* 允许文本换行 */
    min-width: 0;
    overflow: visible;
    text-overflow: unset;
    width: 100%;            /* 每个菜单项占满一行 */
    display: block;
    box-sizing: border-box;
  }
}
/*-------------------以上Navbar-------------------*/

.author {
  margin-top: 6.3rem;
  margin-bottom: 7.2rem;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
}
@media screen and (max-width: 768px) {
  .author {
    margin-bottom: 3em;
  }
}
.author .author-avatar-wrapper {
  border-width: 1px;
  border-color: b6b6b6;
  width: 70px;
  height: 70px;
  border-radius: 100%;
  -moz-user-select: none;
       user-select: none;
  background-color: #0d122b;
  -ms-user-select: none;
  -webkit-user-select: none;
  animation: 0.5s ease-in forwards fadein;
  opacity: 1;
  overflow: hidden;
}
.author .author-avatar {
  transition: 0.6s;
}
.author .author-avatar:hover {
  transform: scale(1.2);
}
.author .author-name {
  font-size: 1.7em;
  margin-bottom: 2px;
}
.author .author-bio {
  margin: 0 auto;
  opacity: 0.9;
  max-width: 393px;
  line-height: 1.688;
}

.posts-item-note {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #0d122b;
}

.post-item {
  display: flex;
  padding-top: 5px;
  padding-bottom: 6px;
}
.post-item:not(:first-child) {
  /* border-top: 1px solid #ececec; */
  border-top: none;
}
.post-item .post-item-date {
  min-width: 96px;
  color: #0d122b;
  font-weight: 700;
  padding-right: 10px;
}
@media screen and (max-width: 768px) {
  .post-item .post-item-date {
    font-size: 16px;
  }
}
.post-item .post-item-title {
  flex: 1;
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 16px;
  font-weight: normal;
  letter-spacing: 0.1px;
}
.post-item .post-item-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.post-item .post-item-heading .post-item-title {
  flex: 0 1 auto;
}
.post-item .post-item-title a {
  color: #434648;
}
.post-item .post-item-title a:hover, .post-item .post-item-title afocus {
  color: #0d122b;
}
.post-item .post-item-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.post-item .post-item-categories li {
  margin: 0;
}
.post-item .post-item-categories a {
  color: #6b7886;
  text-decoration: none;
}
.post-item .post-item-categories a:hover,
.post-item .post-item-categories a:focus {
  color: #0d122b;
}

.footer {
  margin-top: 8em;
  margin-bottom: 2em;
  text-align: center;
}
@media screen and (max-width: 768px) {
  .footer {
    margin-top: 3em;
  }
}
.footer span.footer_item {
  color: #0d122b;
  opacity: 0.8;
  font-weight: 700;
  font-size: 14px;
}
.footer a.footer_item {
  color: #0d122b;
  opacity: 0.8;
  text-decoration: none;
}
.footer a.footer_item:not(:last-child) {
  margin-right: 10px;
}
.footer a.footer_item:not(:last-child):hover {
  opacity: 1;
}
.footer .footer_copyright {
  font-size: 13px;
  margin-top: 3px;
  display: block;
  color: #6b7886;
  opacity: 0.8;
}

.not-found {
  text-align: center;
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 75vh;
}
.not-found .title {
  font-size: 5em;
  font-weight: 700;
  line-height: 1.1;
  color: #0d122b;
  text-shadow: 1px 0px 0px #f66;
}
.not-found .phrase {
  color: #434648;
}
.not-found .solution {
  color: #f66;
  letter-spacing: 0.5px;
}
.not-found .solution:hover {
  color: #0036c7;
}

.search-article {
  position: relative;
  margin-bottom: 50px;
}
.search-article label[for=search-input] {
  position: relative;
  top: 10px;
  left: 11px;
}
.search-article input[type=search] {
  top: 0;
  left: 0;
  border: 0;
  width: 100%;
  height: 40px;
  outline: none;
  position: absolute;
  border-radius: 5px;
  padding: 10px 10px 10px 35px;
  color: #434648;
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px;
  background-color: rgba(128, 128, 128, 0.1);
  border: 1px solid rgba(128, 128, 128, 0.1);
}
.search-article input[type=search]::-webkit-input-placeholder {
  color: #808080;
}
.search-article input[type=search]::-webkit-search-decoration, .search-article input[type=search]::-webkit-search-results-decoration {
  display: none;
}

#search-results {
  text-align: center;
}
#search-results li {
  text-align: left;
}

.archive-tags {
  height: auto;
}
.archive-tags .tag-item {
  padding: 1px 3px;
  border-radius: 2px;
  border: 1px solid rgba(128, 128, 128, 0.1);
  background-color: rgba(128, 128, 128, 0.1);
}

.list-year {
  display: flex;
  justify-content: space-between;
}

.icon {
  width: 1.5em;
  height: 1.5em;
  fill: currentColor;
  display: inline-block;
}

svg {
  vertical-align: middle;
}

.gutter pre {
  color: #999;
}

pre {
  color: #525252;
}

pre .function .keyword,
pre .constant {
  color: #0092db;
}

pre .keyword,
pre .attribute {
  color: #e96900;
}

pre .number,
pre .literal {
  color: #ae81ff;
}

pre .tag,
pre .tag .title,
pre .change,
pre .winutils,
pre .flow,
pre .lisp .title,
pre .clojure .built_in,
pre .nginx .title,
pre .tex .special {
  color: #2973b7;
}

pre .class .title {
  color: #6af;
}

pre .symbol,
pre .symbol .string,
pre .value,
pre .regexp {
  color: #42b983;
}

pre .title {
  color: #a6e22e;
}

pre .tag .value,
pre .string,
pre .subst,
pre .haskell .type,
pre .preprocessor,
pre .ruby .class .parent,
pre .built_in,
pre .sql .aggregate,
pre .django .template_tag,
pre .django .variable,
pre .smalltalk .class,
pre .javadoc,
pre .django .filter .argument,
pre .smalltalk .localvars,
pre .smalltalk .array,
pre .attr_selector,
pre .pseudo,
pre .addition,
pre .stream,
pre .envvar,
pre .apache .tag,
pre .apache .cbracket,
pre .tex .command,
pre .prompt {
  color: #42b983;
}

pre .comment,
pre .java .annotation,
pre .python .decorator,
pre .template_comment,
pre .pi,
pre .doctype,
pre .deletion,
pre .shebang,
pre .apache .sqbracket,
pre .tex .formula {
  color: #b3b3b3;
}

pre .coffeescript .javascript,
pre .javascript .xml,
pre .tex .formula,
pre .xml .javascript,
pre .xml .vbscript,
pre .xml .css,
pre .xml .cdata {
  opacity: 0.5;
}

.post .highlight,
.post .highlight table {
  margin: 0;
  width: 100%;
}

.post .highlight {
  overflow-x: auto;
  margin: 10px 0;
}

.post .highlight table,
.post .highlight tr,
.post .highlight td {
  padding: 0;
  border-collapse: collapse;
}

.post code {
  background-color: #ffffff6b;
}

.post code {
  font-family: "Roboto Mono", "Menlo", "Consolas", monospace;
  font-size: 13px;
  padding: 3px 10px;
  margin: 0 5px;
  border-radius: 2px;
}

.post code.glass-wrapper.code-bg {
  background-color: #ffffff6b;
}

html[data-theme=dark] .post code {
  background-color: #0000006b;
}

html[data-theme=dark] .post code.glass-wrapper.code-bg {
  background-color: #0000006b;
}

.post pre {
  font-family: "Roboto Mono", "Menlo", "Consolas", monospace;
  font-size: 13px;
  overflow-x: auto;
  text-align: left;
  padding: 15px 25px;
  line-height: 1.5em;
}

.post .code pre {
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.post .gutter pre {
  padding: 15px 0 15px 15px;
  color: #75715e;
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

.post blockquote {
  margin: 2em 0;
  padding-left: 30px;
  border-left: 5px solid #0d122b;
}

.post blockquote p {
  font-size: 17px;
  font-style: italic;
  line-height: 1.8em;
  color: #24333e;
}

.post .highlight:before {
  color: #6b7f94;
  opacity: 0.3;
  content: attr(data-lang);
  font-size: 1.9em;
  font-weight: 700;
  position: absolute;
  right: 0.3rem;
}

/* ---------- 強制文章單張圖片置中（放在檔案最末以確保優先） ---------- */
.post p:only-child > img,
.post p:only-child > a > img,
.post p > img:only-child,
.post p > a > img:only-child,
.post figure:only-child > img,
.post figure > img,
.page-content p:only-child > img,
.post-content p:only-child > img {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  height: auto !important;
}

/* 支援手動加 class 的情況 */
.post img.align-center,
.post img.center,
.page-content img.align-center,
.page-content img.center {
  display: block !important;
  margin: 0 auto !important;
}

/* ---------- mobile：修正 body::before 覆蓋與 safe-area 問題 ---------- */
/* ---------- mobile: 修正 body::before 覆蓋與平滑放大背景（避免滑動時跳動/灰條） ---------- */
@media screen and (max-width: 768px) {
  html, body {
    min-height: 100%;
    overflow-x: hidden;
    position: relative;
  }

  body {
    background-color: #fff;
  }

  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* ✅ 用 viewport 寬 */
    height: 100vh; /* ✅ 固定高度由 JS 控制 */
    pointer-events: none;
    z-index: -1;

    background:
      linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)),
      url('https://raw.githubusercontent.com/slhs1121505/slhs1121505/refs/heads/main/G1HuJgLaQAEJBTT.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover; 
    background-attachment: scroll; 

    transition: transform 0.3s ease;
  }
}


@media screen and (max-width: 768px) {
  .wrapper .post {
    padding-left: 15px;
    padding-right: 15px;
  }
}

.header {
  margin-top: 2.8em;
  margin-bottom: 3em;
}
.header .tags {
  margin-left: 3px;
  letter-spacing: 0.5px;
}
.header .tags .tag {
  font-weight: 700;
  font-size: 12px;
  margin-right: 0.5rem;
}
.header .tags .tag:hover {
  text-decoration: none;
}
.header .header-title {
  position: relative;
  font-size: 2em;
  line-height: 1.2;
  margin-top: 10px;
  margin-bottom: 20px;
}
.header .header-title:not(.header-title.center)::before {
  content: "";
  border-left: 5px solid #f66;
  position: absolute;
  left: -15px;
  height: 75%;
  top: 12%;
}
.header .header-title.center {
  text-align: center;
}
@media screen and (max-width: 768px) {
  .header .header-title {
    font-size: 1.9em;
  }
}

.post-meta {
  padding-top: 3px;
  line-height: 1.3;
  color: #6b7886;
}
.post-meta time {
  position: relative;
}
.post-meta time::after {
  background: #ececec;
  bottom: 1px;
  height: 2px;
  position: absolute;
  right: -20px;
  width: 12px;
}
.post-meta span[itemprop=author] {
  border-bottom: 1px dotted #ececec;
}

.post {
  padding-top: 2px;
  word-break: break-all;
  overflow-wrap: break-word;
}
.post iframe {
  text-align: center;
}
.post figure img {
  border-radius: 2px;
}
.post figure figcaption {
  margin-top: 5px;
  font-style: italic;
  font-size: 14px;
}
.post a {
  color: #f66;
}
.post a:hover {
  color: #f33;
  border-bottom-color: #f33;
}
.post a:focus {
  color: #f66;
}
.post > p {
  margin: 0;
  padding-top: 15px;
  padding-bottom: 15px;
}
.post ul.task-list {
  list-style: none;
  margin: 0;
}
.post ul.task-list li::before {
  content: "";
}
.post ul.task-list li input[type=checkbox] {
  margin-right: 10px;
}
.post dl dt {
  font-weight: 700;
}
.post .post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.post h6 {
  color: #0d122b;
  font-weight: 700;
  margin-top: 30px;
  margin-bottom: 0;
}
.post .post h1:hover .headerlink,
.post h2:hover .headerlink,
.post h3:hover .headerlink,
.post h4:hover .headerlink,
.post h5:hover .headerlink,
.post h6:hover .headerlink {
  color: #f66;
  opacity: 1;
}
.post .post h1 .headerlink,
.post h2 .headerlink,
.post h3 .headerlink,
.post h4 .headerlink,
.post h5 .headerlink,
.post h6 .headerlink {
  position: relative;
  opacity: 0;
  outline: none;
}
.post .post h1 .headerlink::before,
.post h2 .headerlink::before,
.post h3 .headerlink::before,
.post h4 .headerlink::before,
.post h5 .headerlink::before,
.post h6 .headerlink::before {
  content: "#";
  position: absolute;
  right: -3px;
  width: 1em;
  font-weight: 700;
}
.post h1 {
  font-size: 35px;
}
.post h2 {
  font-size: 30px;

}
.post h3 {
  font-size: 23px;
  border-bottom: 1px solid #ececec;
  padding-bottom: 4px;

}
.post h4 {
  font-size: 20px;

}
.post h5 {
  font-size: 16px;

}
.post h6 {
  font-size: 14px;
}


/* 改良版 post-nav 規則：確保左右對齊、統一內距、單一項目行為正確、手機堆疊可控 */

/* 改良版 post-nav：統一邊距，單/雙項目呈現一致 */

/* post-nav：桌面左右平均分欄、手機垂直堆疊且每個項目 100% */

/* 父容器統一留白 */
.post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-top: 5em;
  border-top: 1px solid #ececec;
  line-height: 1.4;
  gap: 0;
  padding: 0 18px;
}

/* 手機預設：每個 item 100%（mobile-first 基礎） */
.post-nav .post-nav-item {
  box-sizing: border-box;
  padding: 12px 0;        /* 垂直內距，左右空間由父容器 padding 決定 */
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  width: 100%;
  flex: none;
  display: block;
}

/* 讓內部的 <a> 撐滿整個 item（避免內部為 inline 導致看起來窄）*/
.post-nav .post-nav-item > a {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 讓標題與箭頭分左右 */
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
  padding: 0; /* 已由 .post-nav-item 控制上下 padding */
}

/* 文字與 hover */
.post-nav .post-nav-item .post-title { color: #0d122b; }
.post-nav .post-nav-item:hover .post-title,
.post-nav .post-nav-item:focus .post-title { color: #0036c7; opacity: 0.9; }
.post-nav .post-nav-item .nav-arrow {
  font-weight: 400;
  font-size: 14px;
  color: #6b7886;
  margin-bottom: 3px;
}

/* 只控制文字對齊（不在 prev/next 放左右 padding） */
.post-nav .post-nav-prev { text-align: left; order: 1; }
.post-nav .post-nav-next { text-align: right; order: 2; }

/* ===== 桌面：兩個 item 各 50%（並且單一項目仍為 50% box） ===== */
@media screen and (min-width: 769px) {
  .post-nav {
    /* 桌面仍使用同一父容器 padding */
  }

  /* 桌面每個 item 固定為 50%（包含單一項目） */
  .post-nav .post-nav-item {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    padding: 12px 0;
    display: block;
    min-width: 0; /* 允許內部斷行，避免撐開 */
  }

  /* 若只有一個 item（:only-child），在桌面也維持 50% 的 box */
  .post-nav .post-nav-item:only-child {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    display: block;
    padding-left: 0;
    padding-right: 0;
  }

  /* 如果單一的是 next，將該 50% 推到右邊；如果是 prev，預設左邊 */
  .post-nav .post-nav-next:only-child { margin-left: auto; }
  .post-nav .post-nav-prev:only-child { margin-right: auto; }
}

/* ===== 手機：垂直堆疊，並強制每個 item 100%（不再縮在中間） ===== */
@media screen and (max-width: 768px) {
  .post-nav {
    flex-direction: column;
    gap: 0;
    font-size: 14px;
    padding: 0 16px;
  }

  .post-nav .post-nav-item {
    width: 100% !important;
    flex: none !important;
    max-width: none !important;
    padding: 12px 0;
    box-sizing: border-box;
    display: block;
  }

  /* 內部 a 同樣佔滿 */
  .post-nav .post-nav-item > a {
    display: block;
    width: 100%;
    align-items: center;
    justify-content: space-between;
  }

  .post-nav .post-nav-next {
    border-top: 1px solid #ececec;
    padding-top: 10px;
  }

  .post-nav .post-nav-item:only-child {
    width: 100% !important;
    display: block;
    margin: 0;
  }
}
/* -----------------------------tag 页面的毛玻璃效果------------------------- */
.tags-container a {
    /* 基础样式 */
  padding: 8px 12px;
  margin-right: 10px;
  margin-bottom: 8px;
  display: inline-block;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative; /* 关键：让伪元素定位生效 */
  overflow: visible;  /* 避免下划线被裁剪 */
  
  /* 禁止换行 */
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.tags-container {
  display: inline-block;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  padding-left: 20px;
  color: #333;
}

.tags-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px 0 rgba(31, 38, 135, 0.12);
  color: #2196F3;
}

html[data-theme=dark] .tags-container {
  /* 文字颜色 */
  color: #f0f0f0;
}

html[data-theme=dark] .tags-container:hover {
  box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.25);
  color: #64b5f6;
}
/* -------------------------以上是 tag 页面的毛玻璃效果---------------------- */

/*----------------------------------分类页面分列----------------------------*/
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.category-item {
  margin-bottom: 1rem;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}



.category-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.15);
}

html[data-theme=dark] .category-item:hover {
  box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.37);
}

.category-item a {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  text-align: center;
  border-radius: 16px;
  transition: color 0.3s ease;
}

/* 禁用分类链接的下划线效果 */
.category-item a::after {
  display: none !important;
}

.category-item a:hover {
  color: #2196F3;
}

html[data-theme=dark] .category-item a {
  color: #f0f0f0;
}

html[data-theme=dark] .category-item a:hover {
  color: #64b5f6;
}
/*----------------------------------以上分类页面分列----------------------------*/

.dis {
  margin-top: 5em;
}

.dis .btn {
  display: block;
  padding: 10px;
  background-color: #f6f8fa;
  text-align: center;
}
.dis .btn:hover {
  background-color: #f66;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  cursor: pointer;
}

@keyframes fadein {
  0% {
    opacity: 0.2;
  }
  100% {
    opacity: 0.8;
  }
}
@keyframes blur {
  0% {
    filter: blur(0px);
  }
  100% {
    filter: blur(4px);
  }
}
.embed-responsive {
  height: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  padding-bottom: 56.25%;
  margin-top: 20px;
}
.embed-responsive iframe,
.embed-responsive object,
.embed-responsive embed {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
}

html[data-theme=dark] h1,
html[data-theme=dark] h2,
html[data-theme=dark] h3,
html[data-theme=dark] h4,
html[data-theme=dark] h5,
html[data-theme=dark] h6 {
  color: #eaeaea;
}

html[data-theme=dark] table thead {
  color: #eaeaea;
  border-color: #1b1d25;
}
html[data-theme=dark] table th,
html[data-theme=dark] table td,
html[data-theme=dark] table tr {
  border-color: #1b1d25;
}
html[data-theme=dark] .post a {
  color: #ff5277;
}
html[data-theme=dark] .post a:hover, html[data-theme=dark] .post a:active, html[data-theme=dark] .post a:focus {
  color: #ff2957;
}
html[data-theme=dark] .post h3 {
  border-color: #1b1d25;
}
html[data-theme=dark] .post h1 .anchor-head,
html[data-theme=dark] .post h2 .anchor-head,
html[data-theme=dark] .post h3 .anchor-head,
html[data-theme=dark] .post h4 .anchor-head,
html[data-theme=dark] .post h5 .anchor-head,
html[data-theme=dark] .post h6 .anchor-head {
  color: #ff5277;
}
html[data-theme=dark] code.highlighter-rouge {
  background-color: #1b1d25;
}
html[data-theme=dark] kbd {
  border-color: #1b1d25;
  color: #eaeaea;
  text-shadow: 0 1px 0 #131418;
}
html[data-theme=dark] hr {
  border-color: #1b1d25;
}
html[data-theme=dark] .post-meta {
  color: #767f87;
}
html[data-theme=dark] .post-meta time::after {
  background-color: #1b1d25;
}
html[data-theme=dark] .post-meta span[itemprop=author] {
  border-color: #1b1d25;
}
html[data-theme=dark] a {
  color: inherit;
  text-decoration-color: #4a4d56;
}
html[data-theme=dark] a:hover {
  color: #ff5277;
}
html[data-theme=dark] a:focus {
  outline-color: rgba(255, 82, 119, 0.6);
}
html[data-theme=dark] li:before {
  color: #eaeaea;
}
html[data-theme=dark] blockquote {
  color: #767f87;
  border-color: #000000;
  border-left: 5px solid #eaeaea;
}
html[data-theme=dark] .post blockquote p{
  color: #a7a7a7;
}
html[data-theme=dark] strong,
html[data-theme=dark] b {
  color: #eaeaea;
}
html[data-theme=dark] .navbar {
  border-color: #1b1d25;
}
html[data-theme=dark] .navbar .menu a#mode .mode-sunny {
  display: block;
}
html[data-theme=dark] .navbar .menu a#mode .mode-moon {
  display: none;
}
html[data-theme=dark] .navbar .menu .menu-link {
  color: #eaeaea;
}
@media screen and (max-width: 768px) {
  html[data-theme=dark] .navbar .menu {
    background-color: #131418;
    border-color: #1b1d25;
  }
  html[data-theme=dark] .navbar .menu .menu-icon > svg {
    fill: #eaeaea;
  }
  html[data-theme=dark] .navbar .menu input[type=checkbox]:checked ~ .trigger {
    background: #131418;
  }
}
html[data-theme=dark] .post-item:not(:first-child) {
  border-color: #1b1d25;
}
html[data-theme=dark] .post-item .post-item-date {
  color: #eaeaea;
}
html[data-theme=dark] .post-item .post-item-title a {
  color: #c7bebe;
}
html[data-theme=dark] .post-item .post-item-title a:hover, html[data-theme=dark] .post-item .post-item-title afocus {
  color: #eaeaea;
}
html[data-theme=dark] .post-item .post-item-categories a {
  color: #9aa5ba;
}
html[data-theme=dark] .post-item .post-item-categories a:hover,
html[data-theme=dark] .post-item .post-item-categories a:focus {
  color: #eaeaea;
}
html[data-theme=dark] .post-nav {
  border-color: #1b1d25;
}
html[data-theme=dark] .post-nav .post-nav-item {
  font-weight: 700;
}
html[data-theme=dark] .post-nav .post-nav-item .post-title {
  color: #eaeaea;
  opacity: 0.9;
}
html[data-theme=dark] .post-nav .post-nav-item:hover .post-title, html[data-theme=dark] .post-nav .post-nav-item:focus .post-title {
  color: #ff2957;
}
html[data-theme=dark] .post-nav .post-nav-item .nav-arrow {
  color: #767f87;
}
@media screen and (max-width: 768px) {
  html[data-theme=dark] .post-nav .post-nav-item:nth-child(even) {
    border-color: #1b1d25;
  }
}
html[data-theme=dark] .footer span.footer_item {
  color: #eaeaea;
}
html[data-theme=dark] .footer a.footer_item:not(:last-child) {
  color: #eaeaea;
}
html[data-theme=dark] .footer .footer_copyright {
  color: #767f87;
  opacity: 1;
}
html[data-theme=dark] .not-found .title {
  color: #eaeaea;
  text-shadow: 1px 0px 0px #ff5277;
}
html[data-theme=dark] .not-found .phrase {
  color: #c7bebe;
}
html[data-theme=dark] .not-found .solution {
  color: #ff5277;
}
html[data-theme=dark] .not-found .solution:hover {
  color: #ff2957;
}
html[data-theme=dark] .search-article input[type=search] {
  color: #c7bebe;
}
html[data-theme=dark] .search-article input[type=search]::-webkit-input-placeholder {
  color: rgba(128, 128, 128, 0.8);
}/*# sourceMappingURL=main.css.map */

html[data-theme=dark] .post code {
  background-color: #0000006b;
}


/*----------------------------------文章页面右下角两个按钮的设置---------------------------------*/
@media (max-width: 768px) {
  #toggleButton {
    display: none;

  }
  #toggleButton i{
    display: none;

  }

  #toTopBtn {
    display: none;
    position: fixed;
    bottom: 10vh;
    right: 10vh;

  }
  #toTopBtn i{
    display: none;

  }
}

#toggleButton {
  width: 10px; /* 设置宽度 */
  height: 10px; /* 设置高度，确保是方形 */
  background-color: rgba(255, 255, 255, 0); /* 背景颜色 */
  border-radius: 10px; /* 圆角半径，设置圆角效果 */
  padding: 10px; /* 内边距 */
  border: none; /* 边框样式 */
  position: fixed; /* 固定定位 */
  bottom: 10vh;
  right: 10vh;
  z-index: 10002;
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center;     /* 垂直居中 */
}

#toggleButton:hover {
  background-color: #0098b3;
}

/* 半透明遮罩层 */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

/* 目录内容样式 */
.overlay .content {
  padding: 20px;
  border-radius: 10px;
  width: 100%;
  text-align: center;
  overflow-y: auto;
  z-index: 10001;
  max-height: 80%;
  display: flex;
  justify-content: center;
  pointer-events: auto; 
}

/* 关闭按钮样式 */
#closeButton {
  width: 5px; /* 设置宽度 */
  height: 5px; /* 设置高度，确保是方形 */
  background-color: #ffffff00; /* 背景颜色 */
  border-radius: 10px; /* 圆角半径，设置圆角效果 */
  padding: 10px; /* 内边距 */
  border: none; /* 边框样式 */
  position: fixed; /* 固定定位 */
  bottom: 10vh;
  right: 10vh;
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center;     /* 垂直居中 */
  z-index: 10003;
}

#closeButton:hover {
  background-color: #b30000;
}



#toggleButton i{
  font-size: 40px;
}

html[data-theme=dark] #toggleButton i{
  color: #c7bebe;
}

#closeButton i{
  font-size: 40px;
}

html[data-theme=dark] #closeButton i{
  color: #c7bebe;
}

/* 目录样式 */

span.toc-text{
  color: black;
}

html[data-theme=dark] span.toc-text{
  color: #c7bebe;
}


#toTopBtn {
  width: 10px; /* 设置宽度 */
  height: 10px; /* 设置高度，确保是方形 */
  background-color: rgba(255, 255, 255, 0); /* 背景颜色 */
  border-radius: 10px; /* 圆角半径，设置圆角效果 */
  padding: 10px; /* 内边距 */
  border: none; /* 边框样式 */
  position: fixed; /* 固定定位 */
  bottom: 10vh;
  right: 10vh;
  z-index: 997;
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center;     /* 垂直居中 */
}

#toTopBtn:hover {
  background-color: #c902dc;
}

#toTopBtn i{
  font-size: 45px;
}

html[data-theme=dark] #toTopBtn i{
  color: #c7bebe;
}

/*----------------------------------以上文章页面右下角两个按钮的设置---------------------------------*/

/*----------------------------------代码块样式--------------------------------------------*/
html[data-theme=dark] span.line {
  color: #cccccc;
}

html[data-theme=dark] span.comment {
  color: #666666;
}

html[data-theme=dark] table tbody tr pre{
  background-color: #0000006b;
}

html[data-theme=dark] table tbody tr pre.glass-wrapper.pre-bg{
  background-color: #0000006b;
}

.post pre{
  background-color: #ffffff6b;
}

.post pre.glass-wrapper.pre-bg{
  background-color: #ffffff6b;
  font-family: "Roboto Mono", "Menlo", "Consolas", monospace;
  font-size: 13px;
  overflow-x: auto;
  text-align: left;
  line-height: 1.5em;
}
span.type{
  color: #0049db;
}
span.title{
  color: #ff5277;
}
span.comment {
  color: #939393;
}

/*----------------------------------以上代码块样式--------------------------------------------*/

/*----------------------------------markdownit渲染器的防剧透插件---------------------------------*/
span.spoiler{
  background-color: #d4d9db;
  color: #d4d9db;
}
span.spoiler:hover{
  color: black !important
}
html[data-theme=dark] span.spoiler{
  background-color: #1b1d25;
  color: #1b1d25;
}

html[data-theme=dark] span.spoiler:hover{
  color: #c7bebe !important
}
/*----------------------------------以上markdownit渲染器的防剧透插件----------------*/

/*----------------------------------分页按钮---------------------------------*/

.pagination { margin-top: 20px; text-align: center; height: 50px;}
.pagination a, .pagination span { 
    margin: 5px; padding: 8px 12px; cursor: pointer; 
    border: none; background-color: transparent; 
    font-size: 16px; font-weight: normal;
    transition: all 0.3s ease;
}

span.page-number.current{
  color: #3498db;
}
/*----------------------------------以上分页按钮---------------------------------*/


.hexo-tips-layout{
  background-color: var(--tips-light-bg);
}
html[data-theme=dark] .hexo-tips-layout{
  background-color: var(--tips-dark-bg);
}



/*----------------------------------markdownit渲染器的脚注插件----------------*/
.footnote-item{
  font-size: 13px;
  margin-top: 23px;
}
/*----------------------------------以上markdownit渲染器的脚注插件----------------*/

/*----------------------------------链接样式重写----------------*/
a {
  position: relative;
  text-decoration: none; /* 移除默认下划线 */
  color: #333;
}

a::after {
  content: '';
  position: absolute;
  left: 50%; /* 从中间开始 */
  bottom: -2px;
  width: 0;
  height: 2px;
  background: #ff5277;
  transition: width 0.3s ease, left 0.3s ease; /* 同时动画 */
}

a:hover::after {
  left: 0; /* 扩展到左侧 */
  width: 100%; /* 扩展到右侧 */
}

/*----------------------------------以上链接样式重写----------------*/

/*----------------------------------此为归档页面设置----------------------------------*/

/* 归档容器 */
.archive-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0rem 1rem;
}

.archive-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
  text-align: center;
}

/* 按月归档 */
.monthly-archives {
  margin-top: 2rem;
}

.archive-month-group {
  margin-bottom: 2.5rem;
}

.archive-month-title {
  font-size: 1.5rem;
  color: #444;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.post-count {
  font-size: 1rem;
  color: #999;
  font-weight: normal;
}

/* 文章列表 */
.archive-post-list {
  list-style: none;
  padding-left: 0;
}

.archive-post-item {
  margin-bottom: 1.2rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}



.archive-post-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.15);
}

html[data-theme=dark] .archive-post-item:hover {
  box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.37);
}

.post-date {
  display: inline-block;
  width: 3rem;
  color: #666;
  font-size: 0.9rem;
}

.post-title {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.post-title:hover {
  color: #2196F3;
}

/* 标签样式 */
.post-tags .tag {
  flex: auto;
  font-size: 0.8rem;
  color: #888;
  margin-right: 0.5rem;
  text-decoration: none;
  white-space: nowrap;    /* 不换行，防止断字 */
  word-break: keep-all;   /* 保持单词整体 */
  overflow-wrap: normal;
  display: inline-block;  /* 保证同行显示 */
  vertical-align: middle;
}

.post-tags .tag {
  font-size: 0.8rem;
  color: #888;
  margin-right: 0.5rem;
  text-decoration: none;
}

.post-tags .tag:hover {
  color: #2196F3;
}

.archive-month-group {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 为每个月份添加延迟动画 */
.archive-month-group:nth-child(1) { animation-delay: 0.1s; }
.archive-month-group:nth-child(2) { animation-delay: 0.2s; }
.archive-month-group:nth-child(3) { animation-delay: 0.3s; }
/* 以此类推... */

/* 年份折叠样式 */
.archive-year-group {
  margin-bottom: 2rem;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

.year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f8f8;
  cursor: pointer;
}

.archive-year-title {
  margin: 0;
  font-size: 1.4rem;
  color: #333;
}

.year-toggle {
  background: #2196F3;
  color: white;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.year-toggle:hover {
  background: #0d8bf2;
}

.year-content {
  padding: 0 1rem;
  transition: all 0.3s ease;
}

.year-content.collapsed {
  display: none;
}
/*----------------------------------以上归档页面设置----------------------------------*/

/*----------------------------------毛玻璃效果----------------------------*/
.glass-wrapper {
  /* 日间模式毛玻璃效果 */
  background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.45));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  border-radius: 16px;
  transition: all 0.3s ease;
  padding: 20px;
  z-index: 0; 
  
  /* 添加渐入动画 */
  opacity: 0;
  animation: glassSlideIn 0.8s ease forwards;
}

/* 为不同的毛玻璃元素添加延迟动画 */
.glass-wrapper:nth-child(1) { animation-delay: 0.1s; }
.glass-wrapper:nth-child(2) { animation-delay: 0.2s; }
.glass-wrapper:nth-child(3) { animation-delay: 0.3s; }
.glass-wrapper:nth-child(4) { animation-delay: 0.4s; }
.glass-wrapper:nth-child(5) { animation-delay: 0.5s; }

/* 添加可选的浮动动画类 */
.glass-wrapper.floating {
  animation: glassSlideIn 0.8s ease forwards, glassFloat 6s ease-in-out infinite;
  animation-delay: 0.1s, 1.2s;
}

/* 添加可选的模糊变化动画类 */
.glass-wrapper.blur-shifting {
  animation: glassSlideIn 0.8s ease forwards, blurShift 8s ease-in-out infinite;
  animation-delay: 0.1s, 1.5s;
}

html[data-theme=dark] .glass-wrapper {
  /* 深色背景毛玻璃效果 */
  background: linear-gradient(rgba(40, 40, 40, 0.6), rgba(40, 40, 40, 0.5));
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 悬停时的增强动画效果 - 使用阴影增强立体抬升感 */
.glass-wrapper:hover {
  transform: translateY(-10px) scale(1.01);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 16px 48px 0 rgba(31, 38, 135, 0.25), 
              0 8px 24px 0 rgba(31, 38, 135, 0.15);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html[data-theme=dark] .glass-wrapper:hover {
  box-shadow: 0 16px 48px 0 rgba(0, 0, 0, 0.5), 
              0 8px 24px 0 rgba(0, 0, 0, 0.3);
}

/*----------------------------------以上毛玻璃效果----------------------------*/

/*----------------------------------分类页面分列----------------------------*/
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
/*----------------------------------以上分类页面分列----------------------------*/

/*----------------------------------友链页面样式----------------------------*/

/* 卡片容器，使用 Grid 布局 */
.friends-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* 核心：讓所有卡片群組置中 */
  gap: 1.5rem;
  padding-top: 1rem;
}

.friends-container > * {
  flex: 0 0 280px; /* 每個卡片固定寬度 */
}
@keyframes glassSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 友链卡片本身 - 默认（日间）毛玻璃效果 */
.friends-card {
    --friend-order: 0;
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    opacity: 0;
    transform: translateY(24px);
    animation: glassSlideIn 0.8s ease forwards;
    animation-delay: calc(var(--friend-order, 0) * 0.08s);
}

/* 鼠标悬停在卡片上时的效果 */
.friends-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.15);
}

/* 朋友头像 */
.friends-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    margin-left: 1rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: border-color 0.3s ease;
}

/* 朋友信息容器 */
.friends-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 朋友名称 */
.friends-name {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    transition: color 0.3s ease;
}

/* 朋友简介 */
.friends-descr {
    margin: 0;
    font-size: 0.85rem;
    color: #4d4d4d;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* 当卡片具有 data-theme="dark" 属性时生效 */
html[data-theme=dark] .friends-card {
    /* 深色背景 */
    background: linear-gradient(rgba(40, 40, 40, 0.6), rgba(40, 40, 40, 0.5));
    /* 深色模式下的阴影 */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    /* 边框改为亮色以突出轮廓 */
    border: 1px solid rgba(255, 255, 255, 0.18);
}

html[data-theme=dark] .friends-card:hover {
    box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 夜间模式下的文字颜色 */
html[data-theme=dark] .friends-card .friends-name {
    color: #f0f0f0;
}

html[data-theme=dark] .friends-card .friends-descr {
    color: #c0c0c0;
}

/* 夜间模式下的头像边框 */
html[data-theme=dark] .friends-card .friends-avatar {
    border-color: rgba(255, 255, 255, 0.2);
}

/* 友链页面副标题居中 */
.friends-subtitle {
  text-align: center;
}

/* 移动设备响应式设计 */
@media (max-width: 768px) {
    .friends-container {
        gap: 1rem;
    }
}
/*----------------------------------以上友链页面样式----------------------------*/

/*----------------------------------移动设备显示优化----------------------------*/
/* 移动设备毛玻璃效果优化 */
@media screen and (max-width: 768px) {
  .glass-wrapper {
    border: none; /* 移除边框 */
    border-radius: 6px; /* 进一步减小圆角 */
    padding: 10px; /* 大幅减少内边距 */
    margin: 50px 5px 10px 5px; /* 减少左右边距 */
    box-shadow: 0 2px 12px 0 rgba(31, 38, 135, 0.03); /* 进一步减轻阴影 */
  }
  
  /* 减少容器的上下边距 */
  .wrapper {
    padding-right: 10px;
    padding-left: 10px;
  }
  
  /* 文章内容区域优化 */
  .post {
    padding: 0;
    margin: 0;
  }
  
  /* 头部区域优化 */
  .header {
    margin-top: 1em;
    margin-bottom: 1.5em;
  }
}

/* 深色模式移动设备优化 */
@media screen and (max-width: 768px) {
  html[data-theme=dark] .glass-wrapper {
    border: none;
    border-radius: 6px;
    padding: 10px;
    margin: 50px 5px 10px 5px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }
}

/* 分类页面移动设备优化 */
@media screen and (max-width: 768px) {
  .category-item {
    border: none;
    border-radius: 6px;
    margin: 5px 3px 8px 3px;
    padding: 0;
    box-shadow: 0 2px 12px 0 rgba(31, 38, 135, 0.03);
  }
  
  .category-item a {
    padding: 12px;
  }
  
  html[data-theme=dark] .category-item {
    border: none;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }
  
  .categories-grid {
    gap: 8px;
    margin: 0 5px;
  }
}

/* 归档页面移动设备优化 */
@media screen and (max-width: 768px) {
  .archive-post-item {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 5px 3px 8px 3px;
    box-shadow: 0 2px 12px 0 rgba(31, 38, 135, 0.03);
  }
  
  html[data-theme=dark] .archive-post-item {
    border: none;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }
  
  .archive-container {
    padding: 0 8px;
  }
}

/* 友链页面移动设备优化 */
@media screen and (max-width: 768px) {
  .friends-card {
    border: none;
    border-radius: 6px;
    padding: 12px;
    margin: 5px 3px;
    box-shadow: 0 2px 12px 0 rgba(31, 38, 135, 0.03);
  }
  
  html[data-theme=dark] .friends-card {
    border: none;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }
  
  .friends-container {
    gap: 8px;
    padding: 0 5px;
    margin-top: 0px;
  }

  .friends-wrapper {
    margin-top: 50px;
  }
}

/* 标签页面移动设备优化 */
@media screen and (max-width: 768px) {
  .tags-container {
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    margin: 3px 2px 4px 2px;
    box-shadow: 0 1px 6px 0 rgba(31, 38, 135, 0.03);
  }
  
  html[data-theme=dark] .tags-container {
    border: none;
    box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.1);
  }
}

/* 主页文章列表移动设备优化 */
@media screen and (max-width: 768px) {
  .post-item:hover {
    border-radius: 4px;
    padding-left: 8px;
    padding-right: 8px;
    margin: 0 3px;
    box-shadow: 0 1px 8px 0 rgba(31, 38, 135, 0.05);
  }
  
  html[data-theme=dark] .post-item:hover {
    box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.15);
  }
}

/* 整体页面容器优化 */
@media screen and (max-width: 768px) {
  /* 减少整体页面边距 */
  body {
    margin: 0;
    padding: 0;
  }
  
  /* 导航栏优化 */
  .navbar {
    padding: 10px 15px;
    margin: 0;
  }
  
  /* 作者信息优化 */
  .author {
    margin-top: 3rem;
    margin-bottom: 2rem;
  }
  
  /* 页脚优化 */
  .footer {
    margin-top: 2em;
    margin-bottom: 1em;
    padding: 0 10px;
  }
}
/*----------------------------------以上移动设备显示优化*/

/*----------------------------------主页文章列表过渡动画----------------------------------*/
/* 主页文章列表项的基础过渡效果 */
.post-item {
  display: flex;
  padding-top: 5px;
  padding-bottom: 6px;
  transform: translateY(20px);
  opacity: 0;
  animation: slideInUp 0.6s ease forwards;
  animation-delay: calc(var(--post-index, 0) * 0.08s);
  transition: all 0.3s ease;
}

/* 文章项悬停效果 */
.post-item:hover {
  transform: translateX(10px);
  border-radius: 8px;
  padding-left: 15px;
  padding-right: 15px;
}



/* 文章标题点击效果 */
.post-item .post-item-title a {
  color: #434648;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-item .post-item-title a:hover, 
.post-item .post-item-title a:focus {
  color: #0d122b;
  transform: scale(1.02);
}

html[data-theme=dark] .post-item .post-item-title a:hover, 
html[data-theme=dark] .post-item .post-item-title a:focus {
  color: #eaeaea;
}

/* 点击时的反馈效果 */
.post-item .post-item-title a:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* 滑入动画 */
@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 文章日期的动画效果 */
.post-item .post-item-date {
  min-width: 96px;
  color: #0d122b;
  font-weight: 700;
  padding-right: 10px;
  transition: all 0.3s ease;
  position: relative;
}

.post-item:hover .post-item-date {
  color: #f66;
  transform: scale(1.05);
}

html[data-theme=dark] .post-item:hover .post-item-date {
  color: #ff5277;
}
/*----------------------------------以上主页文章列表过渡动画----------------------------------*/

/*----------------------------------页面切换过渡动画----------------------------------*/
/* 页面容器基础样式 */
/* .wrapper {
  max-width: calc(720px - 30px * 2);
  position: relative;
  margin-right: auto;
  margin-left: auto;
  padding-right: 30px;
  padding-left: 30px;
  opacity: 0;
  transform: translateY(20px);
  animation: pageEnter 0.8s ease forwards;
} */

/* 页面进入动画 */
@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 页面退出动画（通过 JavaScript 触发） */
.page-exit {
  animation: pageExit 0.4s ease forwards;
}

@keyframes pageExit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(1.02);
  }
}

/* 内容区域的渐入效果 */
/* .post, .archive-container, .categories-grid, .friends-container {
  opacity: 0;
  transform: translateY(20px);
  animation: contentFadeIn 1s ease forwards;
  animation-delay: 0.3s;
} */

@keyframes contentFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 导航栏的滑入效果 */
.navbar {
  opacity: 0;
  transform: translateY(-20px);
  animation: navSlideIn 0.6s ease forwards;
  animation-delay: 0.1s;
}

@keyframes navSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 作者信息区域的动画 */
.author {
  opacity: 0;
  transform: translateY(30px);
  animation: authorSlideIn 0.8s ease forwards;
  animation-delay: 0.2s;
}

@keyframes authorSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 链接点击时的涟漪效果 */
a {
  position: relative;
  overflow: hidden;
}

a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 82, 119, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

a:active::before {
  width: 300px;
  height: 300px;
}

html[data-theme=dark] a::before {
  background: rgba(255, 82, 119, 0.2);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 页面切换时的模糊效果 */
.page-transition {
  transition: filter 0.3s ease, transform 0.3s ease;
}

.page-transition.blur {
  /* filter: blur(5px); */
  transform: scale(1.02);
}

/* 移动设备上的优化 */
@media screen and (max-width: 768px) {
  .post-item:hover {
    transform: translateX(5px);
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .header-title {
    animation: none;
    border-right: none;
       white-space: normal;
  }
  
  /* 减少移动设备上的动画延迟 */
  .post-item {
    animation-delay: calc(var(--post-index, 0) * 0.05s);
  }
}

/* 减少动画的用户偏好支持 */
@media (prefers-reduced-motion: reduce) {
  .post-item,
  .wrapper,
  .navbar,
  .author,
  .post,
  .archive-container,
  .categories-grid,
  .friends-container,
  .friends-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .header-title {
    animation: none;
    border-right: none;
  }
  
  a::before {
    display: none;
  }
}
/*----------------------------------以上页面切换过渡动画*/

/*----------------------------------毛玻璃效果动画增强----------------------------*/

/* 毛玻璃元素的渐入动画 */
@keyframes glassSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
  50% {
    opacity: 0.7;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* 微妙的浮动动画 - 可选效果 */
@keyframes glassFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* 模糊效果渐变动画 - 可选效果 */
@keyframes blurShift {
  0%, 100% {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  50% {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* 注意：已移除呼吸动画(glassBorderPulse)和颜色变化动画(glassColorShift)以简化效果 */

/* Waline 评论系统样式调整 */
.waline-container {
    margin-top: 2rem;
    animation-delay: 0.6s;
    color: inherit; /* 继承主题颜色 */
}

/* Waline 内部元素继承毛玻璃效果和颜色 */
.waline-container .wl-editor {
    background: inherit !important;
    border: inherit !important;
    border-radius: 12px !important;
    padding: 16px !important;
    color: inherit !important; /* 继承主题颜色 */
}

.waline-container .wl-editor textarea {
    color: inherit !important; /* 输入框文字颜色 */
}

.waline-container .wl-editor:focus-within {
    transform: translateY(-2px) !important;
}

/* 评论列表项使用更浅的透明度 */
.waline-container .wl-card {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    margin-bottom: 1rem !important;
    padding: 16px !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    transition: all 0.3s ease !important;
    color: inherit !important; /* 继承主题颜色 */
}

.waline-container .wl-card:hover {
    transform: translateY(-3px) !important;
    background: rgba(255, 255, 255, 0.25) !important;
}

/* Waline 所有文字元素颜色适配 */
.waline-container .wl-nick,
.waline-container .wl-time,
.waline-container .wl-content,
.waline-container .wl-admin-actions,
.waline-container .wl-comment-actions,
.waline-container .wl-meta,
.waline-container .wl-user,
.waline-container .wl-info,
.waline-container .wl-count {
    color: inherit !important;
}

/* Waline 链接颜色 */
.waline-container a {
    color: inherit !important;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.waline-container a:hover {
    opacity: 1;
}

/* Waline 按钮样式调整 */
.waline-container .wl-btn {
    background: rgba(255, 255, 255, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    transition: all 0.3s ease !important;
    color: inherit !important; /* 按钮文字颜色 */
}

.waline-container .wl-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* 暗色主题调整 */
html[data-theme=dark] .waline-container .wl-card {
    background: rgba(40, 40, 40, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-theme=dark] .waline-container .wl-card:hover {
    background: rgba(40, 40, 40, 0.4) !important;
}

html[data-theme=dark] .waline-container *,
html[data-theme=dark] .waline-container .wl-editor textarea::placeholder {
    color: #c7bebe !important;
}

html[data-theme=dark] .waline-container .wl-btn {
    background: rgba(40, 40, 40, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html[data-theme=dark] .waline-container .wl-btn:hover {
    background: rgba(40, 40, 40, 0.5) !important;
}

/* 确保所有 Waline 元素都继承主题颜色 */
html[data-theme=dark] .waline-container,
html[data-theme=dark] .waline-container *:not(.wl-emoji) {
    color: #c7bebe !important;
}

/* 占位符文字颜色 */
.waline-container .wl-editor textarea::placeholder {
    color: inherit !important;
    opacity: 0.6;
}

html[data-theme=dark] .waline-container .wl-editor textarea::placeholder {
    color: #c7bebe !important;
    opacity: 0.6;
}

/* 调整评论区容器样式 */
.dis {
    margin-top: 2rem;
}

/* 淺色主題 (白天) */
html[data-theme=light] .waline-container .wl-card {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #000 !important;
}

html[data-theme=light] .waline-container .wl-btn {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #000 !important;
}

html[data-theme=light] .waline-container .wl-editor,
html[data-theme=light] .waline-container .wl-editor textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #000 !important;
}

/* 暗色主題 (灰黑) */
html[data-theme=dark] .waline-container .wl-card {
    background: rgba(50, 50, 50, 0.3) !important; /* 深灰而不是純黑 */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #c7bebe !important;
}

html[data-theme=dark] .waline-container .wl-card:hover {
    background: rgba(50, 50, 50, 0.4) !important;
}

html[data-theme=dark] .waline-container .wl-btn {
    background: rgba(50, 50, 50, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #c7bebe !important;
}

html[data-theme=dark] .waline-container .wl-btn:hover {
    background: rgba(50, 50, 50, 0.5) !important;
}

html[data-theme=dark] .waline-container .wl-editor,
html[data-theme=dark] .waline-container .wl-editor textarea {
    background: rgba(50, 50, 50, 0.2) !important;
    color: #c7bebe !important;
}

html[data-theme=dark] .waline-container .wl-editor textarea::placeholder {
    color: #c7bebe !important;
    opacity: 0.6;
}


/*----------------------------------以上Waline评论系统样式调整----------------------------------*/

/*壞掉請刪我*/
/* ====== 讓 Tags 置中（與 friends 類似） ====== */
/* 將 .tags-container 改成 flex 容器並置中顯示 */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* <-- 將標籤群置中 */
  gap: 0.6rem;              /* 標籤間距，可調整 */
  padding-left: 0;         /* 移除原本的左填充以避免偏移 */
  padding-right: 0;
  align-items: center;
}

/* 保證內部 a/tag item 呈現一致 */
.tags-container a,
.tags-container .tag-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;     /* 禁止標籤換行造成高度不一致 */
  box-sizing: border-box;
}

/* 在手機上稍微縮小間距 */
@media (max-width: 768px) {
  .tags-container { gap: 0.45rem; padding: 0 6px; }
  .tags-container a, .tags-container .tag-item { padding: 6px 10px; }
}

/* ====== 讓 Categories 的卡片群也像 friends 一樣置中 ====== */
/* 使用 flex 排列並置中，每個 .category-item 固定寬度（跟 friends 類似） */
.categories-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* <-- 將卡片群置中 */
  gap: 1rem;               /* 卡片間距 */
  padding: 0;              /* 可視情況保留或調整 */
}

/* 固定每張卡片的寬度（可調整到你想要的大小） */
.category-item {
  flex: 0 0 280px;   /* 與 friends-card 同寬 280px */
  max-width: 280px;
  box-sizing: border-box;
  margin: 0;         /* 由容器 gap 控制間距 */
}

/* 手機響應：卡片改為佔滿行寬 */
@media (max-width: 768px) {
  .category-item {
    flex: 0 0 calc(100% - 10px);
    max-width: calc(100% - 10px);
    margin: 5px;
  }

  .categories-grid {
    gap: 8px;
    padding: 0 6px;
  }
}
.menu input[type=checkbox]:checked ~ .trigger {
  position: fixed;
  inset: 0; /* 等同 top:0; right:0; bottom:0; left:0; */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background-color: #fff;
  z-index: 10005;
  padding-top: env(safe-area-inset-top);
  overflow-y: auto;
}
/* ================= 修正 Tags / Categories 置中問題（放在 main.css 最後） ================= */

/* 1) Tags：確保整組標籤在容器內置中、不被 wrapper 偏移 */
.tags-page .tags-container,
.tags-container {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; /* 將標籤群置中 */
  align-items: center !important;
  gap: 0.6rem !important;
  padding-left: 0 !important;   /* 避免左側 padding 導致視覺偏移 */
  padding-right: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box;
}

/* 確保每個標籤項目不會換行導致不穩定高度 */
.tags-container a,
.tags-container .tag-item {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

/* 2) Categories：使用 grid 但在少量項目時也能置中（auto-fit + 固定最小寬度） */
.categories-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  justify-content: center !important; /* 將整組 grid 置中（當欄位少時） */
  gap: 1rem !important;
  width: 100%;
  margin: 0 auto !important;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  align-items: start;
}

/* 讓每張 category card 保持合理寬度（像 friends-card 一樣） */
.categories-grid .category-item {
  max-width: 280px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 行動裝置：卡片改為寬度撐滿（避免過窄） */
@media (max-width: 768px) {
  .tags-container { gap: 0.45rem; padding: 0 8px; }
  .tags-container a, .tags-container .tag-item { padding: 6px 10px; }

  .categories-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 0 6px;
  }

  .categories-grid .category-item {
    max-width: none;
    width: 100%;
    margin: 3px 0;
  }
}

/* 3) 若仍被父容器（.wrapper）偏移，強制讓頁面內部容器水平置中 */
.wrapper .tags-container,
.wrapper .categories-grid {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 4) 如果舊的規則仍被覆寫，臨時使用 !important（只在排錯時保留） */
/* .tags-container, .categories-grid { outline: 1px dashed rgba(255,0,0,0.12); } */
/* ===== 強制置中：Tags / Categories（放在 main.css 最後，覆蓋先前設定） ===== */

/* --- Tags：使用 flex 並置中，移除左右偏移 --- */
.tags-page .tags-container,
.tags-container {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; /* 群組置中 */
  align-items: center !important;
  gap: 0.6rem !important;
  padding-left: 0 !important;   /* 防止左填充導致視覺偏移 */
  padding-right: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 確保標籤項目行內且不被折行破壞高度 */
.tags-container a,
.tags-container .tag-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* --- Categories：改採和 friends 一樣的 flex 卡片群（少量項目也會置中） --- */
.categories-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; /* 將整組卡片置中 */
  gap: 1rem !important;
  padding: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: flex-start !important;
}

/* 與 friends-card 保持一致的寬度，並讓容器決定間距 */
.categories-grid .category-item {
  flex: 0 0 280px !important; /* 每張卡片固定寬度，可調為 240/320 */
  max-width: 280px !important;
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* 行動裝置：卡片改為撐滿寬度 */
@media (max-width: 768px) {
  .categories-grid {
    gap: 8px !important;
    padding: 0 6px !important;
  }
  .categories-grid .category-item {
    flex: 0 0 calc(100% - 12px) !important;
    max-width: none !important;
    width: 100% !important;
    margin: 3px auto !important;
  }
  .tags-container { gap: 0.45rem !important; padding: 0 8px !important; }
  .tags-container a, .tags-container .tag-item { padding: 6px 10px !important; }
}

/* 若 .wrapper （或其它容器）加了 side padding 導致偏移，強制內部容器置中 */
.wrapper .tags-container,
.wrapper .categories-grid {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* （排錯用）在開發時可打開 outline 幫助看哪個容器造成偏移（上線後移除） */
/* .tags-container { outline: 1px dashed rgba(255,0,0,0.08) !important; }
   .categories-grid { outline: 1px dashed rgba(0,0,255,0.08) !important; } */
/* ===== 手機選單覆蓋修正（覆蓋原本 .menu input:checked ~ .trigger 規則） ===== */

.menu input[type=checkbox]:checked ~ .trigger {
  position: fixed !important;
  inset: 0 !important; /* top:0; right:0; bottom:0; left:0; */
  /* fallback to --vh if needed */
  height: calc(var(--vh, 1vh) * 100) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  background-color: #fff !important;
  z-index: 10010 !important; /* 比現有 10000+ 的元素高 */
  padding-top: env(safe-area-inset-top) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: none !important; /* 阻止手勢傳遞（避免背景也跟著滑） */
}

/* 若 menu 使用了 .trigger 內的某個子元素作滾動區，確保該子元素可以滾動：
   .trigger .menu-content { overflow-y:auto; -webkit-overflow-scrolling:touch; } */

/* 當 menu 開啟時鎖定背景（透過 JS 加上 body.no-scroll） */
body.no-scroll {
  position: fixed !important;
  width: 100% !important;
  overflow: hidden !important;
  touch-action: none !important;
}

/* 若你想暫時隱藏可能蓋過選單的按鈕（#toggleButton / #closeButton），可以在開啟時隱藏 */
body.menu-open #toggleButton,
body.menu-open #closeButton {
  display: none !important;
  visibility: hidden !important;
}
/* ================= overlay + tags/categories fix (append to main.css 最末) ================= */

/* ---- 防止橫向溢出（萬用 safeguard） ---- */
html, body {
  overflow-x: hidden !important;
}

/* ---- Menu 覆蓋修正：完整覆蓋視窗、根據主題切換顏色、鎖定背景滾動 ---- */
.menu input[type=checkbox]:checked ~ .trigger {
  position: fixed !important;
  inset: 0 !important; /* top:0; right:0; bottom:0; left:0; */
  height: calc(var(--vh, 1vh) * 100) !important; /* fallback */
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important; /* 保持內容從上開始（若要垂直置中改成 center） */
  align-items: stretch !important;
  background-color: rgba(255,255,255,0.98) !important; /* light 模式預設 */
  color: inherit !important;
  z-index: 10050 !important; /* 蓋過其他固定元素 */
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
  overflow-y: auto !important; /* 讓 menu 內容可獨立滾動 */
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

/* menu 內容的連結/文字使用繼承色 */
.menu .menu-link,
.menu .menu-trigger,
.menu .trigger,
.menu a {
  color: inherit !important;
}

/* 夜間主題下的 menu 背景 / 文字 */
html[data-theme=dark] .menu input[type=checkbox]:checked ~ .trigger {
  background-color: rgba(10,10,12,0.95) !important;
  color: #eaeaea !important;
}

/* 確保 menu 裡的連結在深色/淺色下都可見 */
html[data-theme=dark] .menu .menu-link { color: #eaeaea !important; }
html[data-theme=light] .menu .menu-link { color: #222 !important; }

/* 當 menu 開啟時，隱藏或降低會蓋住 menu 的其它固定按鈕（例如 #toggleButton / #closeButton / .overlay） */
body.menu-open #toggleButton,
body.menu-open #closeButton,
body.menu-open .overlay {
  display: none !important;
  visibility: hidden !important;
}

/* 鎖定背景滾動（加在 body.no-scroll）—— JS 會控制此類別 */
body.no-scroll {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
}

/* 如果 menu 內有單獨的可滾動區塊，確保那個區塊可以滾動（如果 .trigger 是整區滾動則不需） */
.menu .trigger .menu-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- 防止 menu 內的元素跑到最上方看起來被擠壓：確保內部項目有合理 padding ---- */
.menu .trigger > * {
  box-sizing: border-box;
  padding: 14px 18px;
}

/* ---- Tags: 強制置中、移除偏移（覆蓋原先 inline-block 與 padding） ---- */
.tags-container,
.tags-page .tags-container {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0.6rem !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 標籤項目顯示調整 */
.tags-container a,
.tags-container .tag-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ---- Categories: 改成和 friends 同步的 flex 卡片排列（少量也會置中） ---- */
.categories-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 1rem !important;
  padding: 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* category card 與 friends-card 相同寬度 */
.categories-grid .category-item {
  flex: 0 0 280px !important;
  max-width: 280px !important;
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  text-align: center; /* 保持卡片內容置中 */
}

/* 手機響應：卡片撐滿行寬 */
@media (max-width: 768px) {
  .categories-grid {
    gap: 8px !important;
    padding: 0 6px !important;
  }
  .categories-grid .category-item {
    flex: 0 0 calc(100% - 12px) !important;
    max-width: none !important;
    width: 100% !important;
    margin: 3px auto !important;
  }

  .tags-container { gap: 0.45rem !important; padding: 0 8px !important; }
  .tags-container a, .tags-container .tag-item { padding: 6px 10px !important; }
}

/* 強制 wrapper 內部容器不被側邊 padding 推偏 */
.wrapper .tags-container,
.wrapper .categories-grid,
.wrapper .friends-container {
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 如需 debug 哪個元素造成 overflow，可短期加 outline */
/* ===== Mobile menu 置中覆蓋（貼在 main.css 最後） ===== */

/* 讓整個選單 overlay 完整覆蓋視窗（保留之前的 inset/--vh 設定） */
.menu input[type=checkbox]:checked ~ .trigger {
  position: fixed !important;
  inset: 0 !important;
  height: calc(var(--vh, 1vh) * 100) !important;
  display: flex !important;
  align-items: center !important;     /* 垂直置中 */
  justify-content: center !important; /* 水平置中 */
  background-color: rgba(255,255,255,0.98) !important;
  z-index: 10050 !important;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom) 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important; /* 讓內部的可捲動區處理滾動 */
}

/* 深色主題下的背景/文字 */
html[data-theme=dark] .menu input[type=checkbox]:checked ~ .trigger {
  background-color: rgba(10,10,12,0.95) !important;
  color: #eaeaea !important;
}

/* menu 內部實際的內容盒子（用來控制最大寬度與內部滾動） */
.menu .trigger .menu-inner {
  width: 100%;
  max-width: 720px; /* 可調整為你想要的最大寬 */
  margin: auto;     /* 在父 flex container 中置中 */
  box-sizing: border-box;
  border-radius: 12px;
  /* 可視需要加毛玻璃或背景色（以下為示例，可刪） */
  background: inherit;
}

/* 真正可滾動的區域（當內容超過視窗高度時會出現滾動） */
.menu .trigger .menu-inner .menu-content,
.menu .trigger .menu-inner > .menu-content {
  max-height: calc(var(--vh, 1vh) * 100 - 48px); /* 留 48px 做上下 safe padding */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 8px;
  box-sizing: border-box;
}

/* menu 連結樣式確保與主題文字顏色一致 */
.menu .trigger .menu-content a,
.menu .trigger .menu-content .menu-link {
  color: inherit !important;
  display: block;
  text-align: center; /* 如果想要連結置中 */
  padding: 12px 8px;
  text-decoration: none;
}

/* 小螢幕微調（更窄時讓內距少一點） */
@media (max-width: 420px) {
  .menu input[type=checkbox]:checked ~ .trigger {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .menu .trigger .menu-inner { max-width: 100%; }
  .menu .trigger .menu-inner .menu-content { max-height: calc(var(--vh, 1vh) * 100 - 28px); }
}

/* 如果你同時使用 body.menu-open / body.no-scroll（JS 控制），確保 body 滾動被鎖定 */
body.no-scroll {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* 防止水平溢出造成可左右滑動 */
html, body, .menu input[type=checkbox]:checked ~ .trigger, .menu .trigger .menu-inner {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}
/* ====== MOBILE ONLY: 强制 menu overlay 覆蓋並置中（放在 main.css 最末） ====== */
@media (max-width: 768px) {
  /* 匹配常見 overlay 結構，強制覆蓋 */
  .menu input[type=checkbox]:checked ~ .trigger,
  .menu .trigger,
  .menu .menu-overlay,
  .menu .menu-trigger + .trigger,
  .menu .menu-overlay.show {
    position: fixed !important;
    inset: 0 !important;                 /* top/right/bottom/left = 0 */
    width: 100vw !important;
    height: calc(var(--vh, 1vh) * 100) !important; /* 使用 --vh（若沒設定會退回 1vh） */
    display: flex !important;
    align-items: center !important;      /* 垂直置中 */
    justify-content: center !important;  /* 水平置中 */
    padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom) 16px !important;
    box-sizing: border-box !important;
    z-index: 10060 !important;           /* 高於其他固定元素 */
    overflow: hidden !important;         /* 由內部容器處理滾動 */
    touch-action: none !important;
    background-color: rgba(255,255,255,0.98) !important; /* light fallback */
    color: inherit !important;
    max-width: 100vw !important;
  }

  /* 支援多種 dark-theme 寫法（data-theme 或 class） */
  html[data-theme="dark"] .menu input[type=checkbox]:checked ~ .trigger,
  body[data-theme="dark"] .menu input[type=checkbox]:checked ~ .trigger,
  html.dark .menu input[type=checkbox]:checked ~ .trigger,
  body.dark .menu input[type=checkbox]:checked ~ .trigger,
  html[data-theme="dark"] .menu .trigger,
  body[data-theme="dark"] .menu .trigger,
  html.dark .menu .trigger,
  body.dark .menu .trigger {
    background-color: rgba(10,10,12,0.96) !important;
    color: #eaeaea !important;
  }

  /* 如果 overlay 內有白底盒（.menu-inner/.menu-box/.menu-container），把它設為透明 */
  .menu .trigger .menu-inner,
  .menu .trigger .menu-box,
  .menu .trigger .menu-container,
  .menu .menu-overlay .menu-inner,
  .menu .menu-overlay .menu-box,
  .menu .menu-overlay .menu-container {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
  }

  /* 內部內容盒（最大寬、置中、可滾動） */
  .menu .trigger > .menu-inner,
  .menu .trigger .menu-inner,
  .menu .menu-overlay > .menu-inner,
  .menu .menu-box {
    width: 100% !important;
    max-width: 720px !important; /* 可依需求調整 */
    margin: 0 auto !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    overflow: visible !important;
  }

  /* 當內容太高時，內部滾動而 overlay 本體固定在中間 */
  .menu .trigger .menu-inner .menu-content,
  .menu .trigger .menu-content,
  .menu .menu-overlay .menu-content {
    max-height: calc(var(--vh, 1vh) * 100 - 48px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
  }

  /* 連結置中、顏色繼承 */
  .menu .trigger .menu-content a,
  .menu .trigger .menu-content .menu-link,
  .menu .menu-overlay .menu-content a {
    display: block !important;
    text-align: center !important;
    color: inherit !important;
    padding: 12px 8px !important;
    text-decoration: none !important;
  }

  /* 如果有明確的 white-bg class，強制覆蓋 */
  .menu .trigger [class*="white"],
  .menu .trigger [class*="box"],
  .menu .trigger [class*="panel"] {
    background: transparent !important;
  }

  /* 防止橫向溢出 */
  html, body, .menu input[type=checkbox]:checked ~ .trigger, .menu .trigger {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* 小螢幕微調 */
  @media (max-width: 420px) {
    .menu input[type=checkbox]:checked ~ .trigger { padding-left: 8px !important; padding-right: 8px !important; }
    .menu .trigger .menu-inner { max-width: 100% !important; }
    .menu .trigger .menu-inner .menu-content { max-height: calc(var(--vh, 1vh) * 100 - 28px) !important; }
  }
}
/* ====== end MOBILE ONLY menu override ====== */
/* ====== 臨時修正：移除奇怪底部空白 & 強制頁面一致滾動（mobile only） ====== */
@media (max-width: 768px) {
  /* 保證 body / html 高度由內容決定，去掉不必要的大底部空白 */
  html, body {
    min-height: 100vh !important;
    height: auto !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  /* 避免某些 wrapper/section 加了過大的 margin-bottom 或 padding-bottom */
  .wrapper,
  .friends-wrapper,
  .tags-wrapper,
  .categories-wrapper,
  .friends-container,
  .categories-grid,
  .tags-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important; /* 確保不是內部 scroll 導致差異 */
  }

  /* 防止某些內層容器誤用 100vh 導致頁面高度加倍 */
  [style*="height:100vh"], .fullscreen, .full-height {
    height: auto !important;
    min-height: 0 !important;
  }

  /* 若某些卡片容器本身有 overflow-y:auto，讓它改為 visible（避免內層滾動造成行為差異） */
  .friends-container,
  .categories-grid,
  .tags-container {
    overflow-y: visible !important;
    -webkit-overflow-scrolling: auto !important;
  }

  /* 確保 footer 或頁面最下方元素不被隱藏或推遠 */
  footer, .footer {
    margin-bottom: 1.2rem !important;
  }
}
/* ===== 臨時修正：消除 friends/tags/categories 手機底部空白 & 統一滾動行為 ===== */
@media (max-width: 768px) {
  /* 保證 body 不會因為偽元素或 100vh 內容造成額外高度 */
  html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important; /* 以 body 為主滾動容器 */
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  /* 清除常見 wrapper/page-level 的底部間距（測試用） */
  .wrapper,
  .friends-wrapper,
  .tags-wrapper,
  .categories-wrapper,
  .friends-container,
  .categories-grid,
  .tags-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important; /* 避免內層滾動 */
  }

  /* 防止任何內層使用 100vh 導致視窗高度被「加倍」 */
  [style*="height:100vh"],
  .full-height,
  .fullscreen {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  /* 如果 body::before / 偽元素被用來顯示背景，確保它是 fixed 並不影響 layout */
  body::before {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    width: 100vw !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }

  /* 強制讓這三個頁面的卡片容器不產生內部捲軸（避免與 body 捲軸行為不一致） */
  .friends-container,
  .categories-grid,
  .tags-container {
    overflow-y: visible !important;
    -webkit-overflow-scrolling: auto !important;
  }

  /* footer 保留小間距，不要被推太遠 */
  footer, .footer {
    margin-bottom: 1rem !important;
    padding-bottom: 0 !important;
  }
}
/* ------------------ DESKTOP: mode toggle 垂直對齊 & 主區塊穩定性（append to end of main.css） ------------------ */
/* 只作用於桌面 (>=769px)：
   - 讓日/夜切換按鈕與菜單文字高度一致（垂直置中）
   - 不改變手機版（已由先前規則處理）
*/
@media screen and (min-width: 769px) {
  /* 讓 navbar 的 menu 區塊以 flex 置中對齊內容（桌面安全範圍） */
  .navbar .menu {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
  }

  /* 保持 trigger（右側菜單區）靠右 */
  .menu .trigger {
    margin-left: auto !important;
    display: flex;
    align-items: center;
  }

  /* 將日/夜切換按鈕改為與文字同一行、垂直置中（覆蓋 float/top 的定位） */
  .menu a#mode {
    float: none !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 8px 0 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 48px;                /* 與 menu 高度對齊（視你的 navbar 高度可調整） */
    padding: 0 6px !important;
    transform: translateY(0) !important;
    z-index: 1002 !important;
    opacity: 0.9;
  }

  /* 如需微調「再往下」或「再往上」，修改下面的 translateY(px)（正值往下） */
  /* 例如： .menu a#mode { transform: translateY(2px) !important; } */

  /* 確保 menu 文字和 icon 也垂直置中 */
  .menu .menu-link,
  .menu .menu-icon {
    display: inline-flex !important;
    align-items: center !important;
    height: 48px !important;
    line-height: normal !important;
  }

  /* svg / icon 垂直對齊 */
  .menu a#mode svg,
  .menu .menu-icon svg {
    vertical-align: middle !important;
    display: block;
  }

  /* 保留深/淺色外觀（不改變顏色）— 如需再調色可另外指定 */
}
/* ------------------ FIX: hide mobile menu icon on DESKTOP and restore mode-button position ------------------ */
/* Append to the end of main.css */

/* Ensure mobile menu icon only shows on small screens and is hidden on desktop */
@media screen and (min-width: 769px) {
  /* Hide the hamburger / mobile menu icon on desktop */
  .menu .menu-icon,
  .menu .menu-trigger {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Restore a#mode to inline position and vertically align with menu links on desktop */
  .menu a#mode {
    float: none !important;            /* remove float that can cause push/overlap */
    position: relative !important;
    top: 0 !important;                 /* keep on the same baseline as menu text */
    margin: 0 8px 0 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 48px !important;           /* match menu height (adjust if your navbar differs) */
    padding: 0 6px !important;
    transform: translateY(0) !important;
    z-index: 1002 !important;
    opacity: 0.95 !important;
  }

  /* Make sure menu links are vertically centered too */
  .menu .menu-link,
  .menu .menu-item {
    display: inline-flex !important;
    align-items: center !important;
    height: 48px !important;
    line-height: normal !important;
  }

  /* Ensure the trigger area stays right-aligned */
  .menu .trigger {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* Keep original mobile behavior intact (explicitly show mobile icon on small screens) */
@media screen and (max-width: 768px) {
  .menu .menu-icon {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* mobile: keep mode button positioned as mobile rules expect */
  .menu a#mode {
    float: left !important;
    position: relative !important;
    top: 10px !important;
    left: 8px !important;
    display: block !important;
    height: 50px !important;
    padding: 0 6px !important;
  }
}

/* Safety: if any previous global rules forced the hamburger visible, override it on desktop */
@supports (display: grid) {
  @media screen and (min-width: 769px) {
    .menu .menu-icon[style],
    .menu .menu-icon {
      display: none !important;
    }
  }
}
/* ------------------ STRONG FIX: enforce identical spacing for LIGHT/DARK and fix toggle alignment ------------------ */
/* Append this to the end of main.css */

/* Goal:
   - Make mobile/desktop spacing identical between light and dark themes for:
     categories, archive(檔案館), friends(友鏈), author(關於我), tags
   - Prevent any theme-switch transform/animation from "pulling up" cards
   - Keep the card background a bit wider but prevent overflow ("怕跑出去")
   - Ensure desktop mode toggle button vertically aligns with menu text
*/

/* 1) Global: ensure both themes use same baseline spacing for these sections */
html[data-theme="light"] .categories-grid,
html[data-theme="dark"]  .categories-grid,
html[data-theme="light"] .archive-container,
html[data-theme="dark"]  .archive-container,
html[data-theme="light"] .friends-container,
html[data-theme="dark"]  .friends-container,
html[data-theme="light"] .tags-container,
html[data-theme="dark"]  .tags-container,
html[data-theme="light"] .author,
html[data-theme="dark"]  .author {
  /* baseline padding/margin consistent across themes */
  margin-top: 1.6rem !important;
  margin-bottom: 1.6rem !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
}

/* 2) Card items: keep the same spacing/title-to-card gap and prevent transforms */
.categories-grid .category-item,
.archive-post-item,
.friends-card,
.glass-wrapper {
  margin: 12px 0 !important;      /* stable gap between title and card */
  padding: 14px !important;       /* stable internal padding */
  border-radius: 12px !important;
  box-sizing: border-box !important;
  transform: none !important;     /* remove any translateY/scale that may "lift" cards */
  transition: none !important;    /* avoid transition between themes causing visual jump */
  max-width: 100% !important;     /* avoid overflow */
}

/* Keep about-me (author) card visually slightly wider but constrained to container */
.author .author-avatar-wrapper,
.author .glass-wrapper,
.author .author-bio {
  width: auto !important;
  max-width: calc(100% - 24px) !important; /* leave 12px padding both sides */
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 3) Titles and subtitles: stable bottom margin so title->card distance won't change */
.header .header-title,
.friends-subtitle,
.archive-title,
.tags-page .tags-title,
.header {
  margin-bottom: 0.9rem !important;
}

/* 4) Mobile specific: enforce identical behavior for both themes (<=768px) */
@media screen and (max-width: 768px) {
  html[data-theme="light"] .wrapper,
  html[data-theme="dark"]  .wrapper {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Prevent any pseudo-element or fixed background from changing scroll layout */
  body::before {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    width: 100vw !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }

  /* Make sure list/grid containers do NOT create inner scrolls that change visual density */
  .friends-container,
  .categories-grid,
  .tags-container,
  .archive-container {
    overflow-y: visible !important;
    -webkit-overflow-scrolling: auto !important;
  }

  /* Explicit stable spacing for mobile cards */
  .categories-grid .category-item,
  .archive-post-item,
  .friends-card {
    margin: 10px 0 !important;
    padding: 12px !important;
  }
}

/* 5) Desktop: ensure mode toggle vertically aligns with menu text and no extra mobile icon appears */
@media screen and (min-width: 769px) {
  .navbar .menu {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  /* hide mobile icon specifically on desktop */
  .menu .menu-icon,
  .menu .menu-trigger {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* place mode toggle inline and vertically centered with menu text */
  .menu a#mode {
    float: none !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 8px 0 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 48px !important;           /* match navbar height; adjust if your navbar differs */
    padding: 0 6px !important;
    transform: translateY(0) !important; /* tweak if you want slightly lower: translateY(2px) */
    z-index: 1002 !important;
  }

  .menu .menu-link,
  .menu .menu-item,
  .menu .menu-icon svg {
    display: inline-flex !important;
    align-items: center !important;
    height: 48px !important;
  }
}

/* 6) Extra safety: any theme-specific rules accidentally changing spacing are overridden */
html[data-theme="light"] .category-item,
html[data-theme="dark"]  .category-item,
html[data-theme="light"] .archive-post-item,
html[data-theme="dark"]  .archive-post-item,
html[data-theme="light"] .friends-card,
html[data-theme="dark"]  .friends-card {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* 7) Debug helper (temporary): outlines to see where spacing comes from.
   Remove or comment out when you confirm the fix works. */
/*
.categories-grid .category-item,
.archive-post-item,
.friends-card {
  outline: 1px dashed rgba(255,0,0,0.06) !important;
}
*/
/* ------------------ FIX: avatar became huge oval + ::marker overflowing wrapper ------------------ */
/* Append this block to the end of main.css */

/* ---------- 1) Avatar fix: force square, contained avatar and prevent oval/stretch ---------- */
/* Keep it responsive but capped, and ensure image uses object-fit:cover so it's never stretched. */
.author .author-avatar-wrapper {
  /* responsive but bounded size to avoid becoming huge */
  width: clamp(56px, 7.5vw, 90px) !important;
  aspect-ratio: 1 / 1 !important;        /* ensure square */
  max-width: 90px !important;
  max-height: 90px !important;
  border-radius: 50% !important;         /* force perfect circle */
  overflow: hidden !important;           /* crop overflow */
  display: inline-block !important;
  box-sizing: border-box !important;
  padding: 0 !important;                 /* remove accidental inner padding */
  background-color: transparent !important; /* keep original background if needed */
}

/* Ensure the avatar element (img/svg) fills wrapper and keeps aspect ratio */
.author .author-avatar,
.author .author-avatar-wrapper img,
.author .author-avatar-wrapper svg,
.author .author-avatar-wrapper picture > img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;          /* crop to fit, preserve aspect */
  border-radius: 50% !important;         /* reinforce circular shape */
  max-width: 100% !important;
  max-height: 100% !important;
}

/* If some rule sets avatar to width:auto/height:auto, override that */
.author .author-avatar,
.author .author-avatar-wrapper img {
  min-width: 0 !important;
  min-height: 0 !important;
}

/* Keep avatar wrapper aligned with other header content (if needed) */
.author .author-avatar-wrapper {
  vertical-align: middle !important;
  margin: 0 auto !important;
}

/* ---------- 2) ::marker / list markers: prevent marker from sticking out of .wrapper ---------- */
/* The simplest robust fix: ensure lists inside the page wrapper have enough left padding so markers are inside. */
.wrapper ul,
.wrapper ol,
.post ul,
.post ol,
.page-content ul,
.page-content ol {
  padding-left: 1.35rem !important;     /* bring markers in; adjust small value if needed */
  margin-left: 0 !important;             /* avoid extra left margin that can push markers out */
  box-sizing: border-box !important;
  list-style-position: outside !important; /* keep default outside but inside wrapper padding */
}

/* Slightly larger indent for nested lists to maintain visual hierarchy */
.wrapper ul ul,
.wrapper ol ol,
.post ul ul,
.post ol ol {
  padding-left: 1.05rem !important;
}

/* If you use ::marker styles elsewhere that enlarge content, cap marker font-size */
.wrapper ::marker,
.post ::marker,
.page-content ::marker {
  font-size: 1em !important;             /* keep markers same scale as body text */
  line-height: 1 !important;
  color: inherit !important;
}

/* For lists that were using negative text-indent or custom marker positioning, ensure list items don't overflow */
.wrapper li,
.post li,
.page-content li {
  overflow: visible !important;
  word-break: break-word !important;
}

/* For very narrow containers on mobile, slightly reduce marker padding so content still fits */
@media screen and (max-width: 420px) {
  .wrapper ul,
  .wrapper ol,
  .post ul,
  .post ol {
    padding-left: 1.05rem !important;
  }
}

/* ---------- 3) Safety overrides: remove transforms/transitions that may "lift" content when theme changes ---------- */
/* Prevent theme-switch animations from moving cards/author/avatar unexpectedly */
.author,
.category-item,
.archive-post-item,
.friends-card,
.glass-wrapper,
.wrapper .post {
  transform: none !important;
  transition: none !important;
}

/* ------------------ FORCE: avatar 正圓 & 修正 title ::before 凸出（append to end） ------------------ */

/* ===== Avatar: 强制正圆且不被父容器拉伸 ===== */
/* 说明：使用固定（但响应式）同宽高值，并阻止 flex/stretch 拉伸 */
.author .author-avatar-wrapper {
  --avatar-size: 70px;                     /* 可调整为 56px / 80px 等 */
  width: var(--avatar-size) !important;
  height: var(--avatar-size) !important;   /* 强制等于 width，保证正圆 */
  min-width: var(--avatar-size) !important;
  min-height: var(--avatar-size) !important;
  max-width: var(--avatar-size) !important;
  max-height: var(--avatar-size) !important;
  flex: 0 0 var(--avatar-size) !important; /* 防止被 flex 拉伸 */
  display: inline-block !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background-color: transparent !important;
  vertical-align: middle !important;
}

/* 內部圖片/元素填滿容器，並保持 cover（不失真）*/
.author .author-avatar,
.author .author-avatar-wrapper img,
.author .author-avatar-wrapper picture > img,
.author .author-avatar-wrapper svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;   /* 剪裁並填滿，保證不變形 */
  border-radius: 50% !important;  /* reinforce circular mask */
  max-width: 100% !important;
  max-height: 100% !important;
}

/* 如果你想讓 avatar 在不同屏寬有不同大小，可用 media query 覆蓋 --avatar-size */
/* 例如：手機上稍微小一點 */
@media (max-width: 420px) {
  .author .author-avatar-wrapper { --avatar-size: 56px; }
}

/* ===== Title ::before 修正：不再凸出 wrapper ===== */
/* 原先使用 left: -15px 會導致在某些容器下超出。改成放在標題內部且預留間距。 */
.header .header-title {
  position: relative !important;    /* 讓 pseudo-element 定位於標題內 */
  padding-left: 0.75rem !important; /* 給標題留出與左側裝飾的空白 */
  box-sizing: border-box !important;
}

/* 只對非置中標題加左側裝飾（且在標題內部） */
.header .header-title:not(.header-title.center)::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;               /* 放在標題內左側，不會超出 wrapper */
  top: 12% !important;
  height: 75% !important;
  width: 5px !important;            /* 明顯但不會造成溢出 */
  background-color: #f66 !important; /* 舊規則是 border-left:5px solid #f66，改為內部背景 */
  border: none !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
}

/* 深色主题下的装饰色一致性（如果需要） */
html[data-theme="dark"] .header .header-title:not(.header-title.center)::before {
  background-color: #ff2957 !important; /* 可调整为与深色主题搭配的色 */ 
}

/* 若你希望標題有更左側的文字間距，調整 .header .header-title padding-left 的值 */

/* ===== Safety: 移除可能導致橢圓與凸出行為的 transform/animation 影響 ===== */
.author .author-avatar-wrapper,
.author .author-avatar,
.header .header-title,
.header .header-title::before {
  transform: none !important;
  transition: none !important;
}
/* ------------------ AVATAR HOVER RESTORE + SAFEGUARD (append to end of main.css) ------------------ */
/* 目的：
   - 強制 avatar 容器為正圓且不被父容器拉伸（避免橢圓）
   - 恢復原本的「滑鼠碰到頭像時，頭像在圓圈內放大」效果（圈大小不變）
   - 保留對 prefers-reduced-motion 的支援
*/

/* 基本固定圓形容器（確保 width == height）*/
.author .author-avatar-wrapper {
  --avatar-size: 70px; /* 需要時可改這個值（手機可以用 media query 覆蓋） */
  width: var(--avatar-size) !important;
  height: var(--avatar-size) !important;
  min-width: var(--avatar-size) !important;
  min-height: var(--avatar-size) !important;
  max-width: var(--avatar-size) !important;
  max-height: var(--avatar-size) !important;
  flex: 0 0 var(--avatar-size) !important; /* 防止 flex 父容器拉伸 */
  display: inline-block !important;
  border-radius: 50% !important;
  overflow: hidden !important; /* 讓內部圖片放大時被裁切在圓內 */
  padding: 0 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  background-color: transparent !important;
  transform: none !important; /* 確保容器不被 transform 拉扯成橢圓 */
}

/* 內部圖片填滿容器並且使用 object-fit 保持等比 */
.author .author-avatar,
.author .author-avatar-wrapper img,
.author .author-avatar-wrapper picture > img,
.author .author-avatar-wrapper svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  border-radius: 0 !important; /* 圓角由容器決定，避免雙重 radius 造成渲染差異 */
  max-width: 100% !important;
  max-height: 100% !important;
  transform: none !important; /* 解除先前 global none 覆寫，讓 transition 正常被重新設定下面 */
  transition: transform 420ms cubic-bezier(.2,.9,.2,1) !important;
  will-change: transform !important;
}

/* Hover effect：放大內部圖片，但容器大小(圓形)保持不變 */
.author .author-avatar-wrapper:hover .author-avatar,
.author .author-avatar-wrapper:hover img,
.author .author-avatar-wrapper:focus-within .author-avatar {
  transform: scale(1.15) !important; /* 內部放大比例，可調整（如 1.2、1.12） */
}

/* focus 可見性（鍵盤操作時也有放大效果）*/
.author .author-avatar-wrapper:focus-within {
  outline: none !important;
}
.author .author-avatar-wrapper:focus-within .author-avatar {
  transform: scale(1.08) !important;
}

/* 手機上頭像稍微縮小 */
@media (max-width: 420px) {
  .author .author-avatar-wrapper { --avatar-size: 56px !important; }
}

/* 支援減少動作偏好：關閉動畫與放大 */
@media (prefers-reduced-motion: reduce) {
  .author .author-avatar,
  .author .author-avatar-wrapper:hover .author-avatar,
  .author .author-avatar-wrapper:focus-within .author-avatar {
    transition: none !important;
    transform: none !important;
  }
}

/* 若先前有規則把 avatar 設為 auto 或設定了高度/寬度為百分比等，強制覆蓋 */
.author img[style],
.author .author-avatar[style] {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* ------------------ END AVATAR HOVER RESTORE ------------------ */
/* ------------------ SMOOTH AVATAR HOVER IMPROVEMENT (append to end of main.css) ------------------ */
/* 目的：讓先前的「圈內放大」效果更順暢、自然，同時保留對 reduced-motion 的支援 */

/* 更平滑的動畫曲線與性能優化 */
.author .author-avatar,
.author .author-avatar-wrapper img,
.author .author-avatar-wrapper picture > img,
.author .author-avatar-wrapper svg {
  /* 平滑的縮放過渡（只針對 transform）*/
  transition: transform 420ms cubic-bezier(.22,.9,.26,1), filter 520ms ease, box-shadow 520ms ease !important;
  transform-origin: center center !important;
  will-change: transform, filter !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  -webkit-transform: translateZ(0) !important; /* 觸發 GPU 加速，減少掉幀 */
}

/* 保留容器為正圓、內部放大但不外溢 */
.author .author-avatar-wrapper {
  overflow: hidden !important; /* 確保放大時被裁切在圓內 */
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* 更穩定的圓形遮罩在某些瀏覽器 */
}

/* Hover / focus：輕柔放大並加 subtle glow（視覺回饋，但不誇張） */
.author .author-avatar-wrapper:hover .author-avatar,
.author .author-avatar-wrapper:focus-within .author-avatar,
.author .author-avatar-wrapper:active .author-avatar {
  transform: scale(1.14) !important;          /* 放大比例，可微調（1.08-1.2） */
  filter: saturate(1.03) contrast(1.02) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08) inset !important; /* 內陰影，讓放大看起來在「圈內」 */
}

/* 在使用鍵盤 focus 時也給予同樣平滑效果 */
.author .author-avatar-wrapper:focus-within {
  outline: none !important;
}

/* 手機上以觸控為主，使用 active 來模擬 hover（避免 hover 導致持續放大） */
@media (hover: none) and (pointer: coarse) {
  .author .author-avatar-wrapper:hover .author-avatar { transform: none !important; }
  .author .author-avatar-wrapper:active .author-avatar { transform: scale(1.08) !important; }
}

/* 尊重偏好：若使用者偏好減少動態，關閉動畫與放大 */
@media (prefers-reduced-motion: reduce) {
  .author .author-avatar,
  .author .author-avatar-wrapper img,
  .author .author-avatar-wrapper picture > img,
  .author .author-avatar-wrapper svg {
    transition: none !important;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
    will-change: auto !important;
  }
}

/* 小調整：避免放大時圖片邊緣有鋸齒（可選） */
.author .author-avatar-wrapper img {
  image-rendering: optimizeQuality !important;
}
/* ------------------ TIGHTEN: bring .post-item-categories closer to .post-item-title ------------------ */
/* Append to the end of main.css */

/* Make the heading row behave predictably and keep categories close to the title */
.post-item .post-item-heading {
  display: flex !important;
  align-items: center !important; /* vertical center */
  gap: 6px !important;            /* reduce spacing between title and categories */
  column-gap: 6px !important;
  flex-wrap: wrap !important;     /* allow wrapping but keep items tight */
  min-width: 0 !important;        /* allow children to shrink properly */
}

/* Title: allow it to shrink (prevent it from pushing categories far away)
   and ensure ellipsis when too long so categories sit next to it */
.post-item .post-item-heading .post-item-title {
  flex: 1 1 auto !important;      /* take available space but can shrink */
  min-width: 0 !important;        /* important for text truncation inside flex */
  margin: 0 !important;
  padding-right: 4px !important;  /* small breathing room before categories */
  overflow: hidden !important;
}

/* Make the link inside title ellipsize rather than forcing layout expansion */
.post-item .post-item-title a {
  display: inline-block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* Categories: keep them as a fixed-size group next to the title */
.post-item .post-item-categories {
  display: flex !important;
  flex: 0 0 auto !important;     /* do not grow — stay next to title */
  gap: 6px !important;
  margin: 0 !important;           /* remove extra margin that could add distance */
  align-items: center !important;
  white-space: nowrap !important; /* keep category badges on the same row when possible */
}

/* Individual category items: compact spacing */
.post-item .post-item-categories li {
  margin: 0 !important;
  padding: 0 !important;
}

/* Safe adjustments for small screens: keep categories visible but avoid overflow */
@media screen and (max-width: 420px) {
  .post-item .post-item-heading { gap: 4px !important; }
  .post-item .post-item-title a { white-space: normal !important; } /* allow wrap on very narrow screens */
  .post-item .post-item-categories { gap: 4px !important; }
}
/* ========== MOBILE FIX: force date small + title+categories to the right (minimal, mobile-only) ========== */
@media screen and (max-width: 768px) {
  /* parent: ensure stable box + no weird negative margins */
  .post-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    min-width: 0 !important;
  }

  /* shrink date so title gets room; keep it at left */
  .post-item .post-item-date {
    flex: 0 0 76px !important;
    min-width: 76px !important;
    width: 76px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    text-align: left !important;
    position: relative !important;
    z-index: 2 !important; /* behind title if accidental overlap */
    line-height: 1.2 !important;
  }

  /* heading placed to the right of date (row), but constrained */
  .post-item .post-item-heading {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important; /* allow truncation */
    box-sizing: border-box !important;
    overflow: visible !important;
    /* ensure heading doesn't overlap the left date area */
    margin-left: 0 !important;
    padding-left: 0 !important;
    z-index: 3 !important;
    max-width: calc(100% - 92px) !important; /* keep buffer from wrapper edges (92 = date + paddings) */
  }

  /* title: take remaining space, truncate on single line to avoid overflow */
  .post-item .post-item-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    line-height: 1.35 !important;
    box-sizing: border-box !important;
    z-index: 4 !important;
  }

  .post-item .post-item-title a {
    display: inline-block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    transition: color 180ms ease !important; /* keep color feedback only */
  }

  /* categories: stay to the right of title, but do not force layout expansion */
  .post-item .post-item-categories {
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    z-index: 3 !important;
  }

  /* guard: prevent parent hover translations from changing mobile layout */
  .post-item:hover {
    transform: none !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* Very narrow phones: allow wrapping so nothing overlaps or overflows */
@media screen and (max-width: 420px) {
  .post-item .post-item-heading {
    flex-wrap: wrap !important;
    gap: 6px !important;
    max-width: 100% !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .post-item .post-item-categories {
    width: 100% !important;
    margin-top: 4px !important;
    gap: 6px !important;
    white-space: normal !important;
    flex-wrap: wrap !important;
  }
}
/* ========= FORCE-FIX post-item layout (append to end of main.css) ========= */
/* Goal: prevent .post-item-date overlapping/cutting .post-item-title on mobile + desktop.
   Uses a stable grid: [date][content]. Keeps desktop hover behavior intact. */

.post-item {
  /* Use grid to guarantee two-column layout (date | heading) and prevent overlap */
  display: grid !important;
  grid-template-columns: 72px 1fr !important; /* date fixed, content flexible */
  gap: 12px !important;
  align-items: center !important;
  box-sizing: border-box !important;
  overflow: visible !important; /* ensure children are visible and not clipped */
  min-width: 0 !important; /* allow children to shrink (important for ellipsis) */
}

/* Date column: small fixed width, left aligned, never grows */
.post-item .post-item-date {
  flex: 0 0 auto !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  padding-right: 8px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  text-align: left !important;
  position: relative !important;
  z-index: 1 !important;
  line-height: 1.2 !important;
}

/* Heading/content column: lives to the right of date and must be allowed to shrink */
.post-item .post-item-heading {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important; /* critical for truncation inside flex/grid */
  overflow: visible !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
}

/* Title: truncate on single line to avoid overflow; desktop still shows full when space */
.post-item .post-item-title {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
  box-sizing: border-box !important;
  z-index: 3 !important;
}

.post-item .post-item-title a {
  display: inline-block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  transition: color 160ms ease !important; /* keep color feedback only */
}

/* Categories: keep next to title but do not force expansion of content column */
.post-item .post-item-categories {
  display: flex !important;
  flex: 0 0 auto !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
}

/* Prevent hover transform on mobile from changing spacing (keep hover visuals but not layout-shifting) */
@media screen and (max-width: 768px) {
  .post-item:hover {
    transform: none !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* Very narrow phones: allow title to wrap and categories drop to next line */
@media screen and (max-width: 420px) {
  .post-item {
    grid-template-columns: 64px 1fr !important; /* slightly smaller date on very small screens */
    gap: 8px !important;
  }
  .post-item .post-item-heading {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important; /* allow wrap */
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .post-item .post-item-categories {
    width: 100% !important;
    margin-top: 6px !important;
    gap: 6px !important;
    white-space: normal !important;
    flex-wrap: wrap !important;
  }
}

/* Optional: if you prefer an even smaller date, change the two "72px" values above to 64px or 56px. */
/* ======= EMERGENCY OVERRIDE: fix post-item date/title overlap (append to file end) ======= */

/* 1) Base: force two-column grid for each post row (date | content) */
.post-item {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important; /* date fixed, content flexible */
  gap: 12px !important;
  align-items: center !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  min-width: 0 !important;
  position: relative !important;
}

/* 2) DATE: always single-line, no background, no transform, very small width */
.post-item .post-item-date {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  white-space: nowrap !important;       /* never wrap */
  overflow: visible !important;
  text-overflow: clip !important;
  padding: 0 8px 0 0 !important;
  box-sizing: border-box !important;
  background: transparent !important;   /* remove any accidental bg */
  border: none !important;
  transform: none !important;          /* remove scale/transform side-effects */
  transition: none !important;
  z-index: 1 !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
}

/* remove any pseudo-elements that might draw a box near date */
.post-item .post-item-date::before,
.post-item .post-item-date::after {
  display: none !important;
  content: none !important;
}

/* also ensure child text elements do not have backgrounds */
.post-item .post-item-date * {
  background: transparent !important;
  box-shadow: none !important;
}

/* 3) HEADING: content column must be allowed to shrink/grow; title above categories */
.post-item .post-item-heading {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;             /* critical for truncation/word-wrap */
  overflow: visible !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
}

/* 4) TITLE: desktop shows full (wrap), mobile wraps or ellipsizes safely */
.post-item .post-item-title {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  z-index: 3 !important;
  /* default mobile behavior: single-line ellipsis to avoid breaking layout */
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

/* Link inside title */
.post-item .post-item-title a {
  display: inline-block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  transition: color 160ms ease !important;
}

/* 5) CATEGORIES: keep compact and don't push layout */
.post-item .post-item-categories {
  display: flex !important;
  flex: 0 0 auto !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
}

/* 6) DESKTOP: allow title to wrap (prevent cut) */
@media screen and (min-width: 769px) {
  .post-item {
    grid-template-columns: 72px minmax(0, 1fr) !important; /* slightly larger date on desktop */
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;   /* allow wrap on desktop so title is not clipped */
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }

  /* Make sure date doesn't visually overlay content on desktop */
  .post-item .post-item-date { z-index: 1 !important; }
  .post-item .post-item-heading { z-index: 2 !important; }
  .post-item .post-item-title { z-index: 3 !important; }
}

/* 7) SMALL PHONES: shrink date more and allow categories to wrap as needed */
@media screen and (max-width: 420px) {
  .post-item {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  .post-item .post-item-date {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    font-size: 14px !important;
  }
  .post-item .post-item-heading { flex-wrap: wrap !important; align-items: flex-start !important; }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;  /* allow wrap to avoid truncation on very narrow screens */
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .post-item .post-item-categories {
    width: 100% !important;
    margin-top: 6px !important;
    gap: 6px !important;
    white-space: normal !important;
    flex-wrap: wrap !important;
  }
}

/* 8) Extra hard overrides to prevent any earlier hover/transform/box-shadow from overlaying title */
.post-item .post-item-date,
.post-item .post-item-date * {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}

/* 9) Debug helper (temporary) - uncomment to see boundaries */
/*
.post-item { outline: 1px dashed rgba(0,255,0,0.12) !important; }
.post-item .post-item-date { outline: 1px dashed rgba(255,0,0,0.12) !important; }
.post-item .post-item-heading { outline: 1px dashed rgba(0,0,255,0.08) !important; }
*/
/* MOVE TITLE RIGHT — minimal override (append to end of main.css) */
/* Push title to the right a bit so .post-item-date never visually overlaps it. */

.post-item {
  /* ensure two-column layout baseline (safe override) */
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  min-width: 0 !important;
}

/* Small fixed date (never wrap) — keep behind title */
.post-item .post-item-date {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  z-index: 1 !important;
  margin-right: 0 !important;
  padding-right: 6px !important;
  transform: none !important;
}

/* The key: push the entire heading (title + categories) to the right */
.post-item .post-item-heading {
  padding-left: 12px !important; /* ← the shift you wanted */
  box-sizing: border-box !important;
  min-width: 0 !important; /* allow inner truncation/wrapping */
  z-index: 2 !important;
}

/* Ensure title has room and is above date */
.post-item .post-item-title {
  z-index: 3 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

/* Desktop: give date slightly more room and more padding for title */
@media screen and (min-width: 769px) {
  .post-item {
    grid-template-columns: 80px minmax(0, 1fr) !important;
  }
  .post-item .post-item-heading {
    padding-left: 16px !important; /* more breathing room on desktop */
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important; /* allow wrap on desktop so long titles aren't truncated */
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* Small phones: shrink date, but still push title a little; allow wrap when necessary */
@media screen and (max-width: 420px) {
  .post-item {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  .post-item .post-item-date {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    padding-right: 6px !important;
    font-size: 14px !important;
  }
  .post-item .post-item-heading {
    padding-left: 8px !important;
    flex-wrap: wrap !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important; /* avoid permanent truncation on very narrow screens */
    overflow: visible !important;
  }
}

/* Safety: remove any accidental background/box-shadow on date that can visually cover title */
.post-item .post-item-date,
.post-item .post-item-date * {
  background: transparent !important;
  box-shadow: none !important;
}
/* ===== Minimal fix: center date vertically + nudge heading right ===== */
/* Append this block at the very end of main.css */

.post-item {
  /* grid ensures stable two-column layout; center items vertically */
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important; /* <-- vertical centering of date vs title */
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: visible !important;
  position: relative !important;
}

/* DATE: fixed narrow column, centered vertically and horizontally within its cell */
.post-item .post-item-date {
  display: flex !important;
  align-items: center !important;    /* vertical center */
  justify-content: flex-end !important; /* keep date close to title (right edge of date cell) */
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  padding: 0 8px 0 0 !important;     /* right padding to separate from title */
  white-space: nowrap !important;    /* never wrap */
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  z-index: 1 !important;
  line-height: 1 !important;
  font-weight: 700 !important;
}

/* remove any pseudo elements near date that might draw boxes */
.post-item .post-item-date::before,
.post-item .post-item-date::after { content: none !important; display: none !important; }

/* HEADING: nudge entire heading to the right so date never overlaps title */
.post-item .post-item-heading {
  padding-left: 18px !important; /* ← the horizontal nudge */
  box-sizing: border-box !important;
  min-width: 0 !important;       /* allow inner truncation/wrapping */
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  z-index: 2 !important;
}

/* TITLE: ensure it sits above date and truncates/wraps properly */
.post-item .post-item-title {
  z-index: 3 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: nowrap !important;      /* default: single-line ellipsis on small screens */
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

/* on desktop allow wrap so long titles aren't visually cut */
@media screen and (min-width: 769px) {
  .post-item { grid-template-columns: 80px minmax(0, 1fr) !important; }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .post-item .post-item-heading { padding-left: 22px !important; } /* slightly more breathing room on desktop */
}

/* very small screens: shrink date, allow heading wrap if needed */
@media screen and (max-width: 420px) {
  .post-item { grid-template-columns: 56px minmax(0, 1fr) !important; gap: 8px !important; }
  .post-item .post-item-date {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    font-size: 14px !important;
    padding-right: 6px !important;
    justify-content: center !important; /* center horizontally on very narrow phones */
  }
  .post-item .post-item-heading { padding-left: 8px !important; flex-wrap: wrap !important; align-items: flex-start !important; }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important; /* allow wrap to avoid permanent truncation on tiny screens */
    overflow: visible !important;
  }
}

/* Safety: ensure date has no hover-transform or box that can cover title */
.post-item .post-item-date,
.post-item .post-item-date * {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}
/* ====== FIX: keep date inside card + horizontally center date relative to title ====== */
/* Append to end of main.css - minimal & targeted override */

.post-item {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important; /* date | content */
  gap: 12px !important;
  align-items: center !important;          /* vertical center */
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: visible !important;
  /* INSET everything a bit so date cannot escape the card's rounded edge */
  padding-left: 18px !important;           /* <-- keep date inside card */
  padding-right: 18px !important;
  position: relative !important;
}

/* Date: center horizontally & vertically inside its column; never wrap */
.post-item .post-item-date {
  display: flex !important;
  align-items: center !important;          /* vertical center */
  justify-content: center !important;      /* horizontal center relative to title */
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  white-space: nowrap !important;          /* never wrap */
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  z-index: 1 !important;
  line-height: 1 !important;
  font-weight: 700 !important;
}

/* remove stray pseudo-elements that might draw outside the card */
.post-item .post-item-date::before,
.post-item .post-item-date::after {
  content: none !important;
  display: none !important;
}

/* Heading: keep nudged right but inside the padded area */
.post-item .post-item-heading {
  padding-left: 12px !important;           /* small nudge, but date kept inside by .post-item padding */
  box-sizing: border-box !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  z-index: 2 !important;
}

/* Title: default single-line ellipsis on small screens; allow wrap on desktop */
.post-item .post-item-title {
  z-index: 3 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

/* Desktop: more room for date and allow title wrap so it's not cut off */
@media screen and (min-width: 769px) {
  .post-item {
    padding-left: 22px !important;
    grid-template-columns: 80px minmax(0, 1fr) !important;
  }
  .post-item .post-item-date {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    justify-content: center !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .post-item .post-item-heading { padding-left: 18px !important; }
}

/* Very narrow phones: shrink date and allow heading to wrap */
@media screen and (max-width: 420px) {
  .post-item {
    padding-left: 12px !important;
    gap: 8px !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
  }
  .post-item .post-item-date {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    font-size: 14px !important;
    justify-content: center !important;   /* center small date */
  }
  .post-item .post-item-heading {
    padding-left: 8px !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;        /* allow wrap to avoid truncation on tiny screens */
    overflow: visible !important;
  }
}

/* Safety: ensure date box doesn't create horizontal overflow */
html, body {
  overflow-x: hidden !important;
}
/* ===== Quick fix: keep date inside card + nudge title right ===== */
.post-item {
  display: grid !important;
  grid-template-columns: 72px 1fr !important; /* left: date, right: content */
  gap: 16px !important;
  align-items: center !important; /* vertical center date <-> title */
  padding: 8px 18px !important;   /* keep content inset so date doesn't escape card */
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: visible !important;
  position: relative !important;
}

.post-item .post-item-date {
  display: flex !important;
  align-items: center !important;    /* vertical center in its column */
  justify-content: center !important;/* horizontal center relative to title */
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  white-space: nowrap !important;    /* never wrap the date */
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  z-index: 1 !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

/* remove stray pseudo elements near date */
.post-item .post-item-date::before,
.post-item .post-item-date::after { content: none !important; display: none !important; }

/* push heading right a bit so date never overlaps title */
.post-item .post-item-heading {
  padding-left: 18px !important; /* the "move right" you wanted */
  box-sizing: border-box !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  z-index: 2 !important;
}

/* title: keep truncation on small screens, but allow wrap on desktop */
.post-item .post-item-title {
  z-index: 3 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

/* desktop: allow wrap so long titles are not cut */
@media screen and (min-width: 769px) {
  .post-item {
    grid-template-columns: 88px minmax(0, 1fr) !important; /* give desktop date a bit more room */
    padding-left: 20px !important;
  }
  .post-item .post-item-date {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .post-item .post-item-heading { padding-left: 20px !important; }
}

/* very small screens: shrink date & allow heading wrap if necessary */
@media screen and (max-width: 420px) {
  .post-item {
    grid-template-columns: 56px 1fr !important;
    gap: 8px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .post-item .post-item-date {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    font-size: 14px !important;
    justify-content: center !important;
  }
  .post-item .post-item-heading {
    padding-left: 8px !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  .post-item .post-item-title,
  .post-item .post-item-title a {
    white-space: normal !important; /* allow wrap on tiny screens */
    overflow: visible !important;
  }
}

/* safety: prevent horizontal overflow from page */
html, body { overflow-x: hidden !important; }
/* ===== Minimal tweak: nudge date slightly left while keeping it inside the card ===== */
/* Append to end of main.css */

.post-item {
  /* keep the safe inset so the date won't escape the rounded card */
  padding-left: 10px !important;   /* reduced from previous inset so date moves left */
  padding-right: 14px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Move the date a bit left by reducing its internal left padding.
   Keep left alignment (flex-start) so numbers sit close to the card edge but still inset. */
.post-item .post-item-date {
  padding-left: 2px !important;    /* small inset from card edge */
  padding-right: 10px !important;  /* breathing room to title */
  justify-content: flex-start !important; /* keep left-aligned in its column */
  width: 72px !important;          /* keep existing column width */
  min-width: 72px !important;
  max-width: 72px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Desktop: slightly more room for date column but still left-shifted (if you use larger desktop widths) */
@media screen and (min-width: 769px) {
  .post-item { padding-left: 14px !important; } /* desktop card inset slightly larger */
  .post-item .post-item-date {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    padding-left: 4px !important; /* keep small inset on desktop */
  }
}

/* Very small phones: keep date centered horizontally to avoid visual imbalance */
@media screen and (max-width: 420px) {
  .post-item { padding-left: 12px !important; }
  .post-item .post-item-date {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    padding-left: 0 !important;
    justify-content: center !important;
  }
}
/* ===== Final nudge: move date slightly further left (append to end of main.css) ===== */

/* Reduce card inset a bit (keep enough space so date doesn't get clipped) */
.post-item {
  padding-left: 8px !important;   /* safe inset inside rounded card */
  padding-right: 14px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Nudge date left visually without changing column sizing */
.post-item .post-item-date {
  /* remove extra inner left padding and apply a small negative margin so it sits closer to edge */
  padding-left: 0 !important;
  padding-right: 10px !important;
  margin-left: -8px !important;   /* <-- main tweak: move date left by 8px */
  justify-content: flex-start !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Desktop: slightly larger left nudge (if you want it more pronounced on wide screens) */
@media screen and (min-width: 769px) {
  .post-item { padding-left: 12px !important; }
  .post-item .post-item-date {
    margin-left: -12px !important; /* a little more left on desktop */
    padding-left: 2px !important;  /* keep a hair of inset so text isn't flush against edge */
  }
}

/* Very small screens: keep date centered to avoid visual imbalance */
@media screen and (max-width: 420px) {
  .post-item { padding-left: 12px !important; }
  .post-item .post-item-date {
    margin-left: 0 !important;     /* no negative shift on very narrow phones */
    padding-left: 0 !important;
    justify-content: center !important;
    width: 56px !important;
    min-width: 56px !important;
  }
}

/* Safety: ensure date won't be clipped by overflow:hidden anywhere up the chain */
.post-item,
.post-item .post-item-date,
.post-item .post-item-heading {
  overflow: visible !important;
}

/* Keep hover animation intact (explicitly ensure transform is allowed) */
.post-item { transition: transform 320ms cubic-bezier(.2,.9,.2,1) !important; }
.post-item:hover { transform: translateX(10px) !important; }
/* ===== Prevent title clipping on hover + smoother scale animation =====
   - Allow overflow on the post-item / heading / title so scaled title can escape without being clipped.
   - Ensure the title link is positioned above the date (z-index) when hovered.
   - Add a smooth, modest scale transform for hover with respects for reduced-motion.
   Append this block to the END of main.css. */

.post-item,
.post-item .post-item-heading,
.post-item .post-item-title {
  /* Allow visual overflow so scale isn't clipped by parent boxes */
  overflow: visible !important;
  /* keep box-sizing consistent */
  box-sizing: border-box !important;
}

/* Make sure the anchor can be transformed and drawn above the date */
.post-item .post-item-title a {
  position: relative !important;              /* so z-index works reliably */
  display: inline-block !important;           /* allow transform to scale the element */
  transform-origin: left center !important;   /* scale from left side (looks natural in a list) */
  will-change: transform !important;
  z-index: 1000 !important;                   /* sits above date */
  transition: transform 280ms cubic-bezier(.2,.9,.2,1), color 160ms ease !important;
  /* keep text ellipsis behavior on small screens by limiting width if desired */
  max-width: 100% !important;
  /* no overflow hidden here — parent allows overflow */
  overflow: visible !important;
}

/* Hover / focus: smooth scale (modest) and maintain readable color change */
.post-item .post-item-title a:hover,
.post-item .post-item-title a:focus {
  transform: scale(1.06) !important;          /* smooth modest enlargement */
  color: #ffffff !important;
  outline: none !important;
}

/* Keep keyboard accessibility: also scale on :focus-visible for keyboard users */
.post-item .post-item-title a:focus-visible {
  transform: scale(1.04) !important;
  box-shadow: 0 6px 18px rgba(13,18,43,0.08) !important;
}

/* Ensure date stays visually under the title (lower stacking) */
.post-item .post-item-date {
  z-index: 1 !important;
  position: relative !important; /* ensure z-index context */
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .post-item .post-item-title a,
  .post-item .post-item-title a:hover,
  .post-item .post-item-title a:focus,
  .post-item .post-item-title a:focus-visible {
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
  }
}