:root {
  /* 浅色主题变量 */
  --bg-color: #f5f5f5;
  --text-color: #383838;
  --text-ecolor: #3838389c;
  --card-bg: #ffffff66;
  --primary-color: #4a6cf7;
  --border-color: #ddd;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --toggle-bg: hsl(var(--thyuu--main-color) / .7);
  --toggle-sun: hsl(var(--thyuu--main-color));
  --toggle-moon: #e0e0e0;
  /* 全局弹窗（toast）配色 */
  --messagegreen: #21a67599;
  --messagered: #f4798399;
  /* 全站统一内容宽度与左右页边距 */
  --fasgt-content-max: 50rem;
  --fasgt-content-gutter: clamp(1rem, 4vw, 2.5rem);
  --fasgt-content-frame: calc(var(--fasgt-content-max) + var(--fasgt-content-gutter) * 2);
  /* 文章卡片栅格：首页列表与搜索页共用，保证列宽与间距一致 */
  --fasgt-card-grid: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  --fasgt-card-gap: clamp(0.8rem, 1.6vw, 1.3rem);
}

[theme="dark"] {
  /* 深色主题变量 */
  --bg-color: #1a1a1a;
  --text-color: #f0f0f0;
  --text-ecolor: #e7e7e7c2;
  --card-bg: #2d2d2d8f;
  --primary-color: #6c94ff;
  --border-color: #444;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --toggle-bg: #3a3a3a;
  --toggle-sun: #888;
  --toggle-moon: #e0e0e0;
  --messagegreen: #21a675c2;
  --messagered: #f47983c2;
}
.site-main {
  margin-top: 3rem;
  padding-bottom: 1.5rem;
}
/* 首页「文章 / 分类 / 动态」胶囊分段控件 */
.glass-radio-group {
  --seg-bg: rgba(0, 0, 0, 0.045);
  --seg-border: rgb(255 255 255 / 68%);
  --seg-active-bg: hsl(var(--thyuu--main-color) / 0.1);
  --seg-active-color: hsl(var(--thyuu--main-color));
  display: flex;
  position: relative;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  margin-top: 1.5rem;
  padding: 4px;
  border: 1px solid var(--seg-border);
  border-radius: 999px;
  background: rgb(243 232 232 / 12%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
}

.glass-radio-group::-webkit-scrollbar {
  display: none;
}

[theme="dark"] .glass-radio-group {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.glass-radio-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.glass-radio-group input:focus,
.glass-radio-group input:active {
  outline: none;
  background: transparent;
}

.glass-radio-group label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 4.6rem;
  padding: 0.42rem 1.05rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text-ecolor);
  cursor: pointer;
  position: relative;
  z-index: 2;
  border-radius: 999px;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.glass-radio-group label:hover {
  color: hsl(var(--thyuu--main-color));
}

.glass-radio-group input:checked + label {
  color: var(--seg-active-color);
}

.glass-radio-group input:focus-visible + label {
  outline: 2px solid hsl(var(--thyuu--main-color) / 0.7);
  outline-offset: -2px;
}

.glass-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: calc((100% - 8px) / 3);
  border-radius: 999px;
  background: var(--seg-active-bg);
  z-index: 1;
  pointer-events: none;
  transition: transform 0.2s ease;
}

/* 以上是首页tab栏样式 */

