/* ==========================================================================
   页面布局与视图样式
   与 theme.css 的分工：theme.css 出令牌与通用组件，本文件出「页面怎么排」。
   ========================================================================== */

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(var(--panel-deep-rgb), 0.62);
  backdrop-filter: blur(22px) saturate(170%);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

/* 底边补一条渐变发丝光：只有 1px，压不到任何文字 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  opacity: 0.8;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--brand-rgb), 0.55) 24%,
    rgba(var(--aurora-blue-rgb), 0.42) 50%,
    rgba(var(--accent-rgb), 0.5) 76%,
    transparent
  );
}

.topbar[data-scrolled="true"] {
  background: rgba(var(--panel-deep-rgb), 0.86);
  box-shadow: 0 14px 34px -24px rgba(var(--shade-rgb), 0.95);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  min-height: var(--topbar-height);
}

/* 品牌：渐变字 + 会呼吸的发光方块 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__mark {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--gradient);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 6px 18px -6px rgba(var(--brand-rgb), 0.95);
}

/* 外扩halo：让方块像在发光，而不是一块死渐变 */
.brand__mark::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 14px;
  background: radial-gradient(closest-side, rgba(var(--brand-rgb), 0.5), transparent 72%);
  filter: blur(5px);
  animation: halo-pulse 4.6s ease-in-out infinite;
  pointer-events: none;
}

.brand__text {
  color: var(--text);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .brand__text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.06);
}

.brand__mark {
  transition: transform 0.4s var(--ease-spring);
}

/* 搜索：玻璃胶囊 + 聚焦光环 */
.search {
  display: flex;
  flex: 1 1 auto;
  max-width: 440px;
  gap: var(--space-2);
}

.search__input {
  flex: 1 1 auto;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(var(--panel-deep-rgb), 0.55);
  font-size: 14px;
  transition: border-color 0.24s var(--ease-out), box-shadow 0.3s var(--ease-out),
    background-color 0.24s var(--ease-out);
}

.search__input::placeholder {
  color: var(--text-faint);
}

.search__input:hover {
  border-color: var(--border-strong);
}

.search__input:focus {
  border-color: rgba(var(--brand-rgb), 0.6);
  background: rgba(var(--panel-deep-rgb), 0.8);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.14);
  outline: none;
}

.search__submit {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: 14px;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    transform 0.16s var(--ease-spring);
}

.search__submit:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* ------------------------------ 主题切换 ------------------------------ */

/*
 * 图标显示的是「点了会变成什么」：夜间显示太阳、日间显示月亮。
 * 这与 app.js 里 nextThemeLabel() 的文案规则必须一致。
 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(var(--ink-rgb), 0.05);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out), box-shadow 0.28s var(--ease-out),
    transform 0.16s var(--ease-spring);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: rgba(var(--brand-rgb), 0.45);
  background: rgba(var(--brand-rgb), 0.12);
  box-shadow: 0 8px 22px -12px rgba(var(--brand-rgb), 0.95);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle__icon {
  display: block;
}

.theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--moon {
  display: block;
}

/* 提示条：一条被渐变浸过的细带，比纯文字更像「公告」 */
.topbar__notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-3);
  color: var(--text-dim);
  font-size: 12.5px;
}

.topbar__notice-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------ 用户下拉 ------------------------------ */

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 13px 4px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(var(--panel-lift-rgb), 0.6);
  backdrop-filter: blur(10px);
  font-size: 13.5px;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    box-shadow 0.28s var(--ease-out);
}

.user-menu__trigger:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  box-shadow: 0 8px 22px -14px rgba(var(--brand-rgb), 0.9);
}

.user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 208px;
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(var(--panel-rgb), 0.94), rgba(var(--panel-rgb), 0.94)) padding-box,
    var(--hairline) border-box;
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow-lg), 0 0 50px -22px rgba(var(--brand-rgb), 0.7);
  animation: rise-in 0.24s var(--ease-out) backwards;
}

.user-menu__item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13.5px;
  text-align: left;
  transition: background-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.user-menu__item:hover {
  background: rgba(var(--ink-rgb), 0.07);
  color: var(--text);
}

