/* ==========================================================================
   style.css —— 前台样式（在 tokens.css 的变量与公共组件之上扩展）
   约定：颜色一律使用 var(--…)；不写死色值；断点 900px / 560px
   ========================================================================== */

/* ---------------------------------------------------------------- 跳转链接 */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -3rem;
  z-index: 60;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-full);
  background: var(--brand);
  color: var(--on-brand);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--s-2);
  color: var(--on-brand);
  text-decoration: none;
}

/* ---------------------------------------------------------------- 图标 */
.icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
  flex: none;
}
.icon--sm {
  width: 0.9em;
  height: 0.9em;
}

/* ---------------------------------------------------------------- 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--header-h);
}

.site-title {
  flex: 0 0 auto;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover {
  color: var(--brand);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex: 1 1 auto;
  min-width: 0;
}

.site-nav__link {
  padding: 0.35rem 0.72rem;
  border-radius: var(--r-full);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.site-nav__link:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}
.site-nav__link[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- 搜索框 */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
}

.search-box__input {
  width: 10.5rem;
  max-width: 30vw;
  padding: 0.42rem 2.1rem 0.42rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}
.search-box__input::placeholder {
  color: var(--text-faint);
}
.search-box__input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: var(--ring);
}

.search-box__submit {
  position: absolute;
  right: 0.18rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.search-box__submit:hover {
  background: var(--bg-soft);
  color: var(--brand);
}

/* ---------------------------------------------------------------- 页脚 */
.site-footer {
  margin-top: var(--s-8);
  padding-block: var(--s-6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
}
.site-footer__note {
  flex: 1 1 20rem;
  max-width: 46rem;
}
.site-footer__meta {
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.site-footer__icp {
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.site-footer__icp a {
  color: inherit;
  text-decoration: none;
}
.site-footer__icp a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover {
  color: var(--brand);
}

/* ---------------------------------------------------------------- 首页 hero */
.hero {
  margin-block: var(--s-6) var(--s-6);
  padding: var(--s-7) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    radial-gradient(46rem 20rem at 100% -20%, var(--brand-soft), transparent 68%),
    var(--surface);
  overflow: hidden;
}
.hero__eyebrow {
  margin-bottom: var(--s-3);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero__title {
  font-size: clamp(1.9rem, 4.6vw, 2.85rem);
  letter-spacing: -0.03em;
}
.hero__subtitle {
  margin-top: var(--s-3);
  color: var(--text-muted);
  font-size: var(--fs-lg);
  font-family: var(--font-serif);
}
.hero__desc {
  margin-top: var(--s-4);
  max-width: 46rem;
  color: var(--text-muted);
  font-size: var(--fs-md);
}

/* ---------------------------------------------------------------- 首页布局 */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--s-6);
  align-items: start;
  padding-bottom: var(--s-7);
}
.home-main {
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  font-size: var(--fs-lg);
}
.section-title::before {
  content: "";
  width: 0.35rem;
  height: 1.05rem;
  border-radius: var(--r-full);
  background: var(--brand);
}

/* ---------------------------------------------------------------- 文章卡片 */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--s-5);
}
.post-list + .post-list,
.post-list--pinned + .post-list {
  margin-top: var(--s-5);
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.post-card:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.post-card__cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}
.post-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}
.post-card:hover .post-card__cover img {
  transform: scale(1.04);
}

.post-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-4) var(--s-5);
}

.post-card__title {
  font-size: var(--fs-lg);
  line-height: var(--lh-tight);
}
.post-card__title a {
  color: var(--text);
  text-decoration: none;
}
.post-card__title a:hover {
  color: var(--brand);
  text-decoration: none;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-2);
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.post-card__meta .dot::before {
  content: "·";
  margin-right: var(--s-2);
  color: var(--text-faint);
}
.post-card__meta .dot:first-child::before {
  content: none;
  margin: 0;
}

.post-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.72;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  margin-top: auto;
  padding-top: var(--s-2);
}

/* 置顶卡片：桌面横向，移动单列 */
.post-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}
.post-card--featured .post-card__cover {
  height: 100%;
  aspect-ratio: auto;
  min-height: 12rem;
}
.post-card--featured .post-card__title {
  font-size: var(--fs-xl);
}
.post-card--featured .post-card__body {
  padding: var(--s-5);
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.05rem 0.45rem;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 650;
  vertical-align: middle;
}

/* ---------------------------------------------------------------- 结果条 / 筛选 */
.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.result-bar strong {
  color: var(--text);
}
.result-bar__clear {
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* ---------------------------------------------------------------- 侧栏 */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  align-self: start;
  min-width: 0;
}