/* 右下角简约明暗主题切换 */
.theme-toggle-btn {
position: fixed;
right: calc(1.1rem + env(safe-area-inset-right, 0px));
bottom: calc(1.1rem + 24px + env(safe-area-inset-bottom, 0px));
z-index: 9990;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
box-sizing: border-box;
border: 1px solid rgba(0, 0, 0, 0.14);
border-radius: 50%;
background: rgba(255, 255, 255, 0.35);
color: #3a3a3c;
cursor: pointer;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

[theme="dark"] .theme-toggle-btn {
border-color: rgba(255, 255, 255, 0.2);
background: rgba(28, 28, 32, 0.35);
color: #ececf1;
}

.theme-toggle-input {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
margin: 0;
border-radius: 50%;
opacity: 0;
cursor: pointer;
}

.theme-toggle-icon {
position: absolute;
width: 20px;
height: 20px;
fill: none;
stroke: currentColor;
stroke-width: 1.7;
stroke-linecap: round;
stroke-linejoin: round;
transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle-icon--moon {
opacity: 1;
transform: rotate(0deg) scale(1);
}

.theme-toggle-icon--sun {
opacity: 0;
transform: rotate(-45deg) scale(0.8);
}

.theme-toggle-input:checked ~ .theme-toggle-icon--moon {
opacity: 0;
transform: rotate(45deg) scale(0.8);
}

.theme-toggle-input:checked ~ .theme-toggle-icon--sun {
opacity: 1;
transform: rotate(0deg) scale(1);
}

.theme-toggle-btn:has(.theme-toggle-input:focus-visible) {
outline: 2px solid currentColor;
outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
.theme-toggle-icon {
transition: none;
}
}

/* 回到顶部：位于明暗切换按钮正上方，样式保持一致 */
.back-to-top-btn {
position: fixed;
right: calc(1.1rem + env(safe-area-inset-right, 0px));
bottom: calc(1.1rem + 24px + 50px + env(safe-area-inset-bottom, 0px));
z-index: 9990;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
padding: 0;
box-sizing: border-box;
border: 1px solid rgba(0, 0, 0, 0.14);
border-radius: 50%;
background: rgba(255, 255, 255, 0.35);
color: #3a3a3c;
cursor: pointer;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
opacity: 0;
visibility: hidden;
pointer-events: none;
transform: translateY(10px) scale(0.9);
transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.back-to-top-btn.is-visible {
opacity: 1;
visibility: visible;
pointer-events: auto;
transform: translateY(0) scale(1);
}

[theme="dark"] .back-to-top-btn {
border-color: rgba(255, 255, 255, 0.2);
background: rgba(28, 28, 32, 0.35);
color: #ececf1;
}

.back-to-top-btn svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}

.back-to-top-btn:focus-visible {
outline: 2px solid currentColor;
outline-offset: 3px;
}

.theme-toggle-btn,
.back-to-top-btn {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[theme="dark"] .theme-toggle-btn,
[theme="dark"] .back-to-top-btn {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}

@media (prefers-reduced-motion: reduce) {
.back-to-top-btn {
transition: none;
}
}
/* 添加内容容器，用于定位所有内容区域 */
.content-container {
  position: relative;
  min-height: 400px;
  /* 根据内容高度调整 */
  width: 100%;
  margin-top: 1rem;
  /* overflow: hidden; */
}

/* 确保所有内容区域在同一位置 */
/* .content-container .for-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
.for-card {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  top: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  display: none;
}
.for-card.active{
  opacity: 1;
  transform: translateY(0);
  display: flex;
} */
/* 内容区域样式 */
/* 修复动画的关键部分 */


.for-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 1;
}

.for-card.active {
  opacity: 1;
  transform: translateY(0);
  z-index: 2;
}

/* 文章页面特殊样式 - 不使用绝对定位 */
.post-page .for-card {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  opacity: 1;
  transform: none;
  z-index: auto;
}

.post-page .for-card.active {
  opacity: 1;
  transform: none;
  z-index: auto;
}


.card {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  width: 80%;
  background: var(--card-bg);
  padding: 0.4em;
  border-radius: 6px;
  box-shadow: 0 4px 8px hsl(var(--thyuu--main-color) / .2);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 6rem;
  height: 6rem;
  border-radius: 6px;
  flex-shrink: 0;
  margin-right: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* .card-image:hover {
    transform: scale(0.98);
    transition: transform 0.3s ease;
  } */

.card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  justify-content: flex-start;
  width: 100%;
}

.category {
  text-transform: uppercase;
  font-size: 1em;
  font-weight: 600;
  color: var(--text-color);
  /* padding-bottom: 5px; */
  text-align: left;
  /* Align text to the left */
}
.category a {
  color: var(--text-color);
  text-decoration: none;
}
.category-tags a{
  color: var(--text-ecolor);
  text-decoration: none;
}

.category:hover {
  cursor: pointer;
}

.heading {
  font-weight: 600;
  color: var(--text-ecolor);
  margin-bottom: 10px;
  text-align: left;
  /* Align text to the left */
  font-size: .6em;
  height: 2.9rem;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  text-overflow: ellipsis;
  overflow: hidden;
}

.heading:hover {
  cursor: pointer;
}

.author {
  /* color: var(--text-ecolor); */
  color: hsl(var(--thyuu--main-color) / .6);
  font-weight: 400;
  font-size: 11px;
  text-align: left;
  /* Align text to the left */
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  gap: 0.3rem;

}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-start;
}

.category-tags {
  color: var(--text-ecolor);
  font-size: 0.9rem;
}

.category-tags a {
  color: var(--text-ecolor);
  text-decoration: none;
}

.name {
  font-weight: 600;
}

.name:hover {
  cursor: pointer;
}

/* 文章卡片结束 */

/* 首页三个标签页叠层：只有当前面板参与文档流，
   其余面板绝对定位叠放，避免用最高的面板撑高容器，
   在文章列表分页下方留下大块空白 */
.content-container.home-tabs {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--fasgt-content-frame);
  margin: 41px auto;
  padding: 0 var(--fasgt-content-gutter);
  min-height: 0;
  /* 非当前标签面板绝对定位叠放，内容更高时会撑出滚动高度，
     导致页脚下方出现可滚动空白；在容器内裁掉这部分溢出 */
  overflow: hidden;
  overflow: clip;
  overflow-clip-margin: 1rem;
}