.user-menu__meta {
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
  color: var(--text-faint);
  font-size: 12px;
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   主布局
   -------------------------------------------------------------------------- */

.layout {
  display: block;
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-7);
  outline: none;
}

.layout--two-column {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.page-head__title {
  font-size: 24px;
  color: var(--text);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .page-head__title {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.page-head__subtitle {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 13px;
}

/* 区块标题：前面顶一条渐变竖线，比纯文字更有分隔力 */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-4);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}

.section-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(var(--brand-rgb), 0.85);
}

/* --------------------------------------------------------------------------
   首屏主视觉
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding: var(--space-6);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  /*
   * 不用 backdrop-filter：玻璃模糊层 + 内部 -webkit-background-clip: text 的
   * 渐变标题，在真机 GPU 合成下滚动会让文字整块消失（Chromium 合成 bug）。
   * hero 底色直接给足不透明度，玻璃感由发丝边 + 光晕保留。
   */
  background:
    linear-gradient(rgba(var(--panel-rgb), 0.97), rgba(var(--panel-rgb), 0.97)) padding-box,
    var(--hairline) border-box;
  box-shadow: var(--shadow);
  animation: rise-in 0.6s var(--ease-out) backwards;
}

/* 右上角一团极光。用 background-image 而非伪元素，天然落在内容之下 */
.hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(420px circle at 88% 12%, rgba(var(--brand-rgb), 0.30), transparent 68%),
    radial-gradient(360px circle at 70% 96%, rgba(var(--accent-rgb), 0.16), transparent 70%);
}

.hero__body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: var(--space-3);
  padding: 4px 12px;
  border: 1px solid rgba(var(--brand-rgb), 0.26);
  border-radius: var(--radius-pill);
  background: rgba(var(--brand-rgb), 0.1);
  color: var(--tint-brand);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 1);
  animation: halo-pulse 2.6s ease-in-out infinite;
}

.hero__title {
  margin-bottom: var(--space-3);
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero__title {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero__sub {
  max-width: 52ch;
  margin-bottom: var(--space-4);
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.8;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(var(--ink-rgb), 0.04);
  color: var(--text-dim);
  font-size: 12.5px;
}

.hero__chip-icon {
  color: var(--accent);
  display: inline-flex;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* 右侧装饰：同心光环 + 树洞形光晕 */
.hero__orb {
  position: relative;
  flex: 0 0 168px;
  width: 168px;
  height: 168px;
  margin-right: var(--space-4);
}

.hero__orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  box-shadow: 0 0 44px -8px rgba(var(--brand-rgb), 0.55) inset;
  animation: halo-pulse 6s ease-in-out infinite;
}

.hero__orb-ring:nth-child(2) {
  inset: 20px;
  border-color: rgba(var(--aurora-blue-rgb), 0.2);
  animation-delay: 1.4s;
}

.hero__orb-ring:nth-child(3) {
  inset: 40px;
  border-color: rgba(var(--accent-rgb), 0.24);
  animation-delay: 2.8s;
}

.hero__orb-core {
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 50px -6px rgba(var(--brand-rgb), 0.95);
  animation: halo-pulse 4s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   侧栏
   -------------------------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar__group {
  position: relative;
  padding: var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(var(--panel-rgb), 0.62), rgba(var(--panel-rgb), 0.62)) padding-box,
    var(--hairline-card) border-box;
  backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: var(--shadow-sm);
}

.sidebar__title {
  margin-bottom: var(--space-3);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* 导航：激活态用「玻璃底 + 胶囊指示器」，不用左侧实条 */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-list__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  /* 透明边打底：激活态只换背景，不改盒模型，选中时不会让整列文字左右跳 1px */
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  transition: background-color 0.22s var(--ease-out), color 0.22s var(--ease-out),
    transform 0.18s var(--ease-out);
}

/*
 * 选中指示器：一枚竖直居中、上下留白的胶囊。
 * 早期写法是 box-shadow: inset 3px 0 0 —— 那条实条会从容器顶端拉到低端，
 * 直接横切过 9px 圆角，看起来像把选中项「半包围」起来的方括号。
 * 胶囊固定 18px 高、且只在左内边距区域内（left:3px，宽 3px），
 * 既碰不到圆角，也不会压到文字。
 */
.nav-list__item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--gradient);
  box-shadow: 0 0 14px rgba(var(--brand-rgb), 0.95);
  opacity: 0;
  transform: translateY(-50%) scaleY(0.3);
  transition: opacity 0.3s var(--ease-out), transform 0.42s var(--ease-spring);
  pointer-events: none;
}

