/* ==========================================================================
   博友圈 · Liquid Glass 设计系统
   玻璃拟态 + 光晕 + 折射高光；配色与动效随主题自动切换
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  /* 底色：略带冷调的浅灰蓝，让玻璃层有东西可以折射 */
  --bg: #eef1f8;

  /* 玻璃层 */
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .38);
  --glass-line: rgba(255, 255, 255, .75);
  --glass-edge: rgba(255, 255, 255, .9);
  --glass-blur: 22px;
  --glass-sat: 180%;

  --text: #1a1f2e;
  --text-2: #4a5468;
  --muted: #6b7689;

  --accent: #3b6ef5;
  --accent-2: #7b5cf0;
  --accent-soft: rgba(59, 110, 245, .12);
  --accent-glow: rgba(59, 110, 245, .38);

  --danger: #e5484d;
  --ok: #16a163;

  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  /* 玻璃阴影：外投影 + 内高光，是"厚度感"的关键 */
  --shadow-1:
    0 1px 2px rgba(20, 30, 60, .05),
    0 6px 18px rgba(20, 30, 60, .07),
    inset 0 1px 0 0 var(--glass-edge);
  --shadow-2:
    0 2px 4px rgba(20, 30, 60, .06),
    0 14px 40px rgba(20, 30, 60, .11),
    inset 0 1px 0 0 var(--glass-edge);
  --shadow-3:
    0 6px 14px rgba(20, 30, 60, .10),
    0 28px 70px rgba(20, 30, 60, .18),
    inset 0 1px 0 0 var(--glass-edge);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 深色主题 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c14;

    --glass: rgba(255, 255, 255, .065);
    --glass-strong: rgba(255, 255, 255, .11);
    --glass-soft: rgba(255, 255, 255, .04);
    --glass-line: rgba(255, 255, 255, .12);
    --glass-edge: rgba(255, 255, 255, .16);

    --text: #eef1f8;
    --text-2: #c2c9d9;
    --muted: #8b94a8;

    --accent: #6f9bff;
    --accent-2: #a98cff;
    --accent-soft: rgba(111, 155, 255, .16);
    --accent-glow: rgba(111, 155, 255, .45);

    --danger: #ff6b6f;
    --ok: #34d399;

    --shadow-1:
      0 1px 2px rgba(0, 0, 0, .4),
      0 6px 18px rgba(0, 0, 0, .45),
      inset 0 1px 0 0 var(--glass-edge);
    --shadow-2:
      0 2px 4px rgba(0, 0, 0, .45),
      0 14px 40px rgba(0, 0, 0, .55),
      inset 0 1px 0 0 var(--glass-edge);
    --shadow-3:
      0 6px 14px rgba(0, 0, 0, .5),
      0 28px 70px rgba(0, 0, 0, .7),
      inset 0 1px 0 0 var(--glass-edge);
  }
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景光晕：玻璃要"有东西可折射"才好看 */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
body::before {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
  top: -12vw; left: -8vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: .30;
  animation: drift-a 26s var(--ease) infinite alternate;
}
body::after {
  width: 40vw; height: 40vw; min-width: 300px; min-height: 300px;
  bottom: -14vw; right: -8vw;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 68%);
  opacity: .26;
  animation: drift-b 32s var(--ease) infinite alternate;
}
@media (prefers-color-scheme: dark) {
  body::before { opacity: .22; }
  body::after  { opacity: .20; }
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vw, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-5vw, -4vw, 0) scale(1); }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 22px; }

/* ---------- 仅读屏软件可见（用于补齐标题层级） ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 可复用玻璃质感 ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-1);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--glass-line);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.topbar.is-stuck { box-shadow: 0 8px 30px rgba(20, 30, 60, .10); }

.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 750; font-size: 17px; letter-spacing: -.3px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px var(--accent-glow);
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub {
  font-size: 11px; font-weight: 500; color: var(--muted);
  letter-spacing: .2px;
}

.nav { display: flex; align-items: center; gap: 5px; }
.nav a {
  padding: 8px 14px; border-radius: var(--r-pill);
  color: var(--muted); font-size: 14px; font-weight: 560;
  border: 1px solid transparent;
  transition: all .22s var(--ease);
  white-space: nowrap;
}
.nav a:hover {
  color: var(--text); text-decoration: none;
  background: var(--glass-soft);
  border-color: var(--glass-line);
}
.nav a.on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
.nav-admin {
  border-color: var(--glass-line) !important;
  background: var(--glass-soft);
}

/* ---------- 主布局：左侧博主栏 + 右侧文章流 ---------- */
.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-top: 26px;
}