.content-container.home-tabs > .for-card {
  position: absolute;
  top: 0;
  left: var(--fasgt-content-gutter);
  right: var(--fasgt-content-gutter);
  display: grid;
  grid-template-columns: var(--fasgt-card-grid);
  align-content: start;
  gap: var(--fasgt-card-gap);
  width: auto;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 1;
  /* 让三个面板各自持有稳定的合成层，切换时不必重建图层 */
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.content-container.home-tabs > .for-card.active {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 2;
}

/* JS 接管后：当前面板也保持绝对叠放，不再在相对/绝对定位之间切换。
   定位方式变化会触发整层面板重新布局与背景图重新栅格化，造成切换瞬间闪白；
   容器高度由 JS 写入 --home-tabs-h，保持与原「当前面板撑高」一致的滚动高度。 */
.content-container.home-tabs.home-tabs--stacked {
  height: var(--home-tabs-h, auto);
}

.content-container.home-tabs.home-tabs--stacked > .for-card.active {
  position: absolute;
  top: 0;
  left: var(--fasgt-content-gutter);
  right: var(--fasgt-content-gutter);
  width: auto;
}

/* 搜索页、分类/归档页结果列表：与首页文章列表共用同一套栅格列宽与间距 */
.search-content,
.archive-content {
  display: grid;
  grid-template-columns: var(--fasgt-card-grid);
  align-content: start;
  gap: var(--fasgt-card-gap);
}

/* 「动态」标签是时间轴，始终单列并占满容器，不随卡片栅格拆列 */
.content-container.home-tabs > #content-dynamic {
  grid-template-columns: minmax(0, 1fr);
}

/* 分类卡片：小圆角矩形 + 背景图铺底 + 居中 #分类名 */
.content-container.home-tabs > #content-category {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: clamp(0.7rem, 1.4vw, 1rem);
}