.nav-list__item:hover {
  background: rgba(var(--ink-rgb), 0.055);
  color: var(--text);
  transform: translateX(2px);
}

.nav-list__item[data-active="true"] {
  background:
    linear-gradient(100deg, rgba(var(--brand-rgb), 0.20), rgba(var(--aurora-blue-rgb), 0.06) 72%) padding-box,
    var(--hairline) border-box;
  color: #e7e2ff;
  font-weight: 600;
  box-shadow: 0 12px 30px -20px rgba(var(--brand-rgb), 1), inset 0 1px 0 rgba(var(--ink-rgb), 0.07);
}

.nav-list__item[data-active="true"]::before {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}

.nav-list__count {
  color: var(--text-faint);
  font-size: 12px;
}

.nav-list__item[data-active="true"] .nav-list__count {
  color: #bfb4ff;
}

/* 统计：2×2 bento 小块，每块一角有自己的光 */
.stat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.stat {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: rgba(var(--ink-rgb), 0.028);
  background-image: radial-gradient(130px circle at 100% 0%, rgba(var(--brand-rgb), 0.18), transparent 72%);
  transition: border-color 0.24s var(--ease-out), transform 0.22s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.stat:hover {
  border-color: rgba(var(--brand-rgb), 0.34);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(var(--brand-rgb), 0.95);
}

.stat:nth-child(2n) {
  background-image: radial-gradient(130px circle at 100% 0%, rgba(var(--accent-rgb), 0.16), transparent 72%);
}

.stat:nth-child(3n) {
  background-image: radial-gradient(130px circle at 100% 0%, rgba(var(--aurora-blue-rgb), 0.16), transparent 72%);
}

.stat__value {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat__label {
  color: var(--text-faint);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   工具条（排序 / 筛选）
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(var(--panel-deep-rgb), 0.55);
}

.tabs__item {
  padding: 7px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  transition: background-color 0.24s var(--ease-out), color 0.24s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.tabs__item:hover {
  color: var(--text);
}

.tabs__item[data-active="true"] {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 8px 20px -12px rgba(var(--brand-rgb), 0.95), 0 0 0 1px rgba(var(--ink-rgb), 0.07) inset;
}

.toolbar__meta {
  color: var(--text-faint);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   树洞卡片
   边框用渐变发丝（双背景 padding-box/border-box 实现），
   强调条用竖直居中的胶囊光条 —— 见下方 .post-card::before。
   -------------------------------------------------------------------------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-list.stagger > * {
  animation: rise-in 0.5s var(--ease-out) backwards;
}

.post-card {
  position: relative;
  display: block;
  padding: var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    var(--sheen) padding-box,
    linear-gradient(rgba(var(--panel-rgb), 0.60), rgba(var(--panel-rgb), 0.60)) padding-box,
    var(--hairline-card) border-box;
  backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-out), box-shadow 0.34s var(--ease-out);
}

/*
 * hover / 聚焦强调：左侧一道贯穿卡片的边缘光。
 * 两种早期写法都被否掉了：
 *   box-shadow: inset 2px 0 0 —— 满高实条横切 15px 圆角，像「半包围」的方括号；
 *   固定短胶囊（min(56px, 44%)）—— 在高卡片上只剩一截线头，突兀。
 * 现在的做法是「长条 + 两端内缩 16px + 两端渐隐」：
 *   内缩 16px > 圆角 15px，光条永远落在直边上，碰不到圆角；
 *   两端 alpha 归零，收尾是渐隐而不是硬切，所以不会显得突兀。
 * 宽 3px 只占 x∈[0,3]，卡片内边距 20px 起，绝不压到内容。
 */
.post-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    180deg,
    rgba(var(--brand-rgb), 0) 0%,
    rgba(var(--brand-rgb), 0.92) 20%,
    rgba(var(--aurora-blue-rgb), 0.88) 72%,
    rgba(var(--aurora-blue-rgb), 0) 100%
  );
  opacity: 0;
  transform: scaleY(0.94);
  transition: opacity 0.3s var(--ease-out), transform 0.42s var(--ease-spring),
    filter 0.3s var(--ease-out);
  pointer-events: none;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 24px 50px -22px rgba(var(--shade-rgb), 0.9),
    0 0 46px -14px rgba(var(--brand-rgb), 0.6);
}

.post-card:hover::before,
.post-card:focus-visible::before {
  opacity: 1;
  transform: scaleY(1);
  filter: drop-shadow(0 0 6px rgba(var(--brand-rgb), 0.55));
}

.post-card:hover .post-card__title {
  color: var(--text);
}

.post-card:hover .avatar {
  border-color: rgba(var(--brand-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.post-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.post-card__author {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.post-card__name {
  color: var(--text-dim);
  font-size: 13px;
}

.post-card__time {
  color: var(--text-faint);
  font-size: 12px;
}

.post-card__pills {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.post-card__title {
  margin-bottom: var(--space-2);
  font-size: 17.5px;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: var(--text);
  transition: color 0.24s var(--ease-out);
}

.post-card__body {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__body--full {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  color: var(--text);
}

.post-card__foot {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12.5px;
}

.metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s var(--ease-out);
}

.post-card:hover .metric {
  color: var(--text-dim);
}

.metric__icon {
  font-size: 13px;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   详情页
   -------------------------------------------------------------------------- */

.detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.detail__post {
  position: relative;
  padding: var(--space-6);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    var(--sheen) padding-box,
    linear-gradient(rgba(var(--panel-rgb), 0.72), rgba(var(--panel-rgb), 0.72)) padding-box,
    var(--hairline) border-box;
  backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: var(--shadow);
  animation: rise-in 0.5s var(--ease-out) backwards;
}

/* 顶部一条渐亮边，像被打了一束光 */
.detail__post::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-rgb), 0.85), rgba(var(--aurora-blue-rgb), 0.6), transparent);
  pointer-events: none;
}

.detail__title {
  margin-bottom: var(--space-4);
  font-size: 26px;
  line-height: 1.34;
  letter-spacing: -0.025em;
}

.detail__body {
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.detail__foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.detail__foot-spacer {
  margin-left: auto;
}

.reply-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reply-list.stagger > * {
  animation: rise-in 0.5s var(--ease-out) backwards;
}

.reply {
  position: relative;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(var(--panel-rgb), 0.58), rgba(var(--panel-rgb), 0.58)) padding-box,
    var(--hairline-card) border-box;
  backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.26s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.reply:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -24px rgba(var(--shade-rgb), 0.95);
}

/*
 * 署名形态靠左侧光条区分。
 * 用浮在左内边距里的长光条，而不是 box-shadow: inset 3px 0 0 ——
 * 后者会从上到下横切 15px 圆角，形成「半包围」的括号感。
 * 内缩量取 16px（严格大于 15px 圆角半径），光条两端都落在直边上。
 * 光条只占 x∈[0,3]，而头像从 25px 起，绝不会压到内容。
 */
.reply::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.reply--realname::before {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-rgb), 0.3));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.7);
}