/* ---------- 左侧边栏 ---------- */
.sidebar {
  position: sticky;
  top: 88px;
  display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 108px);
}

.side-panel {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 15px 18px 11px;
  border-bottom: 1px solid var(--glass-line);
  flex: 0 0 auto;   /* 标题栏固定，不被列表挤压 */
}
.side-title {
  margin: 0; font-size: 12.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.side-count {
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px; border-radius: var(--r-pill);
}

/* 博主列表可滚动。
   注意 min-height:0 是必需的：flex 子项默认 min-height:auto，
   不加的话列表不会收缩，overflow 永远不会生效，长列表会溢出屏幕。 */
.friend-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-line) transparent;
}
.friend-list::-webkit-scrollbar { width: 7px; }
.friend-list::-webkit-scrollbar-track { background: transparent; }
.friend-list::-webkit-scrollbar-thumb {
  background: var(--glass-line); border-radius: 99px;
}
.friend-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* 单个博主条目 */
.fitem {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--text-2);
  transition: all .2s var(--ease);
  min-width: 0;
}
.fitem:hover {
  text-decoration: none;
  background: var(--glass-soft);
  border-color: var(--glass-line);
  transform: translateX(2px);
}
.fitem.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.fitem.on .fitem-n {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

/* 头像（同时适配裸 <img>/<span> 与 .av-wrap 包裹两种结构） */
.fav, .fav img {
  width: 36px; height: 36px; border-radius: 11px;
  object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--glass-line);
  background: var(--glass-soft);
  box-shadow: 0 1px 3px rgba(20, 30, 60, .10);
}
.fav.av-wrap { border: 1px solid var(--glass-line); box-shadow: 0 1px 3px rgba(20, 30, 60, .10); }
.fav.av-wrap img { border: 0; box-shadow: none; border-radius: inherit; background: none; }
.fav.ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 22%, transparent));
  color: var(--accent);
  font-weight: 750; font-size: 15px;
  border-color: transparent;
}

.fitem-body { min-width: 0; flex: 1; }
.fitem-name {
  display: block;
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fitem-meta {
  display: block;
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fitem-n {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  background: var(--glass-soft);
  padding: 2px 8px; border-radius: var(--r-pill);
  min-width: 26px; text-align: center;
}

/* 侧栏"全部"条目 */
.fitem-all .fav {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.fitem-all .fav svg { width: 17px; height: 17px; }

/* ---------- 主内容区 ---------- */
.content { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* 顶部信息条 */
.hero {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
/* 顶部一道折射高光 */
.hero::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-edge) 22%, var(--glass-edge) 78%, transparent);
}
.hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 750; letter-spacing: -.5px; }
.hero .sub { margin: 0 0 14px; color: var(--text-2); font-size: 14.5px; }

.stats { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 16px; }
.stat-item { display: flex; flex-direction: column; }
.stat-num {
  font-size: 20px; font-weight: 750; letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-lbl { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

/* 搜索框 */
.search { position: relative; display: flex; gap: 9px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.search input[type=search] {
  width: 100%;
  padding: 11px 15px 11px 40px;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-pill);
  background: var(--glass-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: all .22s var(--ease);
}
.search input[type=search]::placeholder { color: var(--muted); }
.search input[type=search]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--glass-strong);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 22px var(--accent-glow);
}
.search button {
  padding: 11px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; font-weight: 650; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: all .22s var(--ease);
  white-space: nowrap;
}
.search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.search button:active { transform: translateY(0) scale(.98); }

/* 搜索结果提示条 */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  font-size: 13.5px; color: var(--text-2);
}
.filter-bar b { color: var(--text); }
.filter-bar .clear {
  margin-left: auto;
  padding: 4px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--glass-line);
  background: var(--glass-soft);
  color: var(--muted); font-size: 12.5px;
}
.filter-bar .clear:hover { color: var(--danger); border-color: var(--danger); text-decoration: none; }