.category-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 6rem;
  padding: 1rem 1.2rem;
  overflow: hidden;
  border: 1px solid hsl(var(--thyuu--main-color) / 0.18);
  border-radius: 0.85rem;
  background-color: hsl(var(--thyuu--main-color) / 0.35);
  background-image: linear-gradient(135deg, hsl(var(--thyuu--main-color) / 0.9), hsl(var(--thyuu--main-color) / 0.45));
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 10px hsl(var(--thyuu--main-color) / 0.18);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 文字下方的可读性遮罩 */
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.category-card-name {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  word-break: break-word;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px hsl(var(--thyuu--main-color) / 0.28);
}

@media (max-width: 640px) {
  .content-container.home-tabs > #content-category {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 首页卡片改为纵向排布，随栅格列数自适应 */
.home-tabs .card,
.home-links .card {
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.55rem;
  overflow: hidden;
  border: 1px solid hsl(var(--thyuu--main-color) / 0.12);
  border-radius: 1rem;
  background: var(--card-bg);
  box-shadow: 0 4px 8px hsl(var(--thyuu--main-color) / 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.home-tabs .card-image,
.home-links .card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 0.7rem;
  border-radius: 0.7rem;
}

.home-tabs .card-content,
.home-links .card-content {
  padding: 0 0.35rem 0.15rem;
}

.home-tabs .card .category,
.home-links .card .category {
  overflow: hidden;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-tabs .card .heading,
.home-links .card .heading {
  height: auto;
  min-height: 3.1em;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.55;
  -webkit-line-clamp: 2;
}

.home-tabs .card .heading a,
.home-links .card .heading a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.home-tabs .card .heading a:hover,
.home-links .card .heading a:hover {
  color: hsl(var(--thyuu--main-color));
}

.home-tabs .card .author,
.home-links .card .author {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.home-tabs .card .category-tags,
.home-links .card .category-tags {
  font-size: 0.75rem;
}

/* 空状态与分页横跨整行 */
.home-tabs .card-empty,
.home-links .card-empty,
.search-content .card-empty,
.archive-content .card-empty {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  height: auto;
}

.home-tabs .card-empty .card-content,
.home-links .card-empty .card-content,
.search-content .card-empty .card-content,
.archive-content .card-empty .card-content {
  padding: 0.75rem 0.5rem;
}

/* 首页友链区块（顶部导航「友链」定位到这里） */
.home-links {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--fasgt-content-frame);
  margin: 2rem auto 0;
  padding-block: 0 clamp(1rem, 3vw, 1.5rem);
  padding-left: var(--fasgt-content-gutter);
  padding-right: var(--fasgt-content-gutter);
  scroll-margin-top: 6rem;
}

.home-links-title {
  margin: 0 0 0.9rem 0.25rem;
  color: var(--text-color);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* 友链：小头像玻璃卡片 */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  align-content: start;
  gap: clamp(0.7rem, 1.4vw, 1rem);
  width: 100%;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid hsl(var(--thyuu--main-color) / 0.14);
  border-radius: 0.9rem;
  background: var(--card-bg);
  box-shadow: 0 4px 10px hsl(var(--thyuu--main-color) / 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

a.friend-card:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--thyuu--main-color) / 0.4);
  box-shadow: 0 8px 18px hsl(var(--thyuu--main-color) / 0.2);
}

.friend-avatar {
  position: relative;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--thyuu--main-color) / 0.9), hsl(var(--thyuu--main-color) / 0.45));
  box-shadow: inset 0 0 0 1px hsl(var(--thyuu--main-color) / 0.35), 0 2px 6px hsl(var(--thyuu--main-color) / 0.25);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}

.friend-avatar-letter {
  display: block;
  line-height: 1;
}