/* 匿名走主色系，实名走薄荷色系 —— 两者都清晰可辨，只是明度不同 */
.reply--anonymous::before {
  background: linear-gradient(180deg, rgba(var(--brand-rgb), 0.5), rgba(var(--brand-rgb), 0.12));
}

.reply--anonymous:hover::before {
  background: linear-gradient(180deg, rgba(var(--brand-rgb), 0.95), rgba(var(--brand-rgb), 0.3));
  box-shadow: 0 0 18px rgba(var(--brand-rgb), 0.75);
}

.reply__main {
  flex: 1 1 auto;
  min-width: 0;
}

.reply__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.reply__name {
  font-size: 14px;
  font-weight: 600;
}

.reply__name--real {
  color: var(--accent);
}

.reply__time {
  color: var(--text-faint);
  font-size: 12px;
}

.reply__body {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.82;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-faint);
  font-size: 12.5px;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out),
    box-shadow 0.28s var(--ease-out), transform 0.16s var(--ease-spring);
}

.action-btn:hover {
  background: rgba(var(--ink-rgb), 0.07);
  color: var(--text);
  transform: translateY(-1px);
}

.action-btn[data-active="true"] {
  color: var(--tint-brand);
  background: var(--primary-soft);
  box-shadow: 0 8px 20px -12px rgba(var(--brand-rgb), 1);
}