/* 当前博主横幅 */
.friend-head {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  position: relative; overflow: hidden;
}
.friend-head::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-soft), transparent 62%);
  pointer-events: none;
}
.friend-head > * { position: relative; }
.friend-head img, .friend-head .ph, .friend-head .fh-av {
  width: 62px; height: 62px; border-radius: 18px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--glass-line);
  box-shadow: 0 4px 14px rgba(20, 30, 60, .14);
}
.friend-head .fh-av { flex: 0 0 auto; }
.friend-head .fh-av img { border: 0; box-shadow: none; border-radius: inherit; width: 100%; height: 100%; }
.friend-head .ph { font-size: 26px; }
.friend-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 720; letter-spacing: -.3px; }
.friend-head p { margin: 0 0 7px; color: var(--text-2); font-size: 13.5px; }
.friend-head .visit {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600;
  transition: gap .2s var(--ease);
}
.friend-head .visit:hover { text-decoration: none; gap: 8px; }

/* ---------- 文章卡片 ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: flex; gap: 15px;
  padding: 18px 20px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-edge), transparent);
  opacity: .8;
}
.card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity .28s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--glass-line));
}
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card-av { flex: 0 0 auto; }
.card-av img, .card-av .ph, .card-av.av-wrap {
  width: 46px; height: 46px; border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--glass-line);
  box-shadow: 0 2px 8px rgba(20, 30, 60, .10);
}
/* 只有图片用 block，占位字母必须保持 flex 才能居中 */
.card-av img { display: block; }
.card-av.av-wrap { border: 1px solid var(--glass-line); }
.card-av.av-wrap img { border: 0; box-shadow: none; border-radius: inherit; width: 100%; height: 100%; }
.card-av .ph { font-size: 18px; }

.ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 22%, transparent));
  color: var(--accent); font-weight: 750;
}

/* ---------- 头像占位兜底 ----------
   占位字母垫在底层，图片盖在上面；图片加载失败时 JS 移除 <img>，
   底下的字母自然露出来——不需要把 HTML 拼进 onerror 字符串里。 */
.av-wrap { position: relative; overflow: hidden; padding: 0; }
.av-wrap .ph,
.av-wrap .ph-in {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 22%, transparent));
  color: var(--accent); font-weight: 750;
  /* 注意：这里不要写 font-size，否则会以「同权重、后出现」压掉
     .card-av .ph / .wall-av .ph / .avatar-prev .ph 的各自字号。 */
}
.av-wrap img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: inherit;
}

.card-body { min-width: 0; flex: 1; }
.card-body h3 {
  margin: 0 0 7px;
  font-size: 16.5px; line-height: 1.45; font-weight: 660;
  letter-spacing: -.2px;
}
.card-body h3 a { color: var(--text); transition: color .2s var(--ease); }
.card-body h3 a:hover { color: var(--accent); text-decoration: none; }

.badge {
  display: inline-flex; align-items: center;
  margin-left: 7px; padding: 1px 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #ff5c5c, #ff3b7f);
  color: #fff; font-size: 10.5px; font-weight: 700;
  vertical-align: 2px; line-height: 1.7;
  box-shadow: 0 2px 8px rgba(255, 60, 100, .38);
  letter-spacing: .05em;
}

.excerpt {
  margin: 0 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
}
.meta .src {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 620; color: var(--accent);
}
.meta .src::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
  flex: 0 0 auto;
}
.meta .dot { opacity: .45; }

/* ---------- 友链墙 ---------- */
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}
.wall-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  color: var(--text);
  position: relative; overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.wall-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-edge), transparent);
}
.wall-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-soft), transparent 55%);
  opacity: 0; transition: opacity .28s var(--ease); pointer-events: none;
}
.wall-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--glass-line));
  text-decoration: none;
}
.wall-card:hover::after { opacity: 1; }
.wall-card > * { position: relative; z-index: 1; }

.wall-av { flex: 0 0 auto; }
.wall-av img, .wall-av .ph, .wall-av.av-wrap {
  width: 54px; height: 54px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--glass-line);
  box-shadow: 0 3px 12px rgba(20, 30, 60, .13);
}
.wall-av.av-wrap img { border: 0; box-shadow: none; border-radius: inherit; width: 100%; height: 100%; }
.wall-av .ph { font-size: 22px; }