.friend-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--card-bg);
  object-fit: cover;
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.friend-name,
.friend-desc {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.friend-name {
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 600;
}

.friend-desc {
  color: var(--text-ecolor);
  font-size: 0.72rem;
}

.friend-card-empty {
  grid-column: 1 / -1;
  border-style: dashed;
  box-shadow: none;
}

.friend-card-empty .friend-avatar {
  background: hsl(var(--thyuu--main-color) / 0.12);
  box-shadow: none;
  color: hsl(var(--thyuu--main-color));
  text-shadow: none;
}

/* 本站友链信息卡片 */
.friend-self {
  box-sizing: border-box;
  margin-top: clamp(1.2rem, 3vw, 2rem);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  border: 1px solid hsl(var(--thyuu--main-color) / 0.14);
  border-radius: 1rem;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.friend-self .friend-apply-head {
  margin-bottom: 0.7rem;
}

.friend-self-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friend-self-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.65;
}

.friend-self-key {
  flex: none;
  color: var(--text-ecolor);
}

.friend-self-value {
  color: var(--text-color);
  word-break: break-all;
  -webkit-user-select: text;
  user-select: text;
}

a.friend-self-value {
  color: hsl(var(--thyuu--main-color));
  text-decoration: none;
}

a.friend-self-value:hover {
  text-decoration: underline;
}

/* 友链申请表单 */
.friend-apply {
  box-sizing: border-box;
  margin-top: clamp(1.2rem, 3vw, 2rem);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  border: 1px solid hsl(var(--thyuu--main-color) / 0.14);
  border-radius: 1rem;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fasgtFadeUp 0.55s var(--animation-in) backwards;
}

.friend-apply-head h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.05rem;
  font-weight: 700;
}

.friend-apply-head p {
  margin: 0.4rem 0 0;
  color: var(--text-ecolor);
  font-size: 0.82rem;
  line-height: 1.7;
}

.friend-apply-form {
  margin-top: 1rem;
}

.friend-apply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.friend-apply-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.friend-apply-field.is-wide {
  grid-column: 1 / -1;
}

.friend-apply-field > span {
  color: var(--text-ecolor);
  font-size: 0.78rem;
}

.friend-apply-field input,
.friend-apply-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--card-bg) 88%, transparent);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.friend-apply-field textarea {
  min-height: 5.4rem;
  line-height: 1.7;
  resize: vertical;
}

.friend-apply-field input::placeholder,
.friend-apply-field textarea::placeholder {
  color: var(--text-ecolor);
  opacity: 0.7;
}

.friend-apply-field input:focus,
.friend-apply-field textarea:focus {
  border-color: hsl(var(--thyuu--main-color) / 0.55);
  box-shadow: 0 0 0 3px hsl(var(--thyuu--main-color) / 0.14);
}

.friend-apply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.friend-apply-hint {
  color: var(--text-ecolor);
  font-size: 0.74rem;
  line-height: 1.6;
}

.friend-apply-submit {
  padding: 0.55rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: hsl(var(--thyuu--main-color));
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.friend-apply-submit:hover {
  background: color-mix(in srgb, hsl(var(--thyuu--main-color)) 85%, #000);
}

.friend-apply-submit:active {
  transform: scale(0.97);
}

.friend-apply-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

@media (max-width: 640px) {
  .friend-apply-grid {
    gap: 0.55rem;
  }

  .friend-apply-field input,
  .friend-apply-field textarea {
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
  }

  .friend-apply-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .friend-apply-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .friend-apply {
    animation: none;
  }

  .friend-apply-field input,
  .friend-apply-field textarea,
  .friend-apply-submit {
    transition: none;
  }
}

.home-pagination {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  justify-content: center;
}

@media (max-width: 640px) {
  .content-container.home-tabs > .for-card {
    grid-template-columns: 1fr;
  }

  .home-tabs .card .heading,
  .home-links .card .heading {
    min-height: 0;
    -webkit-line-clamp: 3;
  }

  .friend-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 首页文章卡片：缩略图铺满卡片，标题与元信息压图 ========== */
.home-tabs #content-home .card,
.search-content .card,
.archive-content .card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 16 / 7;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  background-color: hsl(var(--thyuu--main-color) / 0.35);
  background-image: linear-gradient(135deg, hsl(var(--thyuu--main-color) / 0.85), hsl(var(--thyuu--main-color) / 0.45));
  box-shadow: 0 6px 16px hsl(var(--thyuu--main-color) / 0.2);
}

.home-tabs #content-home .card-image,
.search-content .card-image,
.archive-content .card-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: var(--card-cover, none),
    linear-gradient(135deg, hsl(var(--thyuu--main-color) / 0.85), hsl(var(--thyuu--main-color) / 0.45));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover, cover;
  transition: transform 0.5s ease;
}

/* 底部渐变 + 中部柔和暗角，保证居中白字在浅色照片上可读 */
.home-tabs #content-home .card::after,
.search-content .card::after,
.archive-content .card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.32) 55%,
      rgba(0, 0, 0, 0) 80%
    ),
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.42) 42%,
      rgba(0, 0, 0, 0.1) 72%,
      rgba(0, 0, 0, 0.18) 100%
    );
  pointer-events: none;
}