.action-btn--danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* 回答编辑器 */
.composer {
  padding: var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(var(--panel-rgb), 0.66), rgba(var(--panel-rgb), 0.66)) padding-box,
    var(--hairline-card) border-box;
  backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: var(--shadow-sm);
  animation: rise-in 0.5s var(--ease-out) backwards;
}

.composer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.composer__title {
  font-size: 15px;
  font-weight: 600;
}

.composer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* 未填昵称的锁定态：虚线边 + 无阴影，明确「这里还不能用」 */
.composer--locked {
  border-style: dashed;
  border-color: var(--border-strong);
  background: rgba(var(--panel-deep-rgb), 0.5);
  backdrop-filter: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   表单页
   -------------------------------------------------------------------------- */

.form-shell {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    var(--sheen) padding-box,
    linear-gradient(rgba(var(--panel-rgb), 0.72), rgba(var(--panel-rgb), 0.72)) padding-box,
    var(--hairline) border-box;
  backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: var(--shadow);
  animation: rise-in 0.55s var(--ease-out) backwards;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.code-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.code-row .input {
  flex: 1 1 auto;
}

/* --------------------------------------------------------------------------
   个人主页
   -------------------------------------------------------------------------- */

.profile-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(var(--panel-rgb), 0.7), rgba(var(--panel-rgb), 0.7)) padding-box,
    var(--hairline) border-box;
  backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: var(--shadow);
  animation: rise-in 0.5s var(--ease-out) backwards;
}

.profile-head::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(320px circle at 6% 0%, rgba(var(--brand-rgb), 0.22), transparent 68%);
}

.profile-head > * {
  position: relative;
  z-index: 1;
}

.profile-head__avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: var(--radius-pill);
  background: var(--gradient);
  color: var(--on-gradient);
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 14px 34px -14px rgba(var(--brand-rgb), 0.95);
}

.profile-head__name {
  font-size: 21px;
  letter-spacing: -0.02em;
}

.profile-head__meta {
  color: var(--text-faint);
  font-size: 13px;
}

.profile-head__stats {
  display: flex;
  gap: var(--space-5);
  margin-left: auto;
  text-align: center;
}

.tab-bar {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  position: relative;
  padding: 11px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.22s var(--ease-out), border-color 0.3s var(--ease-out);
}

.tab:hover {
  color: var(--text);
}