.wall-body { min-width: 0; flex: 1; }
.wall-body h3 {
  margin: 0 0 5px; font-size: 15.5px; font-weight: 680;
  letter-spacing: -.2px;
}
.wall-desc {
  margin: 0 0 9px; font-size: 13px; color: var(--text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.wall-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.wall-n {
  padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--glass-soft); border: 1px solid var(--glass-line);
  font-weight: 600; flex: 0 0 auto;
}
.wall-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 8px; }
.pg {
  min-width: 38px; height: 38px; padding: 0 13px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--muted); font-size: 14px; font-weight: 550;
  box-shadow: var(--shadow-1);
  transition: all .2s var(--ease);
}
.pg:hover {
  color: var(--accent); text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.pg-on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; font-weight: 700;
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.pg-on:hover { color: #fff; transform: translateY(-2px); }
.pg-dots { align-self: center; color: var(--muted); padding: 0 3px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 64px 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px dashed var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.empty-icon {
  width: 54px; height: 54px; margin: 0 auto 16px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty-icon svg { width: 26px; height: 26px; }
.empty h2 { margin: 0 0 8px; font-size: 17px; font-weight: 680; }
.empty p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 44px;
  padding: 26px 0 36px;
  border-top: 1px solid var(--glass-line);
  color: var(--muted); font-size: 13px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 14px;
}
.footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer .tip { font-size: 12px; opacity: .8; margin-top: 10px; width: 100%; }

/* 回到顶部 */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-2);
  color: var(--text-2); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all .3s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--accent); box-shadow: var(--shadow-3); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- 进场动效 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim { animation: rise .5s var(--ease) both; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }

  /* 侧栏变成横向滚动的博主条 */
  .sidebar { position: static; max-height: none; }
  .side-panel { border-radius: var(--r); }
  .friend-list {
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: 10px;
    scroll-snap-type: x proximity;
  }
  .fitem {
    flex: 0 0 auto; min-width: 138px; max-width: 196px;
    flex-direction: column; align-items: flex-start; gap: 7px;
    padding: 11px 13px;
    scroll-snap-align: start;
  }
  .fitem:hover { transform: translateY(-2px); }
  .fitem .fav, .fitem .fav img { width: 40px; height: 40px; }
  .fitem .av-wrap { width: 40px; height: 40px; }
  .fitem-n { display: none; }
  /* 列方向下 .fitem-body 宽度是不确定的，max-width:100% 会失效、省略号不出来。
     这里给它一个确定的宽度基准，长站名/描述才会正确截断。 */
  .fitem-body { width: 100%; max-width: 100%; }
  .fitem-name, .fitem-meta { max-width: 100%; }
  .fitem-all { min-width: 96px; align-items: center; justify-content: center; }
  .fitem-all .fitem-body { width: auto; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 14px; }

  /* 窄屏下导航不能只是缩小——它会撑破一行，而 body 的 overflow-x:hidden
     会把溢出的部分直接裁掉，「管理」就只能靠运气点了。
     这里让顶栏换行，并给导航一条可横向滑动的轨道。 */
  .topbar .wrap {
    height: auto; min-height: 58px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 14px;
  }
  .brand { font-size: 15.5px; }
  .brand-sub { display: none; }
  .nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 11px; font-size: 13px; }

  .layout { padding-top: 16px; }
  .hero { padding: 18px; border-radius: var(--r); }
  .hero h1 { font-size: 20px; }
  .stats { gap: 16px; }
  .stat-num { font-size: 18px; }

  .search { flex-wrap: wrap; }
  .search button { width: 100%; }

  .friend-head { padding: 15px; gap: 12px; border-radius: var(--r); }
  .friend-head img, .friend-head .ph, .friend-head .fh-av { width: 50px; height: 50px; border-radius: 15px; }

  .card { padding: 15px; gap: 12px; border-radius: var(--r); }
  .card-av img, .card-av .ph, .card-av.av-wrap {
    width: 38px; height: 38px; border-radius: 12px; font-size: 15px;
  }
  .card-body h3 { font-size: 15.5px; }

  .wall { grid-template-columns: 1fr; }
  .wall-card { border-radius: var(--r); }

  .to-top { right: 14px; bottom: 14px; }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 不支持 backdrop-filter 时的降级 ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass: rgba(255, 255, 255, .93);
    --glass-strong: rgba(255, 255, 255, .97);
    --glass-soft: rgba(245, 247, 252, .9);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --glass: rgba(26, 30, 44, .96);
      --glass-strong: rgba(20, 24, 36, .98);
      --glass-soft: rgba(32, 37, 52, .9);
    }
  }
}

/* 打印 */
@media print {
  body::before, body::after, .to-top, .search, .pager { display: none !important; }
  .card, .wall-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}
