/* ==========================================================================
   布局层：现代工作室
   ========================================================================== */

.shell {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.shell-wide {
  width: min(100% - var(--gutter) * 2, var(--container-wide));
  margin-inline: auto;
}

.shell-narrow {
  width: min(100% - var(--gutter) * 2, 780px);
  margin-inline: auto;
}

/* ------------------------------- 顶栏 ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  /* 始终存在的毛玻璃框体：底色随背景变化，但不会消失 */
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 7%, transparent);
  transition: background-color var(--dur), box-shadow var(--dur);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
  }
}

.site-header[data-scrolled="true"] {
  /* 滚动后只是略微加实、加一点投影，框体本身一直都在 */
  background: color-mix(in srgb, var(--bg) 66%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
    0 10px 30px -22px color-mix(in srgb, var(--ink) 35%, transparent);
}

.brand-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.site-header__inner {
  width: min(100% - var(--gutter) * 2, var(--container-wide));
  margin-inline: auto;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
}

.brand__signature {
  height: 44px;
  width: auto;
  display: block;
}

html[data-theme="dark"] .brand__signature,
html[data-theme="dark"] .footer-signature {
  filter: invert(1);
}

.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.6);
}

.brand__name {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand__latin {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2vw, 1.9rem);
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-right: auto;
}

.nav-links a {
  color: var(--ink-2);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

.lock-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.side-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 38px;
  padding: 0 0.5rem 0 0.7rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-3);
  transition: border-color var(--dur-fast);
}

.side-search:hover {
  border-color: var(--line);
}

.side-search.is-open {
  border-color: var(--brand-line);
}

.side-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.88rem;
  color: var(--ink);
}

.side-search__input::placeholder {
  color: var(--ink-3);
}

.side-search__kbd {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  line-height: 1.5;
  padding: 0.05em 0.3em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink-3);
  flex: none;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.theme-switch:hover {
  background: var(--hover);
  color: var(--ink);
}

.theme-switch__glyph {
  transition: transform 420ms var(--ease);
}

/* 深色时把字形镜像：填充换到右半边，斜线换到左半边 */
html[data-theme="dark"] .theme-switch__glyph {
  transform: scaleX(-1);
}







.nav-text {
  font-size: 0.82rem;
  color: var(--ink-2);
  padding: 0.3rem 0.45rem;
  border-radius: 7px;
}

.nav-text:hover {
  background: var(--bg);
  color: var(--ink);
}

.nav-act__label {
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.nav-toggle {
  display: none;
}

/* ------------------------------- 按钮 ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  height: 42px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.7);
  transition: background-color var(--dur-fast), transform var(--dur-fast),
    box-shadow var(--dur-fast);
}

.btn:hover {
  background: var(--brand-ink);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--brand-line);
  color: var(--brand);
  transform: translateY(-1px);
}

/* 顶部动作按钮：和管理后台的「新建内容」同一套形状 */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}

.nav-btn:hover {
  transform: translateY(-1px);
}

.nav-btn--primary {
  background: var(--brand);
  color: #fff;
}

.nav-btn--primary:hover {
  background: var(--brand-ink);
}

/* 后台入口：淡蓝描边，与实心「新建内容」区分 */
.nav-btn--admin-enter {
  background: #0f766e;
  color: #fff;
}

.nav-btn--admin-enter:hover {
  background: #115e59;
}

/* 后台里的返回：暖色，和进入、新建、订阅三种都不同 */
.nav-btn--admin-back {
  background: #b45309;
  color: #fff;
}

.nav-btn--admin-back:hover {
  background: #92400e;
}

.nav-btn--accent {
  background: color-mix(in srgb, var(--ink) 88%, var(--brand));
  color: var(--bg);
}

.nav-btn--accent:hover {
  background: var(--ink);
}

/* 形状、字号、颜色全部交给 .nav-btn，这里只留间距 */
/* 所有长条按钮共用同一套尺寸与间距，颜色只负责语义 */
.nav-cta {
  margin-left: 0;
}

.btn--small {
  height: 34px;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

/* ------------------------------- 首页 ---------------------------------- */
.promo {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
}

.promo__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.promo__copy {
  display: grid;
  gap: 1.15rem;
  max-width: 34rem;
}

.promo__title {
  font-size: clamp(2.4rem, 1.5rem + 3.4vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.promo__sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 30rem;
}

.promo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.promo__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.promo-media {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.promo-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.promo-media__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

/* 统计条 */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-block: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.metric__num {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric__label {
  font-size: 0.74rem;
  color: var(--ink-3);
}

/* 区块 */
.block {
  padding-block: clamp(3rem, 6vw, 5rem) 0;
}

.block__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}

.block__title {
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.9rem);
  letter-spacing: -0.03em;
}

.block__desc {
  margin-top: 0.35rem;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.block__link {
  font-size: 0.85rem;
  color: var(--brand);
  font-weight: 500;
  white-space: nowrap;
}

/* 卡片网格 */
.tile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.4rem);
}

.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur), transform var(--dur);
}

.tile:hover {
  border-color: var(--brand-line);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tile__media {
  position: relative;
  flex: none;
  aspect-ratio: 4 / 3;
  background: var(--bg-deep);
  overflow: hidden;
}

.tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease);
}

.tile:hover .tile__media img {
  transform: scale(1.03);
}

.tile__badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2em 0.55em;
  border-radius: 6px;
  white-space: nowrap;
}

.tile__badge.unlock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  border: 1px solid transparent;
}

.unlock-badge.is-login {
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.22);
}

.unlock-badge.is-sub {
  background: rgba(255, 251, 235, 0.95);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.24);
}

.unlock-badge.is-buy {
  background: rgba(240, 253, 244, 0.95);
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.26);
}

.tile__body {
  padding: 0.9rem 1rem 1.05rem;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.35rem;
  align-content: start;
}

.tile__title-link {
  color: inherit;
  text-decoration: none;
}

.tile__title-link:hover {
  text-decoration: underline;
}

/* 卡片里的文字可以正常选中复制，只有图片和标题是链接 */
.tile__body {
  user-select: text;
}