.tab[data-active="true"] {
  border-bottom-color: var(--primary);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 6px 22px -14px rgba(var(--brand-rgb), 1);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row__title {
  font-size: 14.5px;
  font-weight: 550;
}

.setting-row__desc {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 12.5px;
}

/* 开关：打开时滑块带光晕，滑动用弹簧曲线 */
.switch {
  position: relative;
  width: 48px;
  height: 27px;
  flex: 0 0 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(var(--panel-deep-rgb), 0.7);
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.34s var(--ease-spring), background-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.switch[aria-checked="true"] {
  border-color: transparent;
  background: var(--gradient);
  box-shadow: 0 0 26px -8px rgba(var(--brand-rgb), 0.95);
}

.switch[aria-checked="true"]::after {
  transform: translateX(21px);
  background: var(--on-gradient);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

/* --------------------------------------------------------------------------
   分页
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.pagination__info {
  color: var(--text-faint);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   页脚与「关于」页
   -------------------------------------------------------------------------- */

.footer {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: var(--space-5);
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}

.footer a {
  transition: color 0.2s var(--ease-out);
}

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

.footer__dot {
  margin: 0 8px;
  opacity: 0.6;
}

.prose {
  animation: rise-in 0.5s var(--ease-out) backwards;
}

.prose h2 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  font-size: 17px;
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  margin-right: 9px;
  border-radius: 2px;
  vertical-align: -1px;
  background: var(--gradient);
  box-shadow: 0 0 10px rgba(var(--brand-rgb), 0.8);
}

.prose p,
.prose li {
  margin-bottom: var(--space-2);
  color: var(--text-dim);
  line-height: 1.9;
}

.prose li {
  padding-left: var(--space-4);
  position: relative;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(var(--brand-rgb), 0.95);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero__orb {
    display: none;
  }
}

@media (max-width: 900px) {
  .layout--two-column {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-list__item {
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 7px 14px;
  }

  /* 横向排布时没有「左边缘」可言，胶囊指示器失去意义，改用填充式激活态 */
  .nav-list__item::before {
    display: none;
  }

  .nav-list__item[data-active="true"] {
    border-color: rgba(var(--brand-rgb), 0.45);
    background: linear-gradient(100deg, rgba(var(--brand-rgb), 0.24), rgba(var(--aurora-blue-rgb), 0.1));
    box-shadow: 0 10px 26px -18px rgba(var(--brand-rgb), 1);
  }

  .nav-list__item:hover {
    transform: none;
  }

  .stat-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar__inner {
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-4);
  }

  .search {
    order: 3;
    max-width: none;
    flex-basis: 100%;
  }

  .topbar__notice {
    padding: 0 var(--space-4) var(--space-3);
  }

  .layout {
    padding: var(--space-4) var(--space-4) var(--space-6);
  }

  .hero {
    padding: var(--space-5);
  }

  .hero__title {
    font-size: 27px;
  }

  .detail__post {
    padding: var(--space-5);
  }

  .detail__title {
    font-size: 21px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-head {
    flex-wrap: wrap;
  }

  .profile-head__stats {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .post-card {
    padding: var(--space-4);
  }

  .stat-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   日间主题的光效覆盖：夜间的紫青冷光压在米色纸上会显得割裂，
   日间一律换成暖金 / 浅玫瑰的「晨光」，强度也比夜间低一档。
   用 :root[data-theme] 前缀抬高优先级，覆盖 app.css 上文的夜间写法。
   ========================================================================== */

:root[data-theme="light"] .hero__glow {
  background-image:
    radial-gradient(420px circle at 88% 12%, rgba(255, 186, 92, 0.34), transparent 68%),
    radial-gradient(360px circle at 70% 96%, rgba(255, 148, 136, 0.20), transparent 70%);
}

:root[data-theme="light"] .hero__orb-ring {
  border-color: rgba(214, 152, 60, 0.28);
  box-shadow: 0 0 44px -8px rgba(255, 186, 92, 0.5) inset;
}

:root[data-theme="light"] .hero__orb-ring:nth-child(2) {
  border-color: rgba(226, 168, 130, 0.26);
}

:root[data-theme="light"] .hero__orb-ring:nth-child(3) {
  border-color: rgba(150, 178, 130, 0.28);
}

:root[data-theme="light"] .hero__orb-core {
  box-shadow: 0 0 50px -6px rgba(255, 186, 92, 0.75);
}

/* 主标题渐变在米色底上仍可辨识，但光晕改为暖色 */

:root[data-theme="light"] .hero__eyebrow {
  box-shadow: 0 0 18px rgba(255, 186, 92, 0.35);
}

/* 侧栏选中项与品牌光斑：紫光换成琥珀光 */

:root[data-theme="light"] .nav-list__item[data-active="true"] {
  box-shadow: 0 10px 26px -18px rgba(190, 124, 38, 0.9);
}

:root[data-theme="light"] .brand__mark {
  box-shadow: 0 0 22px -4px rgba(255, 186, 92, 0.7);
}

/* 极光颗粒在米色纸上用 overlay 会偏灰，改 soft-light 更像纸纹 */
:root[data-theme="light"] .aurora__grain {
  mix-blend-mode: soft-light;
}

/* 品牌方块的外扩 halo 同样换晨光 */
:root[data-theme="light"] .brand__mark::after {
  background: radial-gradient(closest-side, rgba(255, 186, 92, 0.55), transparent 72%);
}

/* 主视觉的 eyebrow 药丸与承诺点图标：跟随日出的暖色，不再用紫/青 */
:root[data-theme="light"] .hero__eyebrow {
  border-color: rgba(214, 152, 60, 0.4);
  background: rgba(255, 186, 92, 0.16);
}

:root[data-theme="light"] .hero__eyebrow::before {
  background: #e8896a;
  box-shadow: 0 0 10px rgba(255, 148, 136, 0.9);
}

:root[data-theme="light"] .hero__chip-icon {
  color: #c2703a;
}

:root[data-theme="light"] .hero__eyebrow {
  color: #a05f1c;
}

/* 侧栏选中项：紫蓝渐变底在米色纸上突兀，换成琥珀晨光底 + 暖褐文字 */
:root[data-theme="light"] .nav-list__item[data-active="true"] {
  /*
   * 填充必须全不透明：半透明琥珀压在玻璃侧栏上时，
   * 底下极光层的冷色雾会透出来把右端染灰（半透明叠半透明的串色）。
   * 两层背景：不透明晨光渐变 → 渐变发丝边。
   */
  background:
    linear-gradient(100deg, #ffd9a2, #ffc0a0 72%, #ffd9a2) padding-box,
    var(--hairline) border-box;
  color: #7a4a10;
  box-shadow: 0 12px 30px -20px rgba(190, 124, 38, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 统计卡的角落光晕同步换暖 */
:root[data-theme="light"] .nav-list__item[data-active="true"] .nav-list__count {
  color: #a4691a;
}

/* 顶部发丝线：夜间的紫青渐变在米色页顶是一条冷线，日间换晨光三色 */
:root[data-theme="light"] body::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 176, 92, 0.85) 22%,
    rgba(255, 148, 136, 0.7) 50%,
    rgba(232, 137, 106, 0.7) 78%,
    transparent
  );
}

:root[data-theme="light"] .hero {
  background:
    linear-gradient(rgba(255, 250, 240, 0.97), rgba(255, 246, 232, 0.95)) padding-box,
    var(--hairline) border-box;
}

/* 主按钮 hover 的青色投影换暖 */
:root[data-theme="light"] .btn--primary:hover {
  box-shadow: 0 14px 34px -10px rgba(232, 137, 106, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* 顶栏右侧控件统一规格：三种控件各写各的高度（34 / 31 / 48px）会参差不齐，
   这里统一锁 36px，头像在胶囊内缩小一号。 */
.topbar__actions {
  --topbar-h: 36px;
}

.topbar__actions .btn {
  height: var(--topbar-h);
  padding-top: 0;
  padding-bottom: 0;
}

.topbar__actions .theme-toggle {
  width: var(--topbar-h);
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
}

.topbar__actions .user-menu__trigger {
  height: var(--topbar-h);
  padding: 3px 13px 3px 4px;
}

.topbar__actions .user-menu__trigger .avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 12.5px;
}

:root[data-theme="light"] .stat {
  background-image: radial-gradient(130px circle at 100% 0%, rgba(255, 186, 92, 0.22), transparent 72%);
}

:root[data-theme="light"] .stat:hover {
  border-color: rgba(214, 152, 60, 0.4);
  box-shadow: 0 12px 28px -18px rgba(214, 152, 60, 0.9);
}

/* ==========================================================================
   移动端性能优化（触摸设备 / 小屏）
   玻璃拟态的 backdrop-filter 在手机 GPU 上滚动时逐帧重绘，是掉帧大头。
   这里统一关闭所有玻璃面板的模糊层，用 !important 压过上文组件自身的定义。
   半透明填充保留，观感仍是一层玻璃底，只是不再做逐帧高斯模糊。
   ========================================================================== */
@media (max-width: 720px) {
  .topbar,
  .card,
  .btn,
  .alert,
  .toast,
  .modal-host,
  .modal,
  .gate,
  .user-menu__trigger,
  .user-menu__panel,
  .sidebar__group,
  .post-card,
  .detail__post,
  .reply,
  .composer,
  .form-shell,
  .profile-head {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