.home-tabs #content-home .card:hover .card-image,
.search-content .card:hover .card-image,
.archive-content .card:hover .card-image {
  transform: scale(1.04);
}

.home-tabs #content-home .card-content,
.search-content .card-content,
.archive-content .card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  padding: clamp(0.9rem, 2vw, 1.15rem);
  gap: 0.45rem;
}

.home-tabs #content-home .card .category,
.search-content .card .category,
.archive-content .card .category {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-transform: none;
  white-space: normal;
  text-overflow: clip;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.4);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-tabs #content-home .card .category a,
.search-content .card .category a,
.archive-content .card .category a {
  color: #fff;
  font-size: 22px;
  text-decoration: none;
}

.home-tabs #content-home .card .card-meta,
.search-content .card .card-meta,
.archive-content .card .card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 0.45rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.home-tabs #content-home .card .card-meta .category-tags,
.search-content .card .card-meta .category-tags,
.archive-content .card .card-meta .category-tags {
  display: inline;
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: inherit;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-tabs #content-home .card .card-meta .category-tags a,
.search-content .card .card-meta .category-tags a,
.archive-content .card .card-meta .category-tags a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.home-tabs #content-home .card .card-meta .meta-sep,
.search-content .card .card-meta .meta-sep,
.archive-content .card .card-meta .meta-sep {
  opacity: 0.65;
}

/* 空状态卡片保持浅色底，不套用封面遮罩 */
.home-tabs #content-home .card.card-empty,
.search-content .card.card-empty,
.archive-content .card.card-empty {
  aspect-ratio: auto;
  min-height: 0;
  padding: 0.55rem;
  border: 1px solid hsl(var(--thyuu--main-color) / 0.12);
  background: var(--card-bg);
}

.home-tabs #content-home .card.card-empty::after,
.search-content .card.card-empty::after,
.archive-content .card.card-empty::after {
  display: none;
}

.home-tabs #content-home .card.card-empty .card-content,
.search-content .card.card-empty .card-content,
.archive-content .card.card-empty .card-content {
  height: auto;
  padding: 0.75rem 0.5rem;
}

/* 多列时卡片变窄，按列数提高封面高度；单列保持 16 / 7 */
@media (min-width: 641px) {
  .home-tabs #content-home .card,
  .search-content .card,
  .archive-content .card {
    aspect-ratio: 3 / 2;
  }
}

@media (min-width: 840px) {
  .home-tabs #content-home .card,
  .search-content .card,
  .archive-content .card {
    aspect-ratio: 4 / 3;
  }
}

/* ========== 首页置顶区：封面轮播 ========== */
.home-sticky {
  grid-column: 1 / -1;
  position: relative;
  isolation: isolate;
  min-height: 12rem;
  aspect-ratio: 16 / 7.5;
  overflow: hidden;
  border-radius: 1.1rem;
  background: hsl(var(--thyuu--main-color) / 0.35);
  box-shadow: 0 10px 28px hsl(var(--thyuu--main-color) / 0.18);
}

.home-sticky-viewport {
  position: absolute;
  inset: 0;
}

.home-sticky-slide {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background-color: hsl(var(--thyuu--main-color) / 0.45);
  background-image: var(--card-cover, none),
    linear-gradient(135deg, hsl(var(--thyuu--main-color) / 0.85), hsl(var(--thyuu--main-color) / 0.45));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity 0.55s ease, transform 0.8s ease, visibility 0.55s;
}

.home-sticky-slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.home-sticky:hover .home-sticky-slide.is-active {
  transform: scale(1.02);
}

.home-sticky-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 12, 0.3) 0%, rgba(10, 10, 12, 0.06) 38%, rgba(10, 10, 12, 0.72) 100%),
    linear-gradient(90deg, rgba(10, 10, 12, 0.55) 0%, rgba(10, 10, 12, 0.16) 48%, rgba(10, 10, 12, 0) 72%);
}