.widget {
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.widget__title {
  margin-bottom: var(--s-3);
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.widget-profile {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.widget-profile__avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  flex: none;
}
.widget-profile__name {
  font-size: var(--fs-md);
  font-weight: 650;
}
.widget-profile__bio {
  margin-top: var(--s-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.widget-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.widget-list li + li {
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--border);
}
.widget-list a {
  display: block;
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.5;
  text-decoration: none;
}
.widget-list a:hover {
  color: var(--brand);
}
.widget-list .faint {
  font-size: var(--fs-xs);
}

.widget-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* ---------------------------------------------------------------- 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.tag-cloud__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 550;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition),
    background var(--transition);
}
.tag-cloud__item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
}
.tag-cloud__count {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.tag-cloud__item:hover .tag-cloud__count {
  color: var(--brand);
}

.tag-cloud--page {
  gap: var(--s-3);
}
.tag-cloud--page .tag-cloud__item {
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-sm);
}

/* ---------------------------------------------------------------- 分页 */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-6);
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition),
    background var(--transition);
}
a.page-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}
.page-link[aria-current="page"] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}
.page-link--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.page-ellipsis {
  color: var(--text-faint);
  padding-inline: 0.2rem;
}

/* ---------------------------------------------------------------- 文章页布局 */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: var(--s-6);
  align-items: start;
  padding-block: var(--s-5) var(--s-6);
}
.post-layout--single {
  grid-template-columns: minmax(0, 1fr);
}
.post-main {
  min-width: 0;
  max-width: var(--maxw-prose);
}
.post-aside {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  align-self: start;
  min-width: 0;
}
.post-aside:empty {
  display: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.breadcrumbs__sep {
  color: var(--text-faint);
}
.breadcrumbs [aria-current="page"] {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 24rem;
}

.article-header {
  margin-bottom: var(--s-4);
}
.article-title {
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  letter-spacing: -0.025em;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-3);
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.article-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.article-cover {
  margin-block: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.article-cover img {
  width: 100%;
  height: auto;
}

.article-body {
  min-width: 0;
}

.article-footer {
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.article-footer__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.article-copyright {
  width: 100%;
  margin-top: var(--s-3);
  color: var(--text-faint);
  font-size: var(--fs-xs);
  line-height: 1.7;
}

/* ---------------------------------------------------------------- 目录 */
.toc-card {
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.toc-card__title {
  margin-bottom: var(--s-2);
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.toc {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: calc(100vh - var(--header-h) - 9rem);
  overflow-y: auto;
  font-size: var(--fs-sm);
}
.toc__item--l3 {
  padding-left: var(--s-3);
}
.toc__link {
  display: block;
  padding: 0.2rem 0 var(--s-1) var(--s-2);
  border-left: 2px solid transparent;
  color: var(--text-muted);
  line-height: 1.5;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}
.toc__link:hover {
  color: var(--text);
  text-decoration: none;
}
.toc__link.is-active {
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* 移动端折叠目录（桌面隐藏） */
.toc-mobile {
  display: none;
  margin-block: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.toc-mobile > summary {
  padding: var(--s-2) var(--s-4);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.toc-mobile[open] > summary {
  border-bottom: 1px solid var(--border);
}
.toc-mobile .toc {
  max-height: none;
  padding: var(--s-3) var(--s-4);
}

/* ---------------------------------------------------------------- 上一篇 / 下一篇 */
.prev-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.prev-next__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
a.prev-next__item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.prev-next__item--next {
  text-align: right;
  align-items: flex-end;
}
.prev-next__item--empty {
  color: var(--text-faint);
  background: var(--surface-2);
  border-style: dashed;
}
.prev-next__label {
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.prev-next__title {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.45;
}
.prev-next__date {
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

/* ---------------------------------------------------------------- 草稿预览条 */
.draft-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--danger);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 550;
}

/* ---------------------------------------------------------------- 页面头部（归档/标签/关于） */
.page {
  padding-block: var(--s-6) var(--s-6);
}
.page-head {
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
}
.page-head__title {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  letter-spacing: -0.02em;
}
.page-head__desc {
  margin-top: var(--s-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---------------------------------------------------------------- 归档 */
.year-group + .year-group {
  margin-top: var(--s-6);
}
.year-group__title {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-size: var(--fs-xl);
  font-variant-numeric: tabular-nums;
}
.year-group__count {
  color: var(--text-faint);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.month-group {
  margin-top: var(--s-4);
}
.month-group__title {
  margin-bottom: var(--s-2);
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border);
}
.timeline__item {
  position: relative;
  display: flex;
  gap: var(--s-3);
  padding: var(--s-2) 0 var(--s-2) var(--s-4);
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 0.95rem;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--border-strong);
}
.timeline__item:hover::before {
  background: var(--brand);
}
.timeline__date {
  flex: none;
  width: 3.4rem;
  color: var(--text-faint);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
.timeline__body {
  min-width: 0;
  flex: 1 1 auto;
}
.timeline__title {
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}
.timeline__title:hover {
  color: var(--brand);
  text-decoration: underline;
}
.timeline__tags {
  margin-top: var(--s-1);
}

/* ---------------------------------------------------------------- 关于 */
.about-section + .about-section {
  margin-top: var(--s-5);
}
.author-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin: 0;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.author-card__avatar {
  width: 5rem;
  height: 5rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  flex: none;
}
.author-card__body {
  flex: 1 1 16rem;
  min-width: 0;
}
.author-card__name {
  font-size: var(--fs-xl);
}
.author-card__bio {
  margin-top: var(--s-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
.author-card__social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.panel {
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.panel__title {
  margin-bottom: var(--s-3);
  font-size: var(--fs-lg);
}

.tech-list {
  margin: 0;
  padding-left: 1.35em;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.tech-list li + li {
  margin-top: var(--s-2);
}
.tech-list strong {
  color: var(--text);
}

/* ---------------------------------------------------------------- 404 */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - 14rem);
  padding-block: var(--s-8);
  text-align: center;
}
.error-page__code {
  color: var(--brand);
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  opacity: 0.35;
}
.error-page__title {
  margin-top: var(--s-3);
  font-size: var(--fs-2xl);
}
.error-page__desc {
  margin-top: var(--s-3);
  max-width: 30rem;
  color: var(--text-muted);
}
.error-page__actions {
  justify-content: center;
  margin-top: var(--s-5);
}

/* ---------------------------------------------------------------- 加载中 / 骨架屏 */
.skeleton-stack {
  display: grid;
  gap: var(--s-4);
}
.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--bg-soft), var(--surface-2), var(--bg-soft));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton--card {
  height: 15rem;
  border-radius: var(--r-lg);
}
.skeleton--line {
  height: 0.9rem;
}
.skeleton--line-sm {
  height: 0.7rem;
  width: 60%;
}
.skeleton--block {
  height: 6rem;
}

@keyframes skeleton-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

.loading-text {
  color: var(--text-faint);
  font-size: var(--fs-sm);
}

/* ---------------------------------------------------------------- 加载失败 */
.load-error {
  padding: var(--s-5);
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
}
.load-error__title {
  margin-bottom: var(--s-2);
  color: var(--danger);
  font-size: var(--fs-lg);
}
.load-error p + p {
  margin-top: var(--s-2);
}
.load-error code {
  padding: 0.1em 0.4em;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.9em;
  word-break: break-all;
}
.load-error .btn {
  margin-top: var(--s-4);
}

/* ---------------------------------------------------------------- 空状态 */
.empty-state__title {
  margin-bottom: var(--s-2);
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 650;
}
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

/* ---------------------------------------------------------------- 返回顶部 */
.to-top {
  position: fixed;
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: 30;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity var(--transition), visibility var(--transition),
    transform var(--transition), color var(--transition), border-color var(--transition);
}
.to-top:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar > .widget {
    flex: 1 1 16rem;
  }
  .post-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-main {
    max-width: none;
  }
  .post-aside {
    display: none;
  }
  .toc-mobile {
    display: block;
  }
  .hero {
    padding: var(--s-6) var(--s-5);
  }
}

@media (max-width: 760px) {
  .post-card--featured {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-card--featured .post-card__cover {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    flex-wrap: wrap;
    row-gap: var(--s-2);
    padding-block: var(--s-2);
  }
  .site-title {
    flex: 1 1 auto;
    font-size: var(--fs-md);
  }
  .site-header__actions {
    order: 2;
  }
  .search-box {
    order: 3;
    flex: 1 1 100%;
  }
  .search-box__input {
    width: 100%;
    max-width: none;
  }
  .site-nav {
    order: 4;
    flex: 1 1 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  .site-nav__link {
    padding-inline: 0.55rem;
  }

  .hero {
    margin-block: var(--s-4) var(--s-5);
    padding: var(--s-5) var(--s-4);
  }
  .post-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    flex-direction: column;
  }
  .prev-next {
    grid-template-columns: minmax(0, 1fr);
  }
  .prev-next__item--next {
    text-align: left;
    align-items: flex-start;
  }
  .timeline__item {
    padding-left: var(--s-3);
  }
  .timeline__date {
    width: 2.9rem;
  }
  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer__inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .post-card:hover {
    transform: none;
  }
  .post-card:hover .post-card__cover img {
    transform: none;
  }
}