.tile__title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.tile__excerpt {
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 引用块 */
.quote {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.quote__text {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.quote__by {
  font-size: 0.8rem;
  color: var(--ink-3);
}

/* CTA */
.cta-band {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: clamp(2.4rem, 5vw, 3.6rem);
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 50% 0%, var(--brand-soft) 0%, transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.cta-band__title {
  font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  letter-spacing: -0.03em;
}

.cta-band__text {
  color: var(--ink-2);
  max-width: 30rem;
}

/* ------------------------------ 图书馆 --------------------------------- */
.library {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  padding-block: 2rem 0.75rem;
  align-items: start;
}

.lib-side {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  padding-right: 1.6rem;
  border-right: 1px solid var(--line);
}

.side-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  margin-inline: -0.6rem;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

.side-all:hover {
  background: var(--bg);
}

.side-all.is-active {
  background: var(--bg);
}

.side-group {
  border: 0;
}

.side-group + .side-group {
  margin-top: 1.2rem;
}

.side-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  margin-inline: -0.6rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  transition: color var(--dur-fast), background-color var(--dur-fast);
}

.side-group__title::-webkit-details-marker {
  display: none;
}

.side-group__head {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.side-icon {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.side-group__title:hover {
  color: var(--ink-2);
  background: var(--hover);
}

.side-chev {
  flex: none;
  opacity: 0.6;
  transition: transform var(--dur) var(--ease);
}

.side-group[open] .side-chev {
  transform: rotate(180deg);
}

.side-group__body {
  display: grid;
  gap: 0.18rem;
  padding: 0.2rem 0 0.35rem 1.5rem;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.side-link:hover {
  background: var(--bg);
  color: var(--ink);
}

.side-link.is-active {
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
}

.side-link__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-count {
  font-size: 0.72rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.side-check {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 7px;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.side-check__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.46rem 0.55rem;
}

.side-x {
  flex: none;
  padding: 0.2rem 0.5rem 0.2rem 0.15rem;
  font-size: 0.95em;
  line-height: 1;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity var(--dur-fast), color var(--dur-fast);
}

.side-check:hover .side-x,
.side-check.is-on .side-x {
  opacity: 0.55;
}

.side-x:hover {
  opacity: 1;
  color: var(--brand);
}

.side-check:not(.is-on):hover {
  background: var(--hover);
  color: var(--ink);
}

.side-check.is-on {
  color: var(--ink);
}

/* 选中态：左侧一条品牌色竖线，不铺底色（放在 ::after，避免和长按填充冲突） */
.side-check.is-on::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 62%;
  border-radius: 2px;
  background: color-mix(in srgb, var(--tone, var(--brand)) 34%, var(--bg));
}

/* 「全部」是层级头：线更粗、颜色更深 */
.side-check--all.is-on::after {
  width: 3px;
  height: 70%;
  /* 用墨色淡化后的灰蓝，避免纯黑那种饱和感 */
  background: color-mix(in srgb, var(--ink-2) 42%, var(--bg));
}

/* 选中行：只把数字加重，文字保持原样 */
.side-check.is-on .side-count {
  font-weight: 600;
  color: var(--ink-2);
}

.side-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.side-reset:hover {
  background: var(--hover);
  color: var(--brand);
}

.side-reset.is-idle {
  opacity: 0.45;
}

.side-check .side-link__label {
  flex: 1;
}

.lib-tag__check {
  display: inline-flex;
  align-items: center;
  margin-right: 0.22em;
}

.side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.4rem 0 0.3rem;
}


/* 标签徽章：淡底 + 同色文字（定稿样式） */
.side-tags .lib-tag {
  display: inline-flex;
  align-items: center;
  align-items: center;
  gap: 0.22em;
  padding: 0.14em 0.55em;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.7;
  white-space: nowrap;
  background: color-mix(in srgb, var(--tone, #64748b) 11%, var(--surface));
  color: color-mix(in srgb, var(--tone, #64748b) 74%, var(--ink));
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.side-tags .lib-tag:hover {
  background: color-mix(in srgb, var(--tone, #64748b) 18%, var(--surface));
}

.side-tags .lib-tag.is-empty {
  opacity: 0.45;
}

.lib-tag__main {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  color: inherit;
}

.lib-tag__x {
  margin-left: 0.15em;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.7;
  color: inherit;
}

.lib-tag__x:hover {
  opacity: 1;
}

.side-tags .lib-tag.is-active {
  background: var(--tone, var(--brand));
  color: #fff;
}

.side-tags .lib-tag__count {
  font-size: 0.92em;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

.side-tags .lib-tag.is-active .lib-tag__count {
  opacity: 0.8;
  color: inherit;
}

/* 内容类型的小圆点 */
.side-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone, #94a3b8);
  flex: none;
}

.lib-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.lib-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.6;
  background: color-mix(in srgb, var(--tone, var(--ink-3)) 10%, var(--surface));
  color: color-mix(in srgb, var(--tone, var(--ink-3)) 70%, var(--ink));
}

.lib-chip.is-fixed {
  background: var(--bg);
  color: var(--ink-3);
}

.lib-chip--reset {
  margin-left: 0.25rem;
  background: transparent;
  color: var(--ink-3);
  border: 1px dashed var(--line-2);
}

.lib-chip--reset:hover {
  color: var(--brand);
  border-color: var(--brand-line);
}

.lib-chip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.lib-chip::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--hold, 0%);
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: color-mix(in srgb, var(--tone, var(--brand)) 42%, transparent);
}

.lib-chip__main,
.lib-chip__main:hover {
  opacity: 0.78;
}

.lib-chip__x {
  position: relative;
  z-index: 1;
}

.lib-chip.is-action {
  cursor: pointer;
}

.lib-chip__main {
  color: inherit;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.lib-chip__x {
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.5;
  color: inherit;
}

.lib-chip__x:hover {
  opacity: 1;
  color: var(--brand);
}

.lib-main {
  min-width: 0;
}

.lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.lib-toolbar__title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lib-toolbar__meta {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 28px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--ink-2);
}

.chip:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.4rem);
}

/* ------------------------------ 内容页 --------------------------------- */
.entry {
  padding-block: clamp(2rem, 5vw, 3.6rem) 4rem;
}

.entry__head {
  display: grid;
  gap: 0.9rem;
}

/* 标题保持易读行宽，元信息铺满整行 */
.entry__title,
.entry__sub {
  max-width: 46rem;
}

.entry__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.entry__title {
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.entry__sub {
  font-size: 1.05rem;
  color: var(--ink-2);
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--ink-3);
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.entry__author {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-2);
  font-weight: 500;
}

.entry__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #93c5fd);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 600;
}

.entry__cover {
  margin-block: 1.6rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}

.entry__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.entry__body {
  max-width: 46rem;
}

.entry__tags .lib-tag {
  border: 0;
  border-radius: 999px;
  padding: 0.14em 0.55em;
  font-size: 0.72rem;
  line-height: 1.65;
  text-decoration: none;
  background: color-mix(in srgb, var(--tone, #64748b) 11%, var(--surface));
  color: color-mix(in srgb, var(--tone, #64748b) 74%, var(--ink));
}

.entry__tags .lib-tag--type {
  background: color-mix(in srgb, var(--tone, #64748b) 18%, var(--surface));
  color: color-mix(in srgb, var(--tone, #64748b) 82%, var(--ink));
}

.entry__tags .lib-tag:hover {
  background: color-mix(in srgb, var(--tone, #64748b) 20%, var(--surface));
}

.entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

/* 系列照片 */
.masonry {
  columns: 3;
  column-gap: clamp(0.5rem, 1.2vw, 0.85rem);
}

.masonry__item {
  break-inside: avoid;
  margin-bottom: clamp(0.5rem, 1.2vw, 0.85rem);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  border: 1px solid var(--line);
}

.masonry__item img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 800ms var(--ease);
}

/* 只有极端长图（1×2400 这种）才限高，按高度缩放并居中，不裁切 */
.masonry__item.is-ratio-extreme img {
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  margin-inline: auto;
}

.masonry__item:hover img {
  transform: scale(1.015);
}

.masonry__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.8rem 0.8rem 0.6rem;
  font-size: 0.72rem;
  color: #fff;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.6), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast);
  pointer-events: none;
}

.masonry__item:hover .masonry__cap,
.masonry__item:focus-within .masonry__cap {
  opacity: 1;
}

/* ------------------------------ 付费墙 --------------------------------- */
.paywall {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
  margin-block: 2rem 2.6rem;
  padding: clamp(1.8rem, 4vw, 2.8rem);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--brand-soft), var(--surface));
}

.paywall__title {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.paywall__text {
  max-width: 30rem;
  color: var(--ink-2);
  font-size: 0.9rem;
}

/* ------------------------------ 评论 ---------------------------------- */
.comments {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.comments__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comments__title {
  font-size: 1.05rem;
}

.comment {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.comment--reply {
  margin-left: 1.6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  border-bottom: 0;
}

.comment__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

.comment__author {
  color: var(--ink);
  font-weight: 600;
}

.comment__body {
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-form {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.comment-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

/* ------------------------------ 表单 ---------------------------------- */
.form-card {
  width: min(100%, 25rem);
  margin: clamp(2rem, 8vh, 5rem) auto;
  padding: clamp(1.4rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field > label {
  font-size: 0.78rem;
  color: var(--ink-2);
}

.input,
.textarea,
.select {
  width: 100%;
  height: 42px;
  padding: 0 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

/* 后台参数行：滑块 + 数字 / 色块 + 十六进制，并排 */
.pair {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pair .range {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--brand);
}

.pair .num {
  width: 6rem;
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pair .color-well {
  flex: 0 0 auto;
  width: 2.9rem;
  height: 2.6rem;
  padding: 0.15rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.pair .input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stop-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stop-row .stop-remove {
  flex: 0 0 auto;
  padding: 0 0.7rem;
  height: 2.6rem;
}

.stop-row .stop-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 取色器：默认的 100% 宽会拉成一条长条，这里收成方块 */
input[type="color"] {
  width: 4.5rem;
  height: 2.6rem;
  padding: 0.15rem;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--line-2);
  border-radius: calc(var(--radius-sm) - 2px);
}

.textarea {
  height: auto;
  min-height: 6.5rem;
  padding: 0.6rem 0.8rem;
  resize: vertical;
  line-height: 1.6;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-hint {
  font-size: 0.76rem;
  color: var(--ink-3);
}

/* ------------------------------ 提示条 -------------------------------- */
/* 提示条：浮在页面上方，不推开内容；随视口固定，不随滚动移动 */
.flashes {
  position: fixed;
  top: calc(72px + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: calc(var(--z-nav) + 5);
  display: grid;
  gap: 0.4rem;
  width: min(100% - var(--gutter) * 2, var(--container-narrow, 780px));
  pointer-events: none;
  animation: flash-in 220ms ease-out both;
}

.flashes .flash {
  pointer-events: auto;
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--ink) 45%, transparent);
}

.flashes.is-hiding {
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 240ms ease, transform 240ms ease;
}

@keyframes flash-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 720px) {
  .flashes {
    top: calc(60px + 0.6rem);
  }
}

.flash {
  padding: 0.65em 0.9em;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.85rem;
}

.flash--error {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

/* ------------------------------ 页脚 ---------------------------------- */
/* 页脚贴底：内容不足时由 main 撑开，页脚始终落在视口底部 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

main#main {
  flex: 1 0 auto;
}

.site-footer {
  position: relative;
  z-index: 20;
  margin-top: auto;
  padding-block: clamp(1.6rem, 2.8vw, 2.2rem) 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  /* 与顶栏同一套语言：半透明 + 大面积模糊，能透出背后的背景/视频 */
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-footer {
    background: var(--surface-2);
  }
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 1.45fr 0.95fr;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  padding-bottom: 0.4rem;
  align-items: start;
}

.footer-signature {
  height: 38px;
  width: auto;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem 1.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--ink-3);
}

.footer-beian {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink-3) 45%, transparent);
  text-underline-offset: 0.25em;
}

.footer-beian:hover {
  color: var(--brand);
  text-decoration-color: currentColor;
}

.footer-legal a {
  color: inherit;
}

.footer-legal a:hover {
  color: var(--brand);
}

.footer-brand {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.footer-brand p {
  margin: 0;
  max-width: 26em;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.footer-declare {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  font-size: 0.78rem;
  line-height: 1.75;
  color: var(--ink-2);
}

.footer-declare p {
  margin: 0;
}

.footer-contact {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  font-size: 0.83rem;
}

.footer-contact a {
  color: var(--ink-2);
}

.footer-contact a:hover {
  color: var(--brand);
}

.footer-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 0.1rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.footer-title a {
  font-size: 0.74rem;
  letter-spacing: 0;
  color: var(--brand);
  text-transform: none;
}

.footer-title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--ink-3);
}

/* ------------------------------ 分页 ---------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-block: 1.5rem 0;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.pagination a {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
}

.pagination a:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

/* ------------------------------ 灯箱 ---------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.97);
  color: #f8fafc;
  padding: 0.9rem clamp(1rem, 4vw, 2.4rem);
  opacity: 0;
  transition: opacity 200ms var(--ease-soft);
}

.lightbox.is-open {
  display: grid;
  opacity: 1;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  font-size: 0.75rem;
  color: rgba(248, 250, 252, 0.65);
  padding-bottom: 0.5rem;
}

.lightbox__bar [data-counter] {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.lightbox__bar [data-caption] {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox__bar [data-hint] {
  flex: none;
  font-size: 0.7rem;
  color: rgba(248, 250, 252, 0.45);
}

/* 舞台：flex 居中，图片靠 max-width/height 适配，不用绝对定位 */
.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.lightbox__stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  /* 关键：flex 子项默认 flex-shrink:1，会把放大后的宽图压缩回容器宽度，
     导致"放大没放大、只能上下拖"。这里禁止收缩。 */
  flex: 0 0 auto;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

/* 放大：图片按原始像素尺寸显示，flex 仍然负责居中，位移交给 transform */
.lightbox__stage.is-zoomed img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox__stage.is-dragging {
  cursor: grabbing;
}

.lightbox__nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.6rem;
}

.lightbox button {
  color: rgba(248, 250, 252, 0.85);
  font-size: 0.76rem;
  padding: 0.35em 0.8em;
  border: 1px solid rgba(248, 250, 252, 0.22);
  border-radius: 999px;
}

.lightbox button:hover {
  border-color: rgba(248, 250, 252, 0.6);
  color: #fff;
}

/* ------------------------------ 杂项 ---------------------------------- */
.stack {
  display: grid;
  gap: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.empty {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  color: var(--ink-3);
  font-size: 0.88rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
}

.locked-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--brand);
}

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-block: 1rem 2rem;
}

.search-form .input {
  flex: 1;
}

/* 运动/视频 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.video-card {
  display: grid;
  gap: 0.6rem;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.video-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.9);
}

.video-frame__play {
  position: relative;
  z-index: 1;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(2, 6, 23, 0.3);
  backdrop-filter: blur(4px);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 归档 */
.archive-year {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.2rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}

.archive-year h2 {
  font-size: 0.9rem;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0;
}

.archive-list {
  display: grid;
  gap: 0.1rem;
}

.archive-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.4rem;
  font-size: 0.9rem;
}

.archive-list a:hover {
  color: var(--brand);
}

/* 会员价格 */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.price-card {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.price-card__name {
  font-size: 0.92rem;
  font-weight: 600;
}

.price-card__price {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.price-card__desc {
  font-size: 0.84rem;
  color: var(--ink-2);
}

@media (max-width: 1080px) {
  .promo__inner {
    grid-template-columns: 1fr;
  }

  .promo-media {
    order: -1;
  }

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

  .lib-side {
    position: static;
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
  }

  .masonry {
    columns: 2;
  }
}

@media (max-width: 780px) {
  .site-header__inner {
    height: 60px;
    gap: 1rem;
  }

  .nav-links {
    position: fixed;
    inset: 60px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin: 0;
    padding: 0.4rem var(--gutter) 0.8rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-fast), transform var(--dur) var(--ease);
  }

  .nav-links.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav-links a {
    width: 100%;
    padding-block: 0.7rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
  }

  .nav-links a[aria-current="page"] {
    border-bottom-color: var(--line);
    color: var(--brand);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .masonry {
    columns: 1;
  }

    .archive-year {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}


/* ------------------------------ 图集 ---------------------------------- */
.gallery {
  margin: 2em 0;
}

.gallery__item {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-deep);
}

.gallery__item img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.gallery__item.is-ratio-extreme img {
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  margin-inline: auto;
}

/* 等宽网格：列宽一致、高度按原比例，不裁切 */
.gallery--grid .gallery__item img {
  aspect-ratio: auto;
  height: auto;
  object-fit: fill;
}

.gallery__cap {
  font-size: 0.75rem;
  color: var(--ink-3);
  padding: 0.45rem 0.15rem 0.1rem;
}

.gallery--masonry {
  columns: 2;
  column-gap: 0.6rem;
}

.gallery--masonry .gallery__item {
  break-inside: avoid;
  margin-bottom: 0.6rem;
}

.gallery--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.gallery--grid .gallery__item {
  align-self: start;
}

.gallery--carousel {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.gallery--carousel .gallery__item {
  flex: 0 0 min(78%, 460px);
  scroll-snap-align: center;
}

.gallery--full {
  display: grid;
  gap: 1rem;
}

.gallery--full .gallery__item img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.gallery--diptych {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.gallery-empty {
  color: var(--ink-3);
  font-size: 0.82rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

@media (max-width: 780px) {
  .gallery--masonry {
    columns: 1;
  }

  .gallery--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery--diptych {
    grid-template-columns: 1fr;
  }

  .gallery--carousel .gallery__item {
    flex-basis: 86%;
  }
}


/* 极端比例（宽高比超出 2.2:1）：卡片里完整显示，不裁主体 */
.tile__media.is-ratio-extreme img,
.gallery__item.is-ratio-extreme img {
  object-fit: contain;
  background: var(--bg-deep);
}

.tile__media.is-ratio-extreme,
.gallery__item.is-ratio-extreme {
  background: var(--bg-deep);
}


/* ------------------------------ 标签配色 ------------------------------ */
[data-tone="0"] { --tone: #2563eb; }
[data-tone="1"] { --tone: #0ea5e9; }
[data-tone="2"] { --tone: #0891b2; }
[data-tone="3"] { --tone: #14b8a6; }
[data-tone="4"] { --tone: #22c55e; }
[data-tone="5"] { --tone: #65a30d; }
[data-tone="6"] { --tone: #ca8a04; }
[data-tone="7"] { --tone: #d97706; }
[data-tone="8"] { --tone: #ea580c; }
[data-tone="9"] { --tone: #dc2626; }
[data-tone="10"] { --tone: #db2777; }
[data-tone="11"] { --tone: #c026d3; }
[data-tone="12"] { --tone: #7c3aed; }
[data-tone="13"] { --tone: #4f46e5; }
[data-tone="14"] { --tone: #475569; }
[data-tone="15"] { --tone: #57534e; }

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone, #94a3b8);
  display: inline-block;
  margin-right: 0.45em;
  flex: none;
}

.lib-link__label {
  display: inline-flex;
  align-items: center;
}

.lib-tags .tag {
  font-size: 0.78rem;
  padding: 0.26em 0.6em;
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}

.lib-tags .tag:hover {
  background: var(--bg);
  color: var(--ink);
  border-color: transparent;
}

.lib-tags .tag.is-active {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand-ink);
  font-weight: 500;
}

.tag__count {
  color: var(--ink-3);
  margin-left: 0.2em;
}

.tag--tone.is-active .tag__count {
  color: inherit;
  opacity: 0.75;
}


/* 无权限内容：48px 模糊图放大，能看出轮廓但看不清细节 */
.tile__media.is-blurred img,
.masonry__item.is-blurred img {
  filter: blur(0.4px) saturate(0.92);
  transform: scale(1.02);
}

.tile__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.18));
  pointer-events: none;
}


/* ------------------------------ 命令面板 ------------------------------ */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.cmdk[hidden] {
  display: none;
}

/* 位置由 JS 按触发按钮计算：贴在搜索框正下方 */
.cmdk__box {
  position: fixed;
  max-height: 62vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.cmdk__search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}

.cmdk__search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.9rem;
  color: var(--ink);
}

.cmdk__search input::placeholder {
  color: var(--ink-3);
}

.cmdk__list {
  overflow: auto;
  padding: 0.3rem 0.35rem 0.5rem;
}

.cmdk__group + .cmdk__group {
  border-top: 1px solid var(--line);
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.cmdk__heading {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 0.45rem 0.55rem 0.25rem;
}

.cmdk__switch {
  margin-left: auto;
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: var(--line-2);
  position: relative;
  flex: none;
  transition: background-color var(--dur-fast);
}

.cmdk__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur-fast);
}

.cmdk__switch[aria-checked="true"] {
  background: var(--brand);
}

.cmdk__switch[aria-checked="true"]::after {
  transform: translateX(11px);
}

.cmdk__group.is-off .cmdk__item {
  display: none;
}

.cmdk__clear {
  margin-left: auto;
  font-size: 0.66rem;
  color: var(--ink-3);
  padding: 0 0.2rem;
}

.cmdk__clear:hover {
  color: var(--brand);
}

.cmdk__heading {
  display: flex;
  align-items: center;
}

.cmdk__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 7px;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.cmdk__item:hover,
.cmdk__item.is-active {
  background: var(--bg);
  color: var(--ink);
}

.cmdk__item--search {
  color: var(--brand);
  margin-top: 0.3rem;
}

.cmdk__icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ink-3);
}

.cmdk__item.is-active .cmdk__icon,
.cmdk__item:hover .cmdk__icon {
  color: var(--ink-2);
}

.cmdk__time {
  font-size: 0.72rem;
  color: var(--ink-3);
  flex: none;
  font-variant-numeric: tabular-nums;
}

.cmdk__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk__hint {
  font-size: 0.7rem;
  color: var(--ink-3);
  flex: none;
}

.cmdk__kbd {
  font-family: var(--font-sans);
  font-size: 0.64rem;
  line-height: 1.6;
  color: var(--ink-3);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.02em 0.32em;
}

.cmdk__foot {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  color: var(--ink-3);
}

.cmdk__foot > span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.cmdk__empty {
  padding: 1.2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-3);
}


/* ---------------------------------------------------------------------------
   栅格断点：卡片先放大，到阈值再加一列
   - 图书馆有 300px 侧栏，阈值相应更晚
   --------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .entry-grid,
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .entry-grid,
  .tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 图书馆：约 1300 起四列（此时卡片 ~330） */
@media (min-width: 1560px) {
  .entry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 首页没有侧栏，四列来得更早 */
@media (min-width: 1560px) {
  .tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* ------------------------------ 评论回复 ------------------------------ */
.comment__reply {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--ink-3);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
}

.comment__reply:hover {
  color: var(--brand);
  background: var(--hover);
}

.comment-form__reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: var(--hover);
  font-size: 0.8rem;
  color: var(--ink-2);
}

.comment-form__reply b {
  font-weight: 600;
  color: var(--ink);
}

.comment-form__cancel {
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-3);
  padding: 0 0.2rem;
}

.comment-form__cancel:hover {
  color: var(--brand);
}

.comment--reply {
  margin-left: 1.6rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line-2);
}


/* ------------------------------ 权限标记 ------------------------------ */
/* 和标签同一套：淡底 + 同色文字；未解锁统一灰色 */
.tile__access {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 0.64em;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-3);
  backdrop-filter: blur(4px);
}

/* 三色按色相拉开：蓝 217° / 橙 25° / 玫红 335° */
/* ------------------------------ 无权限提示页 ------------------------------ */
.denied {
  max-width: 560px;
  margin: 2.2rem auto 0;
  padding: 2.4rem 1.6rem 2rem;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.denied__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--ink-2);
}

.denied__title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.denied__text {
  max-width: 30em;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink-2);
}

.denied__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.denied__foot {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-3);
}

.denied__foot a {
  color: var(--brand);
}


/* 长按提示：默认隐藏，鼠标进入侧栏才淡入；触屏设备常显 */
.side-hint {
  margin-top: 0.5rem;
  padding: 0 0.55rem;
  font-size: 0.68rem;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 240ms var(--ease);
  pointer-events: none;
}

.lib-side:hover .side-hint,
.lib-side:focus-within .side-hint {
  opacity: 1;
}

@media (hover: none) {
  .side-hint {
    opacity: 1;
  }
}


/* 长按只看这一项：填充覆盖整行 / 整枚标签，形状随本体 */
.side-check,
.lib-tag {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.side-check__main,
.lib-tag__main {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* 「全部」没有色调，用它自己的选中色（石板灰）作为进度色 */
.side-check--all {
  --tone: var(--ink-2);
}

.side-check::before,
.lib-tag::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--hold, 0%);
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: color-mix(in srgb, var(--tone, var(--brand)) 32%, transparent);
}

.lib-tag::before {
  background: color-mix(in srgb, var(--tone, var(--brand)) 48%, transparent);
}

/* 已选标签是实心底色，进度改用白色高光才看得见 */
.lib-tag.is-active::before {
  background: rgba(255, 255, 255, 0.55);
}

/* 长按期间轻微抖动：跟随 --hold 的节奏，填满即停 */
.side-check.is-holding,
.lib-tag.is-holding,
.lib-chip.is-holding {
  animation: hold-shake 130ms linear infinite;
  will-change: transform;
}

@keyframes hold-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1.5px); }
  80% { transform: translateX(1.5px); }
  100% { transform: translateX(0); }
}

/* 长按期间隐藏选中竖线，和其他条目保持一致 */
.side-check.is-holding::after {
  opacity: 0;
}

/* 内容压到填充之上 */
.side-check__main,
.side-x,
.lib-tag__main,
.lib-tag__x {
  position: relative;
  z-index: 1;
}



/* ------------------------------ 关于 ------------------------------ */
.about-page {
  padding-block: clamp(2.6rem, 5vw, 4.2rem) clamp(3rem, 5vw, 4.5rem);
}

.about-page {
  position: relative;
}

.about-body {
  width: min(100% - var(--gutter) * 2, 46rem);
  margin-inline: auto;
}

/* 悬浮在正文右侧，不挤占内容宽度 */
.about-aside {
  position: fixed;
  top: 104px;
  left: calc(50% + 24.5rem);
  width: 10rem;
  z-index: 5;
}

.about-hero {
  padding-bottom: clamp(1.6rem, 3vw, 2.2rem);
  border-bottom: 1px solid var(--line);
}

.about-hero__row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.45rem;
}

.about-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.about-hero__lead {
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
  line-height: 1.7;
  color: var(--ink-2);
}

.about-hero__lead em {
  font-style: normal;
  color: var(--ink);
  box-shadow: inset 0 -0.42em 0 color-mix(in srgb, var(--brand) 16%, transparent);
}

.about-block {
  padding-top: clamp(2.4rem, 4.5vw, 3.6rem);
  scroll-margin-top: 90px;
}

.about-block__head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.about-block__no {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.about-block__title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.about-prose {
  margin-top: 1.5rem;
}

.about-prose p {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 2;
  color: var(--ink-2);
}

.about-prose p:last-child {
  margin-bottom: 0;
}

.about-prose__p {
  margin: 0 0 0.95rem;
  font-size: 1rem;
  line-height: 2;
  color: var(--ink-2);
}

.about-key {
  color: var(--ink);
  font-weight: 650;
  box-shadow: inset 0 -0.38em 0 color-mix(in srgb, var(--brand) 15%, transparent);
}

.about-callout {
  margin: 1.25rem 0 0;
  padding: 0.75rem 0.95rem;
  border-left: 2px solid #a45c5c;
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, #a45c5c 6%, transparent);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink-2);
}

.about-callout strong {
  color: var(--ink);
  font-weight: 650;
}

.about-rule-list {
  margin-top: 2.2rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--line);
}

.about-rule-list__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.about-rule-list__tag {
  display: inline-block;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.about-rule-list--allow {
  border-left-color: var(--brand);
}

.about-rule-list--allow .about-rule-list__tag {
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand);
}

.about-rule-list--deny {
  border-left-color: #a45c5c;
}

.about-rule-list--deny .about-rule-list__tag {
  background: color-mix(in srgb, #a45c5c 14%, #fff);
  color: #8d4545;
}

.about-rule-list ul {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.about-rule-list li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink-2);
}

.about-rule-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 6px;
  height: 1px;
  background: var(--ink-3);
}

.about-rule-list li strong {
  color: var(--ink);
  font-weight: 650;
  box-shadow: inset 0 -0.34em 0 color-mix(in srgb, var(--brand) 14%, transparent);
}

.about-sub {
  margin-top: 2.4rem;
}

.about-sub__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.about-sub p:first-of-type {
  margin-top: 0.65rem;
}

.about-sign {
  margin: 0.3rem 0 0.95rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.88rem;
  color: var(--ink-2);
  word-break: break-all;
}

.about-contact {
  display: grid;
  gap: 0;
  margin: 1.4rem 0 0;
}

.about-contact__row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.about-contact__row:last-child {
  border-bottom: 0;
}

.about-contact dt {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.about-contact dd {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-2);
}

.about-contact dd a {
  color: var(--brand);
}

.about-contact dd a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.about-extra {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

/* 文章底部授权 */
.entry-license {
  display: grid;
  gap: 0.35rem;
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.8;
  color: var(--ink-3);
}

.entry-license__line {
  margin: 0;
  overflow-wrap: anywhere;
}

.entry-license a {
  color: var(--ink-2);
}

.entry-license a:hover {
  color: var(--brand);
}


/* ------------------------------ 顶栏账号菜单 ------------------------------ */
.nav-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.nav-admin:hover {
  background: var(--hover);
  color: var(--ink);
}

.nav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.nav-bell:hover {
  background: var(--hover);
  border-color: var(--brand-line);
  color: var(--ink);
}

.nav-bell:hover {
  background: var(--hover);
  color: var(--ink);
}

.nav-bell__badge {
  position: absolute;
  top: -3px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6rem;
  line-height: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.nav-user {
  position: relative;
}

.nav-user__trigger {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  padding: 0.15rem;
  border-radius: 50%;
}

.nav-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.nav-user__avatar:hover,
.nav-user__trigger:hover .nav-user__avatar {
  border-color: var(--brand-line);
  background: var(--sel-strong);
}

.nav-user__avatar {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hover);
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}

.nav-user__name {
  transition: transform 240ms var(--ease), opacity 180ms var(--ease);
}

.nav-user__chev {
  opacity: 0.55;
  transition: transform 240ms var(--ease);
}

.nav-user.is-open .nav-user__chev {
  transform: rotate(180deg);
}

/* 展开时，触发区的身份信息让位给面板顶部，只留箭头 */
.nav-user.is-open .nav-user__avatar {
  background: var(--sel-strong);
  color: var(--ink);
}

.nav-user__menu {
  position: absolute;
  max-width: calc(100vw - 1.2rem);
  top: calc(100% + 0.5rem);
  right: -0.6rem;
  z-index: calc(var(--z-nav) + 10);
  width: 300px;
  display: grid;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 3%, transparent),
              0 16px 44px color-mix(in srgb, var(--ink) 16%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 200ms var(--ease), transform 260ms var(--ease),
              visibility 200ms var(--ease);
  z-index: 60;
}

.menu-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.65rem 0.75rem;
  transform-origin: top left;
}

.nav-user.is-open .nav-user__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-user.is-open .menu-profile {
  animation: menu-profile-in 280ms var(--ease) both;
}

.menu-profile__avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hover);
  color: var(--ink-2);
  font-size: 1.05rem;
  font-weight: 600;
}

.menu-profile__text {
  min-width: 0;
}

.menu-profile__name {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.menu-profile__meta {
  margin-top: 0.15rem;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-sep {
  height: 1px;
  margin: 0.4rem 0;
  background: var(--line);
}

.menu-group {
  display: grid;
  gap: 1px;
  padding: 0.15rem 0;
}

.menu-label {
  padding: 0.35rem 0.65rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.58rem 0.65rem;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.menu-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.45;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--bg);
  outline: none;
}

.menu-item:hover svg {
  opacity: 0.75;
}

.menu-item--danger {
  color: #b91c1c;
}

.menu-item--danger:hover {
  background: color-mix(in srgb, #b91c1c 7%, transparent);
}

.menu-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.menu-group form {
  margin: 0;
}

/* ------------------------------ 个人中心 ------------------------------ */
.account-page {
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 5vw, 4rem);
}

.acct-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.acct-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--ink-2);
  font-size: 1.3rem;
  font-weight: 600;
  flex: none;
}

.acct-hero__main {
  flex: 1;
  min-width: 0;
}

.acct-hero__name {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.acct-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-3);
}

.acct-tier {
  flex: none;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--ink-3);
}

.acct-tier--2 {
  background: color-mix(in srgb, #f97316 13%, #fff);
  color: #c2410c;
}

.acct-tier--1 {
  background: color-mix(in srgb, #2563eb 12%, #fff);
  color: #1d4ed8;
}

.acct-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1.6rem;
}

.acct-card {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.acct-card__title {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.acct-card__value {
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--ink);
}

.acct-card__hint {
  font-size: 0.76rem;
  color: var(--ink-3);
}

.acct-card__link {
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: var(--brand);
}

.acct-section {
  padding-block: 1.6rem;
  border-top: 1px solid var(--line);
}

.acct-section__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.acct-section__title {
  font-size: 1rem;
  font-weight: 650;
}

.acct-section__count {
  font-size: 0.76rem;
  color: var(--ink-3);
}

.acct-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acct-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem;
  border-radius: 9px;
}

.acct-item:hover {
  background: var(--hover);
}

.acct-item__thumb {
  width: 56px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  flex: none;
}

.acct-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acct-item__body {
  min-width: 0;
}

.acct-item__title {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-item__meta {
  margin-top: 0.15rem;
  font-size: 0.74rem;
  color: var(--ink-3);
}

.acct-empty {
  padding: 1.2rem 0.2rem;
  font-size: 0.84rem;
  color: var(--ink-3);
}

.acct-form {
  display: grid;
  gap: 1rem;
  max-width: 26rem;
}

.pwd-wrap {
  position: relative;
}

.pwd-wrap .input {
  padding-right: 3.6rem;
}

.pwd-wrap .pwd-toggle {
  right: 0.3rem;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--ink-2);
}

.pwd-wrap .pwd-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.pwd-toggle__eye,
.pwd-toggle__eye-off {
  display: block;
}

.pwd-toggle__eye-off {
  display: none;
}

.pwd-toggle[aria-pressed="true"] .pwd-toggle__eye {
  display: none;
}

.pwd-toggle[aria-pressed="true"] .pwd-toggle__eye-off {
  display: block;
}

.pwd-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  padding: 0.15rem 0.4rem;
  border: 0;
  border-radius: 5px;
  background: none;
  font-size: 0.72rem;
  color: var(--ink-3);
  cursor: pointer;
}

.pwd-toggle:hover {
  color: var(--brand);
}

.pwd-meter {
  margin-top: 0.5rem;
  height: 4px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.pwd-meter__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #dc2626;
  transition: width 160ms var(--ease), background-color 160ms var(--ease);
}

.pwd-meter__bar[data-level="2"] {
  background: #d97706;
}

.pwd-meter__bar[data-level="3"] {
  background: #16a34a;
}

.pwd-meter__bar[data-level="4"] {
  background: #15803d;
}

.pwd-rules {
  display: grid;
  gap: 0.2rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.74rem;
  color: var(--ink-3);
}

.pwd-rules li {
  position: relative;
  padding-left: 1rem;
}

.pwd-rules li::before {
  content: "○";
  position: absolute;
  left: 0;
  font-size: 0.8em;
}

.pwd-rules li.is-ok {
  color: #15803d;
}

.pwd-rules li.is-ok::before {
  content: "✓";
}

.pwd-rules li.is-bad {
  color: #b91c1c;
}

.pwd-rules li.is-bad::before {
  content: "✕";
}

/* 收藏按钮 */
.entry-fav {
  margin: 0;
  margin-left: auto;
}

.entry__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-variant-numeric: tabular-nums;
}

.entry__stat svg {
  width: 13px;
  height: 13px;
  opacity: 0.75;
}

.entry__date {
  white-space: nowrap;
}

.entry-fav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  font-size: 0.72rem;
  color: var(--ink-3);
  cursor: pointer;
}

.entry-fav__btn:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

.entry-fav__btn.is-on {
  border-color: color-mix(in srgb, #d97706 45%, transparent);
  color: #b45309;
  background: color-mix(in srgb, #d97706 8%, #fff);
}

@media (max-width: 720px) {
  .acct-cards {
    grid-template-columns: 1fr;
  }
}


/* ------------------------------ 站内消息 ------------------------------ */
.notify-page {
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 5vw, 4rem);
}

.notify-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.notify-head__title {
  margin-top: 0.3rem;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.notify-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notify-item {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 0.2rem;
  border-bottom: 1px solid var(--line);
}

.notify-item__mark {
  width: 7px;
  height: 7px;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}

.notify-item.is-unread .notify-item__mark {
  background: #dc2626;
}

.notify-item__title {
  font-size: 0.92rem;
  color: var(--ink);
}

.notify-item__title a:hover {
  color: var(--brand);
}

.notify-item__text {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.notify-item__meta {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* 头像上传 */
.acct-form--profile {
  max-width: 30rem;
}

.acct-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.acct-avatar--preview {
  overflow: hidden;
}

.acct-avatar--preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acct-avatar-label {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--ink-2);
  cursor: pointer;
}

.acct-avatar-label:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

.acct-avatar-input {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: var(--ink-3);
}



/* ------------------------------ 章节导航组件 ------------------------------ */
.toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.toc__label {
  padding-left: 0.25rem;
  padding-right: 0.35rem;
  border-right: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc__link {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 7px;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.toc__link:hover {
  background: var(--bg);
  color: var(--ink);
}

.toc__link.is-active {
  background: var(--ink);
  color: var(--surface);
}

/* 可折叠菜单形态 */
.toc-menu {
  display: grid;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 10%, transparent);
}

.toc-menu__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.toc-menu__header:hover {
  background: var(--bg);
}

.toc-menu__title {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.toc-menu__progress {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.toc-menu__chev {
  flex: none;
  color: var(--ink-3);
  transition: transform 160ms var(--ease);
}

.toc-menu.is-open .toc-menu__chev {
  transform: rotate(180deg);
}

.toc-menu__track {
  height: 2px;
  margin: 0.1rem 0.45rem 0.35rem;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.toc-menu__fill {
  display: block;
  width: var(--toc-progress, 0%);
  height: 100%;
  background: var(--ink-2);
  transition: width 120ms linear;
}

.toc-menu__content {
  display: none;
}

/* JS 初始化前不渲染内容，避免展开又关闭的闪烁 */
.toc-menu:not(.is-ready) .toc-menu__content {
  display: none;
}

.toc-menu.is-open .toc-menu__content {
  display: block;
}

.toc-menu__group {
  display: grid;
  gap: 1px;
  padding: 0.1rem;
}

.toc-menu__separator {
  height: 1px;
  margin: 0.3rem -0.3rem;
  background: var(--line);
}

.toc-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.42rem 0.5rem;
  border: 0;
  border-radius: 7px;
  background: none;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.4;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.toc-menu__item:hover,
.toc-menu__item:focus-visible {
  background: var(--bg);
  outline: none;
}

.toc-menu__item.is-active {
  background: var(--bg);
  font-weight: 600;
}

.toc-menu__item--action .toc-menu__icon {
  margin-left: auto;
  opacity: 0.55;
}

.toc-menu__item--action:hover .toc-menu__icon {
  opacity: 1;
}

.toc-menu__item.is-active::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--ink-2);
}

/* 位置：贴住容器边缘，纵向位置固定 */
.toc-aside {
  position: fixed;
  top: 104px;
  width: 11rem;
  z-index: 40; /* 低于页头 */
}

.toc-aside--right,
.entry-aside.toc-aside--right {
  right: max(var(--gutter), calc((100vw - 1900px) / 2));
  left: auto;
}

.toc-aside--left {
  left: max(var(--gutter), calc((100vw - 1900px) / 2));
  right: auto;
}

/* 空间不足时只收起内容，宽度保持不变 */
.toc-aside.is-collapsed .toc-menu__content {
  display: none;
}

/* JS 初始化前不渲染内容，避免展开又关闭的闪烁 */
.toc-menu:not(.is-ready) .toc-menu__content {
  display: none;
}



/* ------------------------------ 彩蛋 ------------------------------ */
.ee-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.ee-hint {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  text-shadow: 0 1px 0 var(--bg), 0 0 10px var(--bg);
}

html[data-theme="dark"] .ee-char {
  color: color-mix(in srgb, var(--ee-c, var(--brand)) 62%, #ffffff);
}

.ee-char {
  display: inline-block;
  transform-origin: 50% 80%;
  color: color-mix(in srgb, var(--ee-c, var(--brand)) 74%, var(--ink));
}

.ee-bit {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 5px;
  height: 8px;
  border-radius: 1px;
}

@keyframes ee-happy {
  0%,
  100% {
    transform: rotate(-9deg) translateY(0);
  }
  50% {
    transform: rotate(9deg) translateY(-2px);
  }
}

@keyframes ee-fade {
  0%,
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ee-layer {
    animation: ee-fade 2000ms ease-out forwards;
  }
}


/* 恢复滚动位置时先隐藏，避免闪一下顶部 */
html.is-restoring body {
  visibility: hidden;
}


/* ------------------------------ 首页 Hero ------------------------------ */
.hw {
  --p: 0;
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(6rem, 14vh, 10rem) var(--gutter) clamp(4rem, 10vh, 7rem);
  overflow: hidden;
}

.hw__inner {
  width: min(100%, 1180px);
  display: grid;
  justify-items: center;
  gap: 0;
  will-change: transform, opacity;
}

.hw__title {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.02em;
  font-size: clamp(2.6rem, 11vw, 8.4rem);
  font-weight: 560;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--ink);
}

.hw__char,
.hw__beta {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.42em) rotate(7deg);
  filter: blur(10px);
}

.hw__beta {
  position: absolute;
  left: 100%;
  bottom: 0.16em;
  margin-left: 0.26em;
  font-size: 0.2em;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: lowercase;
  color: var(--ink-3);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hw__beta {
    position: static;
    display: block;
    margin: 0.35em 0 0;
    font-size: 0.16em;
    letter-spacing: 0.4em;
  }
}

.hw__sub {
  margin-top: clamp(1.1rem, 2.4vh, 1.8rem);
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
  letter-spacing: 0.16em;
  color: var(--ink-3);
  opacity: 0;
  transform: translateY(8px);
}

.hw__line {
  width: clamp(48px, 7vw, 84px);
  height: 1px;
  margin-top: clamp(1.6rem, 3.4vh, 2.4rem);
  background: var(--line-2);
  opacity: 0;
}

.hw__cards {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: clamp(2rem, 5vh, 3.6rem);
  perspective: 1200px;
}

.hw-card {
  position: relative;
  width: clamp(150px, 19vw, 300px);
  margin-inline: -2.4%;
  display: grid;
  gap: 0.55rem;
  text-decoration: none;
  transform: translateY(calc(var(--lift, 0px) + 90px + var(--parallax, 0px))) rotate(var(--rot, 0deg));
  opacity: 0;
  transition: transform 400ms cubic-bezier(0.22, 0.75, 0.2, 1);
}

.hw-card__frame {
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent),
              0 12px 28px color-mix(in srgb, var(--ink) 10%, transparent),
              inset 0 0 0 1px color-mix(in srgb, #fff 45%, transparent);
}

.hw-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms cubic-bezier(0.22, 0.75, 0.2, 1);
}

.hw-card:hover .hw-card__frame img {
  transform: scale(1.045);
}

.hw-card__meta {
  display: grid;
  gap: 0.15rem;
  padding-inline: 0.1rem;
}

.hw-card__title {
  font-size: 0.76rem;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hw-card__date {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.hw__hint {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 3vh, 2rem);
  transform: translateX(-50%);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  color: var(--ink-3);
  opacity: 0;
}

@media (max-width: 860px) {
  .hw__cards {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-inline: 1rem;
    margin-inline: calc(var(--gutter) * -1);
    scrollbar-width: none;
  }

  .hw__cards::-webkit-scrollbar {
    display: none;
  }

  .hw-card {
    width: 62vw;
    margin-inline: 0.5rem;
    transform: translateY(60px) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hw__char,
  .hw__beta,
  .hw__sub,
  .hw__line,
  .hw__hint {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .hw-card {
    opacity: 1;
    transition: none;
  }
}


/* ------------------------------ 背景图案 ------------------------------ */
body {
  background-image: var(--bg-pattern);
  background-repeat: repeat;
  background-size: 860px 640px;
  background-attachment: fixed;
}

@media (hover: none), (max-width: 780px) {
  body {
    background-attachment: scroll;
  }
}

/* ------------------------------ 首页：签名 ------------------------------ */
.hero-scroll {
  position: relative;
  height: 320vh;
}

.lw {
  position: fixed;
  inset: 0;
  height: 100svh;
  min-height: 100svh;
  z-index: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(4rem, 9vh, 6rem) var(--gutter);
}

.lw__stage {
  /* 图片四周留了 10% 透明边，按比例放大以保持签名本身的观感大小 */
  width: min(88vw, 1040px);
  display: grid;
  place-items: center;
}

.lw__canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* 墨色由着色器按背景明暗决定，canvas 不再做 CSS 反相；
   只有 WebGL 不可用时的静态兜底图才反相。 */
html[data-theme="dark"] .lw[data-hero-bg="paper"] .lw__fallback {
  filter: invert(1);
}

.lw__fallback {
  display: block;
  width: 100%;
  height: auto;
}

.lw__fallback.is-writing {
  clip-path: inset(0 100% 0 0);
  animation: lw-write 1600ms cubic-bezier(0.25, 0.75, 0.2, 1) forwards;
}

@keyframes lw-write {
  to {
    clip-path: inset(0 0 0 0);
  }
}

@media (max-width: 640px) {
  .lw__stage {
    width: 86vw;
  }
}



/* ------------------------------ 首屏：视频背景 ------------------------------ */
.lw__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.lw__video {
  /* 视频不铺满整屏：四周渐隐到页面底色，只保留中段 */
  -webkit-mask-image: radial-gradient(120% 110% at 50% 46%, #000 42%, transparent 88%);
  mask-image: radial-gradient(120% 110% at 50% 46%, #000 42%, transparent 88%);
}

.lw__video-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 轻微调色：压一点饱和、提一点亮度，让墨色更稳 */
  filter: saturate(0.82) brightness(1.05) contrast(0.97);
  opacity: 0.94;
}



.lw__stage {
  position: relative;
  z-index: 1;
}


/* 卡片内文字区高度固定：标题 2 行、摘要 2 行、元信息 1 行 */
/* 卡片正文区高度固定：内容顶部对齐，超长用省略号，鼠标悬停看完整 */
.tile__body {
  flex: 1 1 auto;
  min-height: 0;
  height: 9rem;
  padding: 0.95rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.tile__meta {
  margin-top: auto;
  padding-top: 0.1rem;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* ------------------------------ 卡片封面数据条 ------------------------------ */
.tile__stats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.6rem 0.7rem 0.55rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.28) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.tile__stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}

.tile__stats svg {
  width: 13px;
  height: 13px;
  flex: none;
  opacity: 0.92;
}

.tile__stats-end {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}


/* 继续看与页脚之间留出呼吸 */
.entry-related {
  margin-bottom: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
}


/* 继续看：换一组 + 全部内容 */
.block__link--button {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.block__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.related-slot {
  display: flex;
}

.related-slot > .tile {
  width: 100%;
}


/* 未登录：头像框里写「登录」 */
.nav-user__avatar--guest {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.nav-user__avatar--guest:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

/* 登录页底部：注册入口 */
.auth-alt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

/* ------------------------------ 悬浮滚动条 ------------------------------ */
/* 原生滚动条隐藏，改用浮在页面右侧的细滚动条：不占横向空间，长短页面宽度一致 */
/* 只有 JS 主动开启时才隐藏原生滚动条，避免无脚本时彻底没有滚动条 */
html.overlay-scroll-on {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.overlay-scroll-on::-webkit-scrollbar,
html.overlay-scroll-on body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.overlay-scroll {
  position: fixed;
  top: 0;
  right: 2px;
  bottom: 0;
  width: 8px;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.overlay-scroll.is-active,
.overlay-scroll.is-visible {
  opacity: 1;
}

.overlay-scroll__thumb {
  position: absolute;
  right: 0;
  width: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 32%, transparent);
  pointer-events: auto;
  cursor: grab;
  transition: background-color var(--dur-fast), width var(--dur-fast);
}

.overlay-scroll__thumb:hover,
.overlay-scroll__thumb.is-dragging {
  width: 8px;
  background: color-mix(in srgb, var(--ink) 46%, transparent);
}

@media (hover: none) {
  .overlay-scroll {
    display: none;
  }
}

/* ------------------------------ 页眉右侧折叠 ------------------------------ */
.nav-more {
  position: relative;
  display: none;
}

.nav-more__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.nav-more__trigger:hover,
.nav-more.is-open .nav-more__trigger {
  background: var(--hover);
  border-color: var(--brand-line);
  color: var(--ink);
}

.nav-more__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: calc(var(--z-nav) + 10);
  width: 190px;
  display: none;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-more.is-open .nav-more__menu {
  display: grid;
  gap: 0.1rem;
}

@media (max-width: 900px) {
  .nav-actions > .nav-btn {
    display: none;
  }

  .nav-more {
    display: block;
  }
}

/* ------------------------------ 档案馆筛选折叠 ------------------------------ */
.lib-filter-toggle {
  display: none;
}

@media (max-width: 1080px) {
  .lib-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    justify-self: start;
    height: 38px;
    padding: 0 0.9rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
  }

  .lib-filter-toggle:hover {
    border-color: var(--brand-line);
    color: var(--ink);
  }

  .lib-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    color: var(--brand-ink);
    font-size: 0.72rem;
    font-weight: 600;
  }

  /* 默认收起整列（含搜索），点「筛选」再展开 */
  .library .lib-side {
    display: none;
  }

  .library .lib-side.is-open {
    display: grid;
    position: static;
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
  }
}

/* ------------------------------ 个人中心布局 ------------------------------ */
.acct-shell {
  padding-block: clamp(1.6rem, 3vw, 2.6rem) clamp(3rem, 6vw, 5rem);
}

.acct-layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.acct-rail {
  position: sticky;
  top: calc(72px + 1.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.acct-rail__title {
  margin: 0 0 0.5rem;
  padding-left: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}

.acct-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 0.88rem;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.acct-link svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.75;
}

.acct-link:hover {
  background: var(--hover);
  color: var(--ink);
}

.acct-link.is-active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  font-weight: 600;
}

.acct-rail__back {
  margin-top: 0.8rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.acct-rail__back:hover {
  color: var(--brand-ink);
}

.acct-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.acct-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}

.acct-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  line-height: 1.2;
}

.acct-profile {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.acct-profile__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--ink-2);
  font-size: 1.6rem;
  font-weight: 600;
}

.acct-profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acct-profile__form {
  display: grid;
  gap: 0.8rem;
  max-width: 32rem;
}

.acct-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.8rem 1.4rem;
  margin: 0;
}

.acct-facts > div {
  display: grid;
  gap: 0.2rem;
}

.acct-facts dt {
  font-size: 0.75rem;
  color: var(--ink-3);
}

.acct-facts dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
}

.acct-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
  padding: 0.2rem;
  border: 1px solid var(--line-2);
  border-radius: 9px;
}

.acct-tab {
  padding: 0.32rem 0.7rem;
  border-radius: 7px;
  font-size: 0.84rem;
  color: var(--ink-2);
}

.acct-tab.is-active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  font-weight: 600;
}

/* 收藏 */
.fav-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.8rem);
  align-items: start;
}

.fav-collections {
  position: sticky;
  top: calc(72px + 1.2rem);
  display: grid;
  gap: 0.7rem;
}

.fav-collections__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.fav-collections__head h2 {
  margin: 0;
  font-size: 0.9rem;
}

.fav-list {
  display: grid;
  gap: 0.1rem;
}

.fav-list__item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  border-radius: 8px;
}

.fav-list__item a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--ink-2);
  min-width: 0;
}

.fav-list__item a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-list__item a b {
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.fav-list__item:hover a {
  background: var(--hover);
  color: var(--ink);
}

.fav-list__item.is-active a {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  font-weight: 600;
}

.fav-list__del {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.fav-list__del:hover {
  background: color-mix(in srgb, #dc2626 12%, transparent);
  color: #b91c1c;
}

.fav-new {
  display: flex;
  gap: 0.35rem;
}

.fav-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fav-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  padding: 0.25rem 0.25rem 0.25rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-3);
}

.fav-search__input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}

.fav-search__input:focus {
  outline: none;
}

@media (max-width: 900px) {
  .acct-layout,
  .fav-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .acct-rail,
  .fav-collections {
    position: static;
  }

  .acct-rail {
    flex-direction: row;
    flex-wrap: wrap;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
  }

  .acct-rail__title,
  .acct-rail__back {
    display: none;
  }

  .acct-profile {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 个人中心侧栏的分组（与后台同一套外观） */
.rail-group {
  border-radius: 10px;
}

.rail-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.rail-group__summary::-webkit-details-marker {
  display: none;
}

.rail-group__summary:hover {
  background: var(--hover);
  color: var(--ink-2);
}

.rail-group__chevron {
  transition: transform 180ms ease;
  opacity: 0.7;
}

.rail-group:not([open]) .rail-group__chevron {
  transform: rotate(-90deg);
}

.rail-group__links {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.2rem 0 0.1rem;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  font-size: 0.86rem;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.rail-link:hover {
  background: var(--hover);
  color: var(--ink);
}

.rail-link__icon {
  flex: none;
  opacity: 0.75;
}

.rail-link.is-active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  font-weight: 600;
}

/* ------------------------------ 通用列表组件 ------------------------------ */
.lt-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  font-size: 0.83rem;
  color: var(--brand-ink);
}

.lt-bulk b {
  font-variant-numeric: tabular-nums;
}

.lt-bulk__clear {
  border: 0;
  background: none;
  color: var(--brand-ink);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
}

.lt-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.lt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 0.82rem;
}

.lt-table th,
.lt-table td {
  padding: 0.62rem 0.8rem;
  line-height: 1.45;
  font-size: inherit;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
}

.lt-table th + th,
.lt-table td + td {
  border-left: 1px solid var(--line);
}

.lt-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
}

.lt-table tbody tr:hover td {
  background: var(--hover);
}

.lt-table tbody tr:last-child td {
  border-bottom: 0;
}

.lt-check {
  width: 40px;
  text-align: center !important;
  padding-inline: 0 !important;
}

.lt-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

.lt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.lt-foot__left,
.lt-foot__right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.lt-foot__right {
  margin-left: auto;
}

.lt-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: currentColor;
}

.lt-dot--ok { color: #16a34a; }
.lt-dot--warn { color: #d97706; }
.lt-dot--bad { color: #dc2626; }

/* 列表分页 */
.lt-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.lt-pager a,
.lt-pager span {
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.lt-pager a:hover {
  border-color: var(--brand-line);
  color: var(--brand-ink);
}

.lt-pager__gap {
  border-color: transparent !important;
  color: var(--ink-3);
}

.lt-pager__step {
  padding: 0 0.7rem !important;
}

.lt-pager .is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------ 分页（shadcn 风格） ------------------------------ */
.pg {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.pg a,
.pg > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink-2);
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}

.pg a:hover {
  background: var(--hover);
  color: var(--ink);
}

.pg .is-current {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.pg .is-disabled {
  color: var(--ink-3);
  opacity: 0.45;
  cursor: default;
}

.pg__gap {
  border: 0;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}

.pg__arrow svg {
  width: 14px;
  height: 14px;
}

.pg__arrow--text span {
  line-height: 1;
}

@media (max-width: 640px) {
  .pg__arrow--text span {
    display: none;
  }
}

/* 列表块：表格顶满容器，块的大小就是表格的大小 */
.lt-panel {
  padding: 0 !important;
  overflow: visible;
}

/* 表格自身负责裁切圆角，面板不再裁切，避免下拉被截断 */
.lt-panel > .lt-scroll:first-child {
  border-radius: 10px 10px 0 0;
}

.lt-panel .lt-bulk {
  margin: 0.8rem 0.9rem 0;
}

.lt-panel .lt-scroll {
  border: 0;
  border-radius: 0;
}

.lt-panel .lt-foot {
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--line);
}

/* 表格内操作统一为文字：无框体、加粗、上色；列宽随按钮数量收缩并冻结 */
.table td.actions,
.table th.actions {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1%;
  white-space: nowrap;
  background: var(--surface);
  box-shadow:
    -14px 0 20px -16px rgba(15, 23, 42, 0.22),
    inset 1px 0 0 var(--line-2);
}

.table tbody tr:hover td.actions {
  background: var(--hover);
}

.table .actions .btn,
.table .actions .chip,
.table .actions button {
  border: 0;
  background: none;
  padding: 0 0.32rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  box-shadow: none;
}

.table .actions .btn:hover,
.table .actions .chip:hover,
.table .actions button:hover {
  background: none;
  color: var(--brand-ink);
  text-decoration: underline;
}

.table .actions .btn--danger,
.table .actions .menu-item--danger,
.table .actions .chip--danger {
  color: #b91c1c;
}

/* 列表工具栏：状态切换 + 说明 */
.lt-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.lt-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line-2);
  border-radius: 9px;
}

.lt-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.lt-tab.is-active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  font-weight: 600;
}

.lt-tab__count {
  font-size: 0.72rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* 列宽拖拽 */
.lt-table th {
  position: relative;
}

.lt-th {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: space-between;
}

.lt-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
}

.lt-resizer:hover,
.lt-resizer.is-active {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
}

.lt-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.lt-sort:hover {
  color: var(--ink);
}

.lt-sort__arrow {
  font-size: 0.62rem;
  opacity: 0.45;
}

.lt-sort[aria-sort="ascending"] .lt-sort__arrow,
.lt-sort[aria-sort="descending"] .lt-sort__arrow {
  opacity: 1;
  color: var(--brand);
}

/* 有已保存列宽时，表格在宽度恢复前先隐藏，避免闪烁 */
html.lt-widths-pending [data-lt-table] {
  visibility: hidden;
}

/* 操作列：所有列表统一冻结在右侧，宽度独立且随内容 */
.lt-table th.col-ops,
.lt-table td.col-ops {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1px;
  white-space: nowrap;
  overflow: visible !important;
  background: var(--surface);
  box-shadow:
    -14px 0 20px -16px rgba(15, 23, 42, 0.22),
    inset 1px 0 0 var(--line-2);
}

.lt-table thead th.col-ops {
  z-index: 3;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.lt-table tbody tr:hover td.col-ops {
  background: var(--hover);
}

/* 同一字段在各列表里的呈现保持一致 */
.lt-table .lt-title {
  font-weight: 600;
  color: var(--ink);
}

.lt-table .lt-title:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.lt-table .lt-sub {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* 列宽拖拽的填充列：吸收剩余宽度，不参与内容 */
.lt-table th.lt-filler,
.lt-table td.lt-filler {
  padding: 0 !important;
  border-left: 0 !important;
  background: transparent;
}

.lt-table col.lt-filler-col {
  width: auto;
}

/* 批量操作下拉 */
.lt-actions {
  position: relative;
}

.lt-actions > .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lt-actions__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 20;
  min-width: 160px;
  display: none;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lt-actions.is-open .lt-actions__menu {
  display: grid;
  gap: 0.1rem;
}

.lt-actions__menu .btn,
.lt-actions__menu button {
  justify-content: flex-start;
  width: 100%;
  border: 0;
  background: none;
  padding: 0.45rem 0.6rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
}

.lt-actions__menu .btn:hover,
.lt-actions__menu button:hover {
  background: var(--hover);
  color: var(--ink);
}

.lt-actions__menu .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lt-actions__clear {
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  color: var(--ink-3) !important;
}

.lt-selected {
  font-size: 0.8rem;
  color: var(--brand-ink);
}

.lt-selected b {
  font-variant-numeric: tabular-nums;
}

.lt-selected__reset {
  margin-left: 0.35rem;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--brand-ink);
  text-decoration: underline;
  cursor: pointer;
}

/* 选择列：表头与行内复选框严格对齐 */
.lt-table th.lt-check,
.lt-table td.lt-check {
  width: 40px;
  padding-inline: 0 !important;
  text-align: center;
}

.lt-table th.lt-check input,
.lt-table td.lt-check input {
  display: block;
  width: 15px;
  height: 15px;
  margin: 0 auto;
  accent-color: var(--brand);
}

/* ------------------------------ 检索栏 ------------------------------ */
.filterbar {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.filterbar__field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.filterbar__label {
  font-size: 0.72rem;
  color: var(--ink-3);
}

.filterbar__field--text {
  flex: 0 1 16rem;
  min-width: 11rem;
  max-width: 22rem;
}

.filterbar__field--text .input {
  width: 100%;
}

.filterbar__field--text .input,
.filterbar__field--select .select,
.filterbar__field--range .input,
.filterbar__field--date_range .input {
  height: 34px;
}

.filterbar__range {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.filterbar__range .input {
  width: 6.5rem;
}

.filterbar__field--date_range .input {
  width: 9.5rem;
}

.filterbar__dash {
  color: var(--ink-3);
}

.filterbar__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

@media (max-width: 720px) {
  .filterbar__field--text,
  .filterbar__field--select {
    flex: 1 1 100%;
  }

  .filterbar__actions {
    margin-left: 0;
    width: 100%;
  }
}

.pg__size,
.pg__jump {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.pg__size select,
.pg__jump input {
  height: 1.9rem;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.78rem;
}

.pg__jump input {
  width: 3.2rem;
  text-align: center;
}

.filterbar__advanced {
  display: none;
  flex: 1 1 100%;
  align-items: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}

.filterbar__advanced.is-open {
  display: flex;
}

.filterbar__toggle svg {
  transition: transform 180ms ease;
}

.filterbar__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.comments__locked {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 2%, transparent);
}

/* 通用标签胶囊：表格、正文、侧栏共用同一套 */
.lib-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  padding: 0.14em 0.55em;
  border: 0;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.65;
  white-space: nowrap;
  text-decoration: none;
  background: color-mix(in srgb, var(--tone, #64748b) 11%, var(--surface));
  color: color-mix(in srgb, var(--tone, #64748b) 74%, var(--ink));
}

.lib-tag--type {
  background: color-mix(in srgb, var(--tone, #64748b) 11%, var(--surface));
  color: color-mix(in srgb, var(--tone, #64748b) 74%, var(--ink));
  font-weight: 500;
}

/* 付费类型徽标：与档案馆卡片配色一致 */
.access-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.7;
  background: var(--hover);
  color: var(--ink-2);
}

.access-badge--free {
  background: color-mix(in srgb, #14b8a6 18%, var(--surface));
  color: #0f766e;
}

.access-badge--login {
  background: color-mix(in srgb, #2563eb 16%, var(--surface));
  color: #1d4ed8;
}

.access-badge--subscribe {
  background: color-mix(in srgb, #f97316 18%, var(--surface));
  color: #c2410c;
}

.access-badge--single {
  background: color-mix(in srgb, #db2777 16%, var(--surface));
  color: #be185d;
}

.lib-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .lib-foot {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

/* 无封面时的文字封面：正文摘要 + 淡色水印 */
.tile__textcover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.05rem 1.15rem 2.3rem;
  overflow: hidden;
  background:
    linear-gradient(160deg,
      color-mix(in srgb, var(--tone, #64748b) 10%, var(--surface)) 0%,
      color-mix(in srgb, var(--tone, #64748b) 4%, var(--surface)) 58%,
      var(--surface) 100%);
}

.tile__textcover-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.tile__textcover-mark {
  position: absolute;
  right: -0.08em;
  bottom: -0.22em;
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--tone, #64748b) 14%, transparent);
  pointer-events: none;
  user-select: none;
}

/* 行选中：比悬停更深一档，抽屉打开后仍能定位 */
.lt-table tbody tr.is-selected td,
.lt-table tbody tr.is-selected td.col-ops {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}

.lt-table tbody tr.is-selected:hover td,
.lt-table tbody tr.is-selected:hover td.col-ops {
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
}

/* 预览模式：页眉向下渐隐的粉色浮层，不遮挡正文操作 */
.preview-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 120px;
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.15rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #ec4899 30%, transparent) 0%,
    color-mix(in srgb, #ec4899 14%, transparent) 42%,
    transparent 100%
  );
}

.preview-bar span {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.46rem 1.15rem;
  border: 1px solid color-mix(in srgb, #9d174d 20%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, #fff 74%, transparent);
  color: #9d174d;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.01em;
  box-shadow:
    0 1px 2px color-mix(in srgb, #9d174d 10%, transparent),
    0 6px 18px -10px color-mix(in srgb, #9d174d 35%, transparent);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .preview-bar span {
  border-color: color-mix(in srgb, #f9a8d4 28%, transparent);
  background: color-mix(in srgb, #2a1622 72%, transparent);
  color: #fbcfe8;
  box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.6);
}

/* 页眉里的预览标识 */
.preview-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 0.65rem;
  margin-right: 0.15rem;
  border: 1px solid color-mix(in srgb, #ec4899 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, #ec4899 12%, var(--surface));
  color: #9d174d;
  font-size: 0.72rem;
  white-space: nowrap;
}

[data-theme="dark"] .preview-chip {
  background: color-mix(in srgb, #ec4899 18%, var(--surface));
  color: #f9a8d4;
}

/* 检索栏多选下拉 */
.filterbar__multi {
  position: relative;
}

.filterbar__multi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 11rem;
  height: 34px;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.filterbar__multi-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filterbar__multi-btn:hover {
  border-color: var(--line-2);
}

.filterbar__multi-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 200;
  display: none;
  min-width: 100%;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filterbar__multi.is-open .filterbar__multi-menu {
  display: grid;
  gap: 0.1rem;
}

.filterbar__multi-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}

.filterbar__multi-item:hover {
  background: var(--hover);
  color: var(--ink);
}

.filterbar__multi-item input {
  accent-color: var(--brand);
}

.comment {
  scroll-margin-top: 230px;
}

.comment.is-focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 4px;
  border-radius: 8px;
}

.comment-mod-banner {
  margin: 0 0 0.7rem;
  padding: 0.5rem 0.7rem;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  color: var(--brand-ink);
  font-size: 0.8rem;
}

/* 评论审核预览：蓝色浮层，与预览粉色浮层同一套结构 */
.mod-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 120px;
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.15rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #2563eb 30%, transparent) 0%,
    color-mix(in srgb, #2563eb 14%, transparent) 42%,
    transparent 100%
  );
}

.mod-bar span {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 1.05rem;
  border: 1px solid color-mix(in srgb, #1d4ed8 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, #fff 74%, transparent);
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow:
    0 1px 2px color-mix(in srgb, #1d4ed8 10%, transparent),
    0 6px 18px -10px color-mix(in srgb, #1d4ed8 35%, transparent);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .mod-bar span {
  background: color-mix(in srgb, #142033 74%, transparent);
  color: #93c5fd;
}

/* 登录弹窗：居中、半透明，适配任何页面底色 */
.auth-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 404px);
  height: max-content;
  --auth-max-h: 88vh;
  max-height: var(--auth-max-h);
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--surface) 55%, var(--line));
  border-radius: 20px;
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--surface) 92%, transparent) 0%,
      color-mix(in srgb, var(--surface) 82%, transparent) 100%
    );
  color: var(--ink);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 35%, transparent) inset,
    0 24px 70px -24px rgb(15 23 42 / 38%),
    0 8px 24px -12px rgb(15 23 42 / 22%);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.auth-modal::backdrop {
  background:
    radial-gradient(
      120% 90% at 50% 0%,
      color-mix(in srgb, var(--ink) 10%, transparent) 0%,
      color-mix(in srgb, #0b1220 34%, transparent) 100%
    );
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
}

.auth-modal__panel {
  position: relative;
  max-height: var(--auth-max-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 2rem 1.7rem 1.5rem;
  border-radius: inherit;
}

@supports (-moz-appearance: none) {
  .auth-modal__panel {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent;
  }
}

.auth-modal__panel::-webkit-scrollbar {
  width: 6px;
}

.auth-modal__panel::-webkit-scrollbar-button,
.auth-modal__panel::-webkit-scrollbar-button:single-button,
.auth-modal__panel::-webkit-scrollbar-button:vertical:start:decrement,
.auth-modal__panel::-webkit-scrollbar-button:vertical:end:increment {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.auth-modal__panel::-webkit-scrollbar-track {
  margin-block: 10px;
  background: transparent;
}

.auth-modal__panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 24%, transparent);
}

.auth-modal__panel::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ink) 38%, transparent);
}

.auth-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  margin: 0 0 1.15rem;
  padding-right: 2rem;
}

.auth-modal__top-nav {
  flex: 1;
  min-width: 0;
}

.auth-modal__top-label {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
}

.auth-modal .auth-modal__tabs {
  margin: 0;
}

.auth-modal__corner-logo {
  flex: 0 0 auto;
  width: 150px;
  height: auto;
  opacity: 0.88;
  pointer-events: none;
}

@media (max-width: 720px) {
  .auth-modal__corner-logo {
    width: 128px;
  }

  .auth-modal__top {
    padding-right: 1.6rem;
  }
}

.auth-modal__logo--light {
  display: none;
}

html[data-theme="dark"] .auth-modal__logo--ink {
  display: none;
}

html[data-theme="dark"] .auth-modal__logo--light {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .auth-modal__logo--ink {
    display: none;
  }

  html[data-theme="auto"] .auth-modal__logo--light {
    display: block;
  }
}

.auth-modal__tabs {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 0 1.35rem;
}

.auth-modal__tab {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.16s ease;
}

.auth-modal__tab:hover {
  color: var(--ink);
}

.auth-modal__tab.is-active {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--ink) 55%, transparent);
}

.auth-modal__sep {
  color: var(--ink-3);
  font-size: 0.9rem;
  font-weight: 300;
}

.auth-panel[hidden] {
  display: none;
}

.auth-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink-3);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.auth-modal__close:hover {
  background: var(--surface);
  border-color: var(--ink-3);
  color: var(--ink);
}

.auth-modal .eyebrow {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}

.auth-modal__title {
  margin: 0 0 1.3rem;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-modal__form {
  gap: 0.9rem;
}

.auth-modal__form .field {
  margin: 0;
  gap: 0.35rem;
}

.field__tag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.02rem 0.34rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  color: var(--ink-2);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  vertical-align: 0.08em;
}

.field__tag--soft {
  border-color: transparent;
  background: transparent;
  color: var(--ink-3);
}

.field__hint {
  margin: 0.08rem 0 0;
  color: var(--ink-2);
  font-size: 0.68rem;
  line-height: 1.5;
}

.field__error {
  min-height: 1.05rem;
  margin: 0.12rem 0 0;
  color: var(--danger);
  font-size: 0.7rem;
  line-height: 1.45;
}

.field__error:empty {
  visibility: hidden;
}

.auth-modal__form .input.is-invalid {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line-2));
}

.pwd-rules {
  display: grid;
  gap: 0.18rem;
  margin: 0.1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.68rem;
}

.pwd-rules li::before {
  content: "○";
  margin-right: 0.32rem;
  color: var(--ink-3);
}

.pwd-rules li.is-ok {
  color: var(--ink-2);
}

.pwd-rules li.is-ok::before {
  content: "●";
  color: var(--ok);
}

.pwd-meter {
  height: 3px;
  margin-top: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
}

.pwd-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.pwd-meter span[data-strength="medium"] {
  background: var(--warn);
}

.pwd-meter span[data-strength="strong"] {
  background: var(--ok);
}

.auth-modal__form .field > label {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.auth-modal__form .input {
  width: 100%;
  height: 2.65rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-modal__form .input::placeholder {
  color: color-mix(in srgb, var(--ink-2) 62%, transparent);
}

/* 浏览器自动填充不要染成蓝色 */
.auth-modal__form .input:-webkit-autofill,
.auth-modal__form .input:-webkit-autofill:hover,
.auth-modal__form .input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 9999s ease-out;
}

.auth-modal__form .input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ink) 38%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
}

html[data-theme="dark"] .auth-modal__form .input:-webkit-autofill,
html[data-theme="dark"] .auth-modal__form .input:-webkit-autofill:hover,
html[data-theme="dark"] .auth-modal__form .input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
}

.auth-modal__remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.auth-modal__remember-hint {
  color: var(--ink-3);
  font-size: 0.7rem;
}

.auth-modal__submit {
  width: 100%;
  height: 2.75rem;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--ink) 60%, transparent);
}

.auth-modal__submit:hover {
  background: color-mix(in srgb, var(--ink) 88%, var(--brand));
  transform: translateY(-1px);
}

.auth-modal__fallback {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.76rem;
}

.auth-modal__fallback a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.auth-modal__fallback a:hover {
  color: var(--ink);
}

.auth-modal .auth-alt {
  margin-top: 1.3rem;
  padding-top: 1.05rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.auth-modal__register {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent);
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.auth-modal__register:hover {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

@media (max-width: 720px) {
  .auth-modal {
    --auth-max-h: 86vh;
    width: 92vw;
    max-height: var(--auth-max-h);
    border-radius: 18px;
  }
}

@media (max-width: 520px) {
  .auth-modal {
    --auth-max-h: 86vh;
    width: 92vw;
    max-height: var(--auth-max-h);
    border-radius: 18px;
  }

  .auth-modal__panel {
    padding: 1.7rem 1.3rem 1.3rem;
  }
}


/* ------------------------------ 全站 Toast ------------------------------ */
.toasts[popover] {
  position: fixed;
  inset: 86px 18px auto auto;
  width: min(356px, calc(100vw - 2rem));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  z-index: 500;
}

.toast {
  --toast-accent: var(--brand);
  --toast-soft: var(--brand-soft);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.72rem 0.8rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-left: 3px solid var(--toast-accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 30%, transparent) inset,
    0 16px 40px -22px rgb(15 23 42 / 38%);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  overflow: hidden;
  animation: toast-in 0.32s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.toast[data-type="success"] { --toast-accent: var(--ok); --toast-soft: var(--ok-soft); }
.toast[data-type="warning"] { --toast-accent: var(--warn); --toast-soft: var(--warn-soft); }
.toast[data-type="error"] { --toast-accent: var(--danger); --toast-soft: var(--danger-soft); }
.toast[data-type="info"] { --toast-accent: var(--brand); --toast-soft: var(--brand-soft); }

.toast__icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.05rem;
  border-radius: 999px;
  background: var(--toast-soft);
  display: grid;
  place-items: center;
}

.toast__icon::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--toast-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--toast-accent) 16%, transparent);
}

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  margin: 0 0 0.1rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--toast-accent);
  text-transform: uppercase;
}

.toast__count {
  margin-left: 0.35rem;
  padding: 0.05rem 0.32rem;
  border-radius: 999px;
  background: var(--toast-soft);
  color: var(--toast-accent);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
}

.toast__message {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast__close {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  margin: -0.1rem -0.15rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.toast__close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: color-mix(in srgb, var(--toast-accent) 30%, transparent);
  transform-origin: left center;
  animation: toast-progress var(--toast-duration, 4200ms) linear forwards;
}

.toast--paused .toast__progress {
  animation-play-state: paused;
}

.toast--leaving {
  animation: toast-out 0.18s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-4px) scale(0.99); }
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 640px) {
  .toasts[popover] {
    inset: 76px 0.8rem auto 0.8rem;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast--leaving,
  .toast__progress {
    animation: none;
  }
}

/* 两步验证 */
.secret-row {
  max-width: 34rem;
  margin: 0.4rem 0;
}

.secret-row .input {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.mfa-secret,
.mfa-codes,
.mfa-uri {
  display: block;
  max-width: 34rem;
  margin: 0.4rem 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mfa-codes {
  letter-spacing: 0.08em;
}

/* 已删除评论：保留墓碑位 */
.comment--deleted {
  margin: 0.4rem 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid color-mix(in srgb, var(--danger) 55%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--danger) 6%, transparent);
}

.comment__deleted {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.entry-drawer-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.entry-drawer-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.keyword-dialog {
  width: min(92vw, 520px);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.keyword-dialog::backdrop {
  background: color-mix(in srgb, #0b1220 34%, transparent);
  backdrop-filter: blur(4px);
}

.keyword-dialog h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.keyword-dialog textarea {
  width: 100%;
  margin: 0.5rem 0;
}

.keyword-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* 内容 / 回复共用抽屉 */
.drawer__head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer__page-link {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--brand) 70%, transparent);
}

.drawer__page-link:hover {
  background: var(--brand-ink);
  color: #fff;
}

.drawer__reply {
  padding: 1rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.drawer__reply-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.55rem;
  margin-bottom: 0.7rem;
}

.drawer__reply-avatar {
  --avatar-size: 32px;
  margin-right: 0.1rem;
}

.drawer__reply-body {
  margin: 0.15rem 0 0.25rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.drawer__divider {
  height: 1px;
  margin: 1.25rem 0;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--line) 90%, var(--ink)) 18%,
    color-mix(in srgb, var(--line) 90%, var(--ink)) 82%,
    transparent
  );
}

.drawer__actions--bottom {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 1.1rem;
  padding: 0.8rem 0 0.2rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
}

.drawer__activity {
  display: grid;
  gap: 0.65rem;
}

.drawer__activity-item {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  font-size: 0.82rem;
}

.drawer__activity-item div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

/* 评论回复折叠 / 翻页 */
.comment__replies {
  margin: 0.35rem 0 0 1.2rem;
  padding-left: 0.9rem;
  border-left: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.comment__replies-toggle {
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 0.8rem;
  cursor: pointer;
}

.comment__replies-toggle:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.comment__reply-pager {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.comment__reply-page {
  padding: 0.1rem 0.35rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}

.comment__reply-page:disabled {
  color: var(--ink-3);
  cursor: default;
}

.comment--depth-2,
.comment--depth-3,
.comment--depth-4 {
  margin-left: 1rem;
  border-left: 2px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding-left: 0.7rem;
}

.comment--depth-3,
.comment--depth-4 {
  margin-left: 2rem;
}

.comment__reply-to {
  color: var(--brand);
  font-size: 0.8rem;
}

.drawer__reply-meta {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  font-size: 0.78rem;
}

.drawer__reply-meta div {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 0.7rem;
  line-height: 1.55;
}

.drawer__reply-meta span {
  color: var(--ink-3);
}

.drawer__reply-meta b {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--avatar-size, 30px);
  width: var(--avatar-size, 30px);
  height: var(--avatar-size, 30px);
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand-ink);
  font-size: calc(var(--avatar-size, 30px) * 0.38);
  font-weight: 600;
  vertical-align: middle;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar__initial {
  line-height: 1;
}

.comment__head .avatar {
  margin-right: 0.35rem;
}

.field__hint--warning {
  color: color-mix(in srgb, #b45309 80%, var(--ink));
  background: color-mix(in srgb, #f59e0b 9%, transparent);
  border-left: 2px solid color-mix(in srgb, #f59e0b 55%, transparent);
  padding: 0.45rem 0.6rem;
  border-radius: 0 6px 6px 0;
}

/* 个人中心复用后台页头时，与内容区留出呼吸空间 */
.acct-main > .admin-head {
  margin-bottom: 1.3rem;
  padding-top: 0.15rem;
}

.acct-main > .admin-head .admin-title {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  line-height: 1.15;
}

/* 头像菜单：与个人中心导航保持同一套节奏 */
.nav-user__menu {
  width: 308px;
  padding: 0.5rem;
  border-radius: 14px;
}

.nav-user__menu .menu-profile {
  padding: 0.65rem 0.6rem 0.7rem;
}

.nav-user__menu .menu-profile__name {
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-user__menu .menu-profile__meta {
  margin-top: 0.15rem;
  color: var(--ink-3);
  font-size: 0.72rem;
}

.nav-user__menu .menu-sep {
  margin: 0.2rem 0.5rem;
}

.nav-user__menu .menu-label {
  padding: 0.4rem 0.55rem 0.25rem;
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.nav-user__menu .menu-group {
  gap: 1px;
}

.nav-user__menu .menu-item {
  gap: 0.55rem;
  padding: 0.48rem 0.58rem;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.45;
}

.nav-user__menu .menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.nav-user__menu .menu-item:hover,
.nav-user__menu .menu-item:focus-visible {
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  color: var(--ink);
}

.nav-user__menu .menu-item:hover svg {
  opacity: 0.8;
}

.nav-user__menu .menu-item--danger {
  color: #b91c1c;
}

.nav-user__menu .menu-item--danger:hover {
  background: color-mix(in srgb, #b91c1c 8%, transparent);
  color: #991b1b;
}

@media (max-width: 720px) {
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .admin-head__main {
    width: 100%;
    align-items: flex-start;
  }

  .admin-head__actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .acct-main,
  .admin-main,
  .admin-content {
    min-width: 0;
  }

  .pay-status {
    width: 100%;
  }

  .pay-status__item {
    flex: 1 1 8rem;
  }
}