.home-sticky-badge {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.05rem);
  left: clamp(0.9rem, 2.2vw, 1.35rem);
  z-index: 5;
  padding: 0.32rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.home-sticky-body {
  position: absolute;
  left: clamp(0.95rem, 2.4vw, 1.6rem);
  right: clamp(0.95rem, 2.4vw, 1.6rem);
  bottom: clamp(2.8rem, 6vw, 3.4rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}

.home-sticky-title {
  display: -webkit-box;
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-sticky-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  line-height: 1.4;
}

.home-sticky-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.home-sticky-meta-item svg {
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.9;
}

.home-sticky-meta-sep {
  opacity: 0.6;
}

.home-sticky-cat {
  padding: 0.16rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.35;
}

.home-sticky-bar {
  position: absolute;
  left: clamp(0.9rem, 2.2vw, 1.35rem);
  right: clamp(0.9rem, 2.2vw, 1.35rem);
  bottom: clamp(0.8rem, 2vw, 1.05rem);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.home-sticky-progress {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow: hidden;
}

.home-sticky-dot {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 0.22rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.home-sticky-dot:hover {
  background: rgba(255, 255, 255, 0.62);
}

.home-sticky-dot.is-active {
  width: 1.9rem;
  background: #fff;
}

.home-sticky-count {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}

.home-sticky-count b {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.home-sticky-arrows {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  padding: 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.home-sticky-arrows button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.home-sticky-arrows button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.home-sticky-arrows button:active {
  transform: scale(0.92);
}

.home-sticky-nav-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.home-sticky-ring {
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  overflow: visible;
  transform: rotate(-90deg);
  pointer-events: none;
}

.home-sticky-ring-track,
.home-sticky-ring-progress {
  fill: none;
  stroke-width: 2;
}

.home-sticky-ring-track {
  stroke: rgba(255, 255, 255, 0.22);
}

.home-sticky-ring-progress {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.home-sticky-dot:focus-visible,
.home-sticky-arrows button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.home-sticky.is-single .home-sticky-bar {
  display: none;
}

@media (max-width: 640px) {
  .home-sticky {
    min-height: 9rem;
    aspect-ratio: 16 / 7.5;
    border-radius: 0.9rem;
  }

  .home-sticky-body {
    bottom: 3rem;
  }

  .home-sticky-title {
    font-size: 1.2rem;
  }

  .home-sticky-meta {
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .home-sticky-bar {
    gap: 0.55rem;
  }

  .home-sticky-dot {
    width: 0.9rem;
  }

  .home-sticky-dot.is-active {
    width: 1.5rem;
  }

  .home-sticky-count {
    font-size: 0.68rem;
  }

  .home-sticky-count b {
    font-size: 0.85rem;
  }

  .home-sticky-arrows {
    padding: 0.18rem;
  }

  .home-sticky-arrows button {
    width: 1.85rem;
    height: 1.85rem;
  }

  .home-sticky-nav-icon {
    width: 0.9rem;
    height: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-sticky-slide,
  .home-sticky-dot,
  .home-sticky-arrows button {
    transition: none;
  }
}

