/* ============================================================
   校园论坛 · 样式表
   默认浅色，可切换深色（data-theme="dark"）
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif,
          "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";

  --bg: #f4f4f7;
  --bg-soft: #ececf2;
  --card: #ffffff;
  --card-2: #f7f7fa;
  --chip-strong: #ffffff;

  --text: #14131a;
  --text-2: #55545f;
  --muted: #9796a3;
  --muted-2: #b6b5c1;

  --line: rgba(17, 16, 24, .07);
  --line-strong: rgba(17, 16, 24, .12);

  --accent: #ff3554;
  --accent-2: #ff6b4a;
  --accent-soft: rgba(255, 53, 84, .10);
  --accent-line: rgba(255, 53, 84, .22);

  --green: #12a06a;
  --green-soft: #e6f8ef;
  --amber: #e08a1e;
  --amber-soft: #fdf3e3;
  --blue: #2b78f6;
  --blue-soft: #eaf2ff;
  --purple: #6b4de6;
  --purple-soft: #f0ecff;

  --nav-bg: rgba(255, 255, 255, .86);
  --seg-bg: #f1f1f6;
  --seg-active: #ffffff;
  --shadow: 0 6px 20px rgba(20, 20, 40, .05);
  --shadow-lg: 0 18px 50px rgba(20, 20, 40, .12);
  --radius: 20px;

  --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #08080a;
  --bg-soft: #101014;
  --card: #141318;
  --card-2: #1b1a20;
  --chip-strong: #232229;

  --text: #f4f3f7;
  --text-2: #bcbac5;
  --muted: #83818d;
  --muted-2: #5f5d68;

  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);

  --accent: #ff4059;
  --accent-2: #ff7a52;
  --accent-soft: rgba(255, 64, 89, .14);
  --accent-line: rgba(255, 64, 89, .26);

  --green: #2fbf8b;
  --green-soft: rgba(47, 191, 139, .14);
  --amber: #e9a13c;
  --amber-soft: rgba(233, 161, 60, .14);
  --blue: #5b9bff;
  --blue-soft: rgba(91, 155, 255, .14);
  --purple: #a48bff;
  --purple-soft: rgba(164, 139, 255, .16);

  --nav-bg: rgba(10, 10, 13, .9);
  --seg-bg: #141318;
  --seg-active: #26252d;
  --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .28s ease, color .28s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.grow { flex: 1; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
::selection { background: var(--accent-soft); }

/* 滚动条 */
::-webkit-scrollbar { width: 0; height: 0; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(78px + var(--safe-b));
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 560px) {
  body {
    background:
      radial-gradient(60% 40% at 10% 0%, rgba(255, 53, 84, .06), transparent 60%),
      radial-gradient(50% 40% at 92% 4%, rgba(124, 92, 255, .07), transparent 62%),
      var(--bg-soft);
  }
  .app {
    box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(20, 20, 40, .1);
  }
  [data-theme="dark"] body {
    background:
      radial-gradient(60% 40% at 10% 0%, rgba(255, 64, 89, .07), transparent 60%),
      radial-gradient(50% 40% at 92% 4%, rgba(124, 92, 255, .08), transparent 62%),
      #040405;
  }
}

/* ============================ 顶部栏 ============================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 12px 0 10px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.topbar-slim { height: 52px; }

.searchbar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}
.searchbar input {
  border: 0;
  background: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
}
.searchbar input::placeholder { color: var(--muted); }

.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  transition: transform .16s ease, background .2s ease;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.ghost:hover { color: var(--text); background: var(--card-2); }
.icon-btn.solid { background: var(--accent); color: #fff; border-color: transparent; }
.icon-btn.round { box-shadow: var(--shadow); }

/* ============================ 标签 ============================ */

.tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 2px 18px 8px;
  overflow-x: auto;
}
.tabs a {
  position: relative;
  font-size: 15.5px;
  color: var(--muted);
  padding: 6px 0 8px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s;
}
.tabs a.on { color: var(--text); font-weight: 800; }
.tabs a.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

/* 胶囊式标签（消息页） */
.pills {
  display: flex;
  gap: 6px;
  margin: 4px 16px 10px;
  padding: 4px;
  border-radius: 14px;
  background: var(--seg-bg);
  border: 1px solid var(--line);
}
.pills a {
  flex: 1;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  padding: 8px 0;
  border-radius: 10px;
  font-weight: 500;
  transition: all .2s;
}
.pills a.on {
  background: var(--seg-active);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(20, 20, 40, .1);
}

/* 分段控件（后台用户页） */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 16px 12px;
  border-radius: 16px;
  background: var(--seg-bg);
  border: 1px solid var(--line);
}
.seg a {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
  transition: all .18s;
}
.seg a.on {
  background: var(--seg-active);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(20, 20, 40, .1);
}

/* ============================ 轮播 ============================ */

.banners {
  display: flex;
  gap: 12px;
  padding: 4px 16px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.banner {
  position: relative;
  flex: 0 0 88%;
  height: 176px;
  border-radius: 22px;
  overflow: hidden;
  scroll-snap-align: center;
  background: #1a1026;
  box-shadow: var(--shadow);
  isolation: isolate;
}
.banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05) 20%, rgba(0, 0, 0, .68) 100%);
}
.banner-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(8px);
}
.banner-body {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  color: #fff;
}
.banner-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.3px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .35);
}
.banner-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .78);
}
.dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 9px 0 4px;
}
.dots i {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--muted-2);
  transition: all .25s;
}
.dots i.on { width: 16px; background: var(--accent); }

/* ============================ 帖子卡片 ============================ */

.feed { padding: 8px 0 4px; }

.post {
  margin: 0 16px 12px;
  padding: 15px 16px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise .42s cubic-bezier(.22, .8, .3, 1) both;
}
.post:nth-child(1) { animation-delay: .02s; }
.post:nth-child(2) { animation-delay: .06s; }
.post:nth-child(3) { animation-delay: .1s; }
.post:nth-child(4) { animation-delay: .14s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.post-wall {
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--card);
  border-color: var(--accent-line);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.post-who-text { min-width: 0; display: block; }
.pname {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pmeta {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wall-flag, .pin-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.wall-flag { color: var(--accent); background: var(--accent-soft); }
.pin-flag { color: var(--amber); background: var(--amber-soft); }

.post-main { display: block; }
.post-title {
  margin: 10px 0 4px;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -.25px;
}
.post-text {
  margin: 6px 0 0;
  font-size: 14.6px;
  line-height: 1.68;
  color: var(--text-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.post-imgs {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
}
.post-imgs img { width: 100%; height: 100%; object-fit: cover; background: var(--card-2); }
.imgs-1 { grid-template-columns: 1fr; }
.imgs-1 img { height: 188px; }
.imgs-2 { grid-template-columns: 1fr 1fr; }
.imgs-2 img { height: 132px; }
.imgs-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 128px 64px; }
.imgs-3 img:first-child { grid-column: 1 / -1; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 8px -8px 0;
}
.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  transition: background .18s, color .18s, transform .18s;
}
.act:hover { background: var(--card-2); color: var(--text); }
.act:active { transform: scale(.94); }
.act.on { color: var(--accent); }
.act.on svg { fill: currentColor; }
.act.star.on { color: #f2a71b; }
.act.danger:hover { color: #e5484d; }
.act.danger { margin-right: 4px; }

/* ============================ 底部导航 ============================ */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(64px + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  align-items: stretch;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--muted);
  padding-top: 6px;
  transition: color .2s;
}
.tab.on { color: var(--accent); font-weight: 700; }
.tab.on svg { filter: drop-shadow(0 4px 10px rgba(255, 53, 84, .28)); }
.tab-dot {
  position: absolute;
  top: 12px;
  left: 56%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.tab-plus { flex: 1; }
.plus-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin-top: -24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #ff5b6e, #ff2748);
  box-shadow: 0 10px 24px rgba(255, 53, 84, .42), 0 0 0 4px var(--bg);
  transition: transform .18s ease;
}
.plus-btn:active { transform: scale(.94); }

/* ============================ 抽屉 ============================ */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
}
.drawer.open { visibility: visible; }
.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 12, .45);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s ease;
}
.drawer.open .drawer-mask { opacity: 1; }

.drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 85%;
  max-width: 344px;
  padding: 14px 18px calc(24px + var(--safe-b));
  overflow-y: auto;
  background:
    radial-gradient(120% 42% at 0% 0%, var(--accent-soft), transparent 62%),
    var(--bg);
  border-right: 1px solid var(--line);
  transform: translateX(-102%);
  transition: transform .34s cubic-bezier(.22, .82, .28, 1);
  box-shadow: 24px 0 60px rgba(0, 0, 0, .18);
}
.drawer.open .drawer-panel { transform: none; }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 14px;
}
.drawer-brand { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow);
}
.drawer-profile.guest { border-color: var(--line); }
.dp-name { font-size: 17px; font-weight: 800; }
.dp-meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.dp-info { min-width: 0; }

.drawer-section {
  margin: 22px 0 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .4px;
}
.drawer-menu { display: grid; }
.drawer-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  font-size: 15px;
  color: var(--text-2);
  border-radius: 12px;
  transition: color .18s, background .18s;
}
.drawer-menu a:hover { color: var(--text); background: var(--card); }
.drawer-menu svg { color: var(--muted); }

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  font-size: 15px;
  color: var(--text-2);
}
.dr-label { display: flex; align-items: center; gap: 14px; }
.dr-label svg { color: var(--muted); }

.switch {
  width: 46px;
  height: 27px;
  border-radius: 999px;
  border: 0;
  padding: 3px;
  background: var(--line-strong);
  position: relative;
  transition: background .24s;
}
.switch i {
  display: block;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  transition: transform .24s cubic-bezier(.3, .9, .3, 1.1);
}
.switch.on { background: linear-gradient(135deg, #ff5b6e, #ff2748); }
.switch.on i { transform: translateX(19px); }

.drawer-foot {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  font-size: 14px;
  color: var(--muted);
}
.drawer-link.danger { color: var(--accent); }

/* ============================ 通用组件 ============================ */

.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--card-2);
}
.avatar-letter {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0;
  overflow: hidden;
  user-select: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.role-admin { background: var(--purple-soft); color: var(--purple); }
.role-teacher { background: var(--blue-soft); color: var(--blue); }
.role-student { background: var(--card-2); color: var(--muted); }
.chip-lv { background: var(--amber-soft); color: var(--amber); font-weight: 700; }

.badge-normal { background: var(--green-soft); color: var(--green); }
.badge-frozen { background: rgba(229, 72, 77, .12); color: #e5484d; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  background: var(--card-2);
  color: var(--text);
  transition: transform .16s, filter .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #ff5b6e, #ff2748);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 53, 84, .24);
}
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-plain { background: var(--card); border-color: var(--line); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.link { color: var(--accent); font-weight: 600; }

.field {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { height: auto; padding: 12px 14px; line-height: 1.65; resize: vertical; }

.field-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px;
  margin: 0 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
}
.field-search input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font-size: 14.5px;
}
.field-search input::placeholder { color: var(--muted); }

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-ic {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted-2);
}
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); }
.empty-desc { margin-top: 6px; font-size: 12.5px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 8px;
}
.section-title { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.section-more { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }

/* 提示条 */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 10px;
  padding: 10px 13px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Toast */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: 86vw;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(20, 19, 26, .92);
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  animation: toastIn .26s ease both;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
[data-theme="dark"] .toast { background: rgba(240, 240, 245, .94); color: #14131a; }
.toast.out { animation: toastOut .24s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* 图片查看 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, .92);
  display: none;
  place-items: center;
  padding: 20px;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 12px; object-fit: contain; }

/* 弹层 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 12, .48);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(20px + var(--safe-b));
  animation: sheetUp .3s cubic-bezier(.22, .85, .3, 1) both;
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.modal-form { display: grid; gap: 12px; }
.form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* ============================ 板块 ============================ */

.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px 4px;
}
.board-card {
  position: relative;
  padding: 16px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.board-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: .12;
  background: var(--bc, var(--accent));
}
.board-ic {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--bc, var(--accent));
  margin-bottom: 11px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--bc, #ff3554) 32%, transparent);
}
.board-name { font-size: 15.5px; font-weight: 800; }
.board-desc {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.board-meta { margin-top: 10px; font-size: 11px; color: var(--muted-2); }

/* ============================ 消息 ============================ */

.msg-list { padding: 2px 0 8px; }
.msg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  transition: background .18s;
}
.msg-item:active { background: var(--card-2); }
.msg-av { position: relative; }
.msg-main { flex: 1; min-width: 0; }
.msg-top { display: flex; align-items: center; gap: 6px; }
.msg-name { font-size: 15.5px; font-weight: 700; }
.msg-time { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.msg-preview {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-pin {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 1px 5px;
  border-radius: 5px;
}
.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
}

/* 聊天 */
.chat-page .app { padding-bottom: 0; }
.chat-scroll {
  padding: 12px 16px 100px;
  display: grid;
  gap: 14px;
}
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble-row > div {
  min-width: 0;
  max-width: 76%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.bubble-row.me > div { align-items: flex-end; }
.bubble {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  word-break: break-word;
}
.bubble-row.me .bubble {
  background: linear-gradient(135deg, #ff5b6e, #ff2748);
  color: #fff;
  border: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 5px;
}
.bubble-time { text-align: center; font-size: 11px; color: var(--muted-2); }
.chat-input {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.chat-input input {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 16px;
  outline: none;
}

/* ============================ 个人中心 ============================ */

.profile-cover {
  height: 130px;
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(255, 53, 84, .55), transparent 60%),
    radial-gradient(80% 120% at 85% 10%, rgba(124, 92, 255, .5), transparent 62%),
    linear-gradient(140deg, #2b1b33, #14131a);
  position: relative;
}
.profile-card {
  margin: -46px 16px 0;
  position: relative;
  padding: 16px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.profile-top { display: flex; align-items: flex-end; gap: 12px; }
.profile-top .avatar { border: 3px solid var(--card); margin-top: -42px; }
.profile-name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.profile-meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.profile-bio { margin-top: 10px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.profile-stats {
  display: flex;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pstat { flex: 1; text-align: center; }
.pstat b { display: block; font-size: 18px; font-weight: 800; }
.pstat span { font-size: 11.5px; color: var(--muted); }

.menu-card {
  margin: 12px 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14.5px;
  border-bottom: 1px solid var(--line);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-ic { color: var(--muted); display: grid; place-items: center; }
.menu-item .mi-sub { margin-left: auto; font-size: 12px; color: var(--muted); }
.menu-item > svg:last-child { margin-left: auto; color: var(--muted-2); }
.menu-item.accent { color: var(--accent); }

/* ============================ 登录 ============================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 26px calc(30px + var(--safe-b));
  background:
    radial-gradient(70% 40% at 20% 0%, rgba(255, 53, 84, .22), transparent 62%),
    radial-gradient(60% 36% at 95% 8%, rgba(110, 80, 255, .18), transparent 60%),
    var(--bg);
  max-width: 480px;
  margin: 0 auto;
}
.auth-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(140deg, #ff6a4d, #ff2748);
  box-shadow: 0 10px 22px rgba(255, 53, 84, .28);
  margin-bottom: 18px;
}
.auth-brand { font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 3px; text-transform: uppercase; }

.role-pick {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}
.role-pick input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  position: relative;
  background: transparent;
}
.role-pick input:checked { border-color: var(--accent); }
.role-pick input:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.role-pick:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.auth-title { margin-top: 26px; font-size: 32px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.2; }
.auth-sub { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.auth-form { margin-top: 32px; display: grid; gap: 12px; }
.auth-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.auth-field:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-field input { flex: 1; border: 0; outline: none; background: none; font-size: 15px; }
.auth-field input::placeholder { color: var(--muted-2); }
.auth-foot { margin-top: auto; padding-top: 30px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-alert {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(229, 72, 77, .1);
  color: #e5484d;
  line-height: 1.5;
}

/* ============================ 发布页 ============================ */

.compose { padding: 10px 16px calc(96px + var(--safe-b)); }
.compose-board { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 14px; }
.board-pill {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
}
.board-pill.on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  font-weight: 700;
}
.compose-title {
  width: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 19px;
  font-weight: 800;
  padding: 10px 0;
}
.compose-text {
  width: 100%;
  min-height: 180px;
  border: 0;
  background: none;
  outline: none;
  font-size: 15.5px;
  line-height: 1.75;
  resize: none;
  padding: 4px 0 10px;
}
.compose-imgs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.compose-imgs .thumb { position: relative; width: 92px; height: 92px; border-radius: 13px; overflow: hidden; }
.compose-imgs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-tile {
  width: 92px;
  height: 92px;
  border-radius: 13px;
  border: 1px dashed var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--card);
}
.compose-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
}
.tool-btn.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ============================ 帖子详情 ============================ */

.detail {
  padding: 14px 18px 10px;
}
.detail-title { font-size: 22px; font-weight: 800; line-height: 1.4; letter-spacing: -.4px; }
.detail-text { margin-top: 10px; font-size: 15.5px; line-height: 1.78; color: var(--text); overflow-wrap: anywhere; }
.detail-meta { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.detail-imgs { display: grid; gap: 8px; margin-top: 16px; border-radius: 16px; overflow: hidden; }
.detail-imgs img { width: 100%; border-radius: 16px; }
.detail-actions {
  display: flex;
  gap: 8px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
}
.comment-section { padding: 8px 18px 20px; }
.comment-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-name { font-size: 13.5px; font-weight: 700; }
.comment-time { margin-left: 6px; font-size: 11px; color: var(--muted-2); font-weight: 400; }
.comment-text { margin-top: 4px; font-size: 14px; color: var(--text-2); line-height: 1.65; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.comment-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.comment-bar input {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 16px;
  outline: none;
}
.comment-bar input:focus { border-color: var(--accent-line); }

/* ============================ 后台 ============================ */

.admin-body {
  background: var(--bg);
  min-height: 100vh;
}
.admin-app {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 110px;
  position: relative;
}
.admin-app::before {
  content: "";
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 320px;
  z-index: -1;
  background:
    radial-gradient(50% 100% at 12% 0%, rgba(133, 96, 255, .13), transparent 68%),
    radial-gradient(46% 100% at 88% 0%, rgba(255, 53, 84, .12), transparent 66%);
  pointer-events: none;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 18px 8px;
}
.admin-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.8px;
}
.admin-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.admin-actions { display: flex; gap: 9px; padding-top: 4px; }
.super-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #8a63ff, #6b4de6);
  box-shadow: 0 6px 14px rgba(107, 77, 230, .28);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px 4px;
}
.stat {
  padding: 16px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.stat-ic {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--sc, #6b4de6) 34%, transparent);
  background: linear-gradient(140deg, color-mix(in srgb, var(--sc, #6b4de6) 82%, #fff), var(--sc, #6b4de6));
}
.stat-value { margin-top: 15px; font-size: 30px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.1; }
.stat-label { margin-top: 3px; font-size: 12px; color: var(--muted); }

.ulist { display: grid; gap: 10px; padding: 4px 16px; grid-template-columns: minmax(0, 1fr); }
.ucard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .2s;
}
.ucard:hover { box-shadow: var(--shadow-lg); }
.ucard-main { flex: 1; min-width: 0; }
.ucard-name { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.ucard-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard-status { flex: none; }
.ucard-tools { display: flex; gap: 6px; margin-top: 0; }

.admin-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 8px;
}
.admin-count { font-size: 12.5px; color: var(--muted); }
.admin-count b { color: var(--text); font-weight: 700; }

.admin-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1080px;
  height: calc(62px + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.anav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
}
.anav.on { color: var(--accent); font-weight: 700; }

.admin-card {
  margin: 12px 16px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
}
.admin-card-title { font-size: 15px; font-weight: 800; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: 0; }
.list-row-main { flex: 1; min-width: 0; display: block; }
.list-row-title { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-meta { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-search { margin: 0 16px 4px; }

.admin-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
}
.admin-toolbar .btn { flex: none; }

/* 后台登录提示 */
.lock-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.lock-card {
  max-width: 360px;
  width: 100%;
  padding: 28px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  text-align: center;
}

/* ============================ 响应式 ============================ */

@media (min-width: 760px) {
  .admin-app { padding-bottom: 120px; }
  .admin-head { padding: 34px 26px 10px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 14px 24px 6px; }
  .ulist { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 4px 24px; }
  .admin-search, .seg, .admin-toolbar { margin-left: 24px; margin-right: 24px; }
  .admin-count-row { padding: 16px 26px 8px; }
  .admin-card { margin: 12px 24px; }
  .admin-nav {
    width: auto;
    max-width: none;
    height: auto;
    bottom: 20px;
    padding: 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    gap: 2px;
  }
  .anav {
    flex: none;
    flex-direction: row;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 12.5px;
  }
  .anav.on { background: var(--accent-soft); }
  .topbar-slim { max-width: 480px; margin: 0 auto; }
}

@media (max-width: 360px) {
  .post { margin-left: 12px; margin-right: 12px; }
  .admin-title { font-size: 23px; }
  .stat-value { font-size: 26px; }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   V2 改造：抽屉收窄 / 单图轮播 / 九宫格 / 聊天媒体 / 后台侧栏 / 双端自适应
   ============================================================ */

:root { --side-w: 0px; --content-w: 480px; }

[hidden] { display: none !important; }

/* ---------------- 侧边抽屉（收窄一半） ---------------- */
.drawer-panel {
  width: 62%;
  max-width: 268px;
  padding: 12px 14px calc(20px + var(--safe-b));
}
.drawer-top { padding: 2px 0 12px; }
.drawer-brand { font-size: 16px; }
.drawer-profile { padding: 10px; gap: 10px; border-radius: 15px; }
.dp-name { font-size: 15px; }
.dp-meta { font-size: 11px; margin-top: 2px; }
.drawer-section { margin: 16px 0 4px; font-size: 11px; }
.drawer-menu a { padding: 9px 2px; font-size: 13.5px; gap: 10px; }
.drawer-menu a svg { width: 18px; height: 18px; }
.drawer-row { padding: 9px 2px; font-size: 13.5px; }
.dr-label { gap: 10px; }
.drawer-row .switch { width: 40px; height: 24px; padding: 2px; }
.drawer-row .switch i { width: 20px; height: 20px; }
.drawer-row .switch.on i { transform: translateX(16px); }
.drawer-foot { margin-top: 16px; padding-top: 10px; }
.drawer-link { font-size: 12.5px; padding: 10px 2px; }

/* ---------------- 轮播（单张可见 + 3 秒自动切换） ---------------- */
.carousel { position: relative; padding: 4px 16px 0; }
.banners {
  display: flex;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.carousel .dots { padding: 9px 0 4px; }
.banners::-webkit-scrollbar { display: none; }
.banner { flex: 0 0 100%; scroll-snap-align: start; }
.banner:active { transform: none; }
.dots { cursor: pointer; }
.dots i { cursor: pointer; }

/* ---------------- 九宫格图片 ---------------- */
.imgs-grid { display: grid; gap: 5px; margin-top: 10px; border-radius: 14px; overflow: hidden; }
.imgs-grid img { width: 100%; height: 100%; object-fit: cover; background: var(--card-2); display: block; }
.imgs-n1 { grid-template-columns: 1fr; }
.imgs-n1 img { height: 210px; }
.imgs-n2 { grid-template-columns: 1fr 1fr; }
.imgs-n2 img { height: 140px; }
.imgs-n3, .imgs-n5, .imgs-n6, .imgs-n7, .imgs-n8, .imgs-n9 { grid-template-columns: repeat(3, 1fr); }
.imgs-n3 img, .imgs-n5 img, .imgs-n6 img, .imgs-n7 img, .imgs-n8 img, .imgs-n9 img { aspect-ratio: 1 / 1; height: auto; }
.imgs-n4 { grid-template-columns: 1fr 1fr; }
.imgs-n4 img { aspect-ratio: 1 / 1; height: auto; }

.detail-imgs.imgs-grid { gap: 6px; }
.detail-imgs.imgs-grid img { height: auto; border-radius: 0; }
.detail-imgs.imgs-n1 img { border-radius: 16px; }
.detail-video {
  width: 100%;
  margin-top: 14px;
  border-radius: 16px;
  background: #000;
  max-height: 70vh;
}

.post-video {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 53, 84, .1), rgba(124, 92, 255, .12));
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.post-pending { border-style: dashed; opacity: .92; }

/* ---------------- 发布页 ---------------- */
.compose-media { padding: 8px 0 2px; }
.compose-imgs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0;
}
.compose-imgs .thumb,
.compose-imgs .upload-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
}
.compose-imgs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-tile {
  border: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  background: var(--card);
  font-size: 11px;
}
.upload-tile .upload-hint { font-size: 10.5px; }
.thumb-size {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
}
.thumb-del {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.compose-tip { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.compose-video { margin-top: 14px; }
.video-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px dashed var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: 13.5px;
}
.video-tile em { margin-left: auto; font-size: 11px; color: var(--muted); font-style: normal; }
.video-preview { position: relative; margin-top: 10px; }
.video-preview video { width: 100%; border-radius: 14px; background: #000; max-height: 320px; }
.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.video-meta b { font-weight: 600; color: var(--text-2); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta .thumb-del { position: static; margin-left: auto; }
.compose-count { font-size: 12px; color: var(--muted); }

/* ---------------- 个人中心 ---------------- */
.pstat { flex: 1; display: block; text-align: center; color: inherit; border-radius: 12px; padding: 6px 0; transition: background .15s; }
.pstat:active { background: var(--card-2); }
.pstat.on { background: var(--card-2); }
.pstat.on b { color: var(--accent); }
.pstat.on span { color: var(--accent); }

.me-subhead {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 16px 4px;
}
.me-subhead b { font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; }
.me-subback {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.me-subback:active { background: var(--card-2); }
.me-subcount { margin-left: auto; font-size: 12px; color: var(--muted); }
.me-tabs {
  display: flex;
  gap: 4px;
  margin: 12px 16px 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--seg-bg);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.me-tabs::-webkit-scrollbar { display: none; }
.me-tabs a {
  flex: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.me-tabs a.on { background: var(--seg-active); color: var(--text); font-weight: 700; box-shadow: 0 2px 10px rgba(20, 20, 40, .1); }
.me-tabs a i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }

/* ---------------- 聊天：表情 / 语音 / 图片 / 视频 ---------------- */
.chat-page .app { padding-bottom: 0; }
.chat-scroll { padding-bottom: 120px; }
.chat-input.chat-input-rich {
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px calc(8px + var(--safe-b));
}
.chat-tools { display: flex; align-items: center; gap: 2px; }
.tool-ic {
  width: 34px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  border-radius: 10px;
  transition: color .18s, background .18s;
}
.tool-ic:hover { color: var(--text); background: var(--card-2); }
.tool-ic.rec { color: var(--accent); animation: micPulse 1s ease-in-out infinite; }
@keyframes micPulse { 50% { opacity: .45; } }
.chat-input-wrap { flex: 1; position: relative; min-width: 0; }
.chat-input-wrap > input,
.chat-input-rich input[type="text"] {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 16px;
  outline: none;
  flex: none;
}
.chat-input-wrap > input:focus { border-color: var(--accent-line); }
.voice-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 13px;
}
.voice-tip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: micPulse .8s ease-in-out infinite;
}
.chat-send { width: 42px; height: 42px; flex: none; }

.emoji-panel {
  position: fixed;
  left: 50%;
  bottom: calc(70px + var(--safe-b));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), var(--content-w));
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 10px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 70;
}
.emoji-panel .emoji {
  border: 0;
  background: none;
  font-size: 21px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 9px;
}
.emoji-panel .emoji:hover { background: var(--card-2); }

.bubble-media { padding: 0; border: 0; background: none; overflow: hidden; border-radius: 14px; }
.bubble-media img { max-width: 210px; max-height: 260px; object-fit: cover; border-radius: 14px; cursor: zoom-in; }
.bubble-video { padding: 0; border: 0; background: none; }
.bubble-video video { max-width: 250px; max-height: 300px; border-radius: 14px; display: block; background: #000; }
.bubble-voice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  min-width: 150px;
}
.bubble-voice audio { height: 30px; width: 170px; }
.bubble-voice em { font-style: normal; font-size: 11px; opacity: .75; }
.bubble-cap { font-size: 10.5px; color: var(--muted-2); margin: 3px 4px 0; }

.chat-flash {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(229, 72, 77, .94);
  color: #fff;
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
}
.upload-mask {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 12, .42);
  backdrop-filter: blur(3px);
}
.upload-box {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 6px 10px;
  padding: 15px 20px 14px;
  width: min(260px, 76vw);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
}
.upload-box .up-label { font-weight: 600; }
.upload-box .up-num {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.upload-box .up-track {
  grid-column: 1 / -1;
  display: block;
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--line-strong);
  overflow: hidden;
}
.upload-box .up-track em {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--accent);
  transition: width .16s linear;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 桌面侧边导航 ---------------- */
.shell { display: block; }
.sidenav { display: none; }

@media (min-width: 1024px) {
  :root { --side-w: 236px; --content-w: 780px; }

  body.has-chrome { background: var(--bg-soft); }
  .shell { padding-left: var(--side-w); }
  .shell-plain { padding-left: 0; }
  .shell-plain .app { border-left: 0; border-right: 0; }
  .app {
    max-width: var(--content-w);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .tabbar { display: none; }
  .app { padding-bottom: 40px; }

  .sidenav {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--side-w);
    padding: 20px 14px;
    background: var(--card);
    border-right: 1px solid var(--line);
    z-index: 50;
    gap: 6px;
  }
  .sn-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; }
  .sn-logo {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 16px;
    background: linear-gradient(140deg, #ff6a4d, #ff2748);
    box-shadow: 0 8px 18px rgba(255, 53, 84, .28);
  }
  .sn-brand-text { font-size: 15.5px; font-weight: 800; letter-spacing: -.2px; }
  .sn-nav { display: grid; gap: 2px; }
  .sn-label { margin: 16px 8px 6px; font-size: 11px; color: var(--muted-2); letter-spacing: .5px; }
  .sn-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-2);
    border: 0;
    background: none;
    width: 100%;
    text-align: left;
    transition: background .16s, color .16s;
  }
  .sn-item:hover { background: var(--card-2); color: var(--text); }
  .sn-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
  .sn-item.on svg { color: var(--accent); }
  .sn-dot {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
    font-size: 10.5px;
    font-style: normal;
    display: grid;
    place-items: center;
  }
  .sn-publish { margin: 12px 0 2px; }
  .sn-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
  .sn-theme .switch { margin-left: auto; }
  .sn-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; margin-top: 6px; }
  .sn-user:hover { background: var(--card-2); }
  .sn-user-main { display: grid; min-width: 0; }
  .sn-user-main b { font-size: 13.5px; }
  .sn-user-main em { font-style: normal; font-size: 10.5px; color: var(--muted); }
  .sn-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    padding: 1px 5px;
    border-radius: 99px;
  }

  /* 固定条跟随内容列 */
  .compose-bar, .chat-input, .comment-bar {
    left: calc(50% + var(--side-w) / 2);
    max-width: var(--content-w);
  }
  .toast-wrap { left: calc(50% + var(--side-w) / 2); }
  .emoji-panel { left: calc(50% + var(--side-w) / 2); }
  .chat-flash { left: calc(50% + var(--side-w) / 2); }
  .tabbar { left: calc(50% + var(--side-w) / 2); }

  .board-grid { grid-template-columns: repeat(3, 1fr); padding: 8px 24px; }
  .board-grid > a[style*="grid-column"] { grid-column: 1 / -1 !important; }
  .modal-card { border-radius: 22px; margin-bottom: 12vh; max-width: 560px; }
  .modal { align-items: center; }
  @keyframes sheetUp { from { transform: translateY(14px); opacity: 0; } }
  .post-title { font-size: 18px; }
  .detail { padding: 18px 26px; }
  .comment-section { padding: 8px 26px 24px; }
  .profile-cover { height: 150px; }
  .me-tabs, .feed { padding-left: 20px; padding-right: 20px; }
  .carousel { padding: 6px 20px 0; }
  .tabs { padding: 6px 24px 10px; gap: 30px; }
  .section-head { padding: 18px 24px 8px; }
  .pills { margin: 6px 24px 12px; }
  .msg-item { padding: 14px 24px; }
  .me-tabs { margin: 14px 20px 4px; }
  .menu-card { margin: 12px 20px; }
}

/* ---------------- 后台：左侧可收纳侧栏 ---------------- */
.admin-body { background: var(--bg-soft); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 244px;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: var(--card);
  border-right: 1px solid var(--line);
  z-index: 120;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.22, .82, .28, 1), width .2s;
}
.admin-side.open { transform: none; box-shadow: 24px 0 60px rgba(0, 0, 0, .18); }
.as-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 14px; }
.as-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.as-logo {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px;
  background: linear-gradient(140deg, #8a63ff, #6b4de6);
}
.as-brand-text { display: grid; font-size: 13.5px; font-weight: 800; line-height: 1.25; min-width: 0; }
.as-brand-text em { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.as-collapse {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted);
  display: grid; place-items: center;
}
.as-collapse:hover { color: var(--text); background: var(--card-2); }
.as-nav { display: grid; gap: 2px; }
.as-group { margin: 14px 8px 4px; font-size: 10.5px; color: var(--muted-2); letter-spacing: .6px; }
.as-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 13.5px;
  color: var(--text-2);
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
}
.as-item:hover { background: var(--card-2); color: var(--text); }
.as-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.as-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  padding: 1px 6px;
  border-radius: 99px;
}
.as-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.as-user { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 11px; margin-top: 4px; }
.as-user:hover { background: var(--card-2); }
.as-user-main { display: grid; min-width: 0; }
.as-user-main b { font-size: 12.5px; }
.as-user-main em { font-style: normal; font-size: 10px; color: var(--muted); }
.admin-main { flex: 1; min-width: 0; padding-bottom: 40px; }
.admin-mask { display: none; position: fixed; inset: 0; background: rgba(8, 8, 12, .45); z-index: 110; }
.admin-mask.open { display: block; }
.admin-burger { display: inline-grid; }

.admin-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 16px 8px;
  max-width: 1180px;
  margin: 0 auto;
}
.admin-title { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.admin-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.admin-actions { display: flex; gap: 8px; padding-top: 2px; margin-left: auto; }

.admin-cols { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.admin-cols > div { min-width: 0; }
.stat { display: block; color: inherit; transition: transform .16s, box-shadow .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.switch-list { padding: 0 16px 8px; display: grid; }
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.switch-row:last-child { border-bottom: 0; }
.sr-main { flex: 1; min-width: 0; }
.sr-main b { display: block; font-size: 14px; font-weight: 600; }
.sr-main em { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); font-style: normal; line-height: 1.5; }
.switch-row .switch { flex: none; display: inline-block; }
.switch-row input:checked + .switch { background: linear-gradient(135deg, #ff5b6e, #ff2748); }
.switch-row input:checked + .switch i { transform: translateX(19px); }

.review-imgs { display: flex; gap: 6px; flex-wrap: wrap; }
.review-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.review-video { max-width: 320px; border-radius: 12px; background: #000; }

@media (max-width: 1023px) {
  .admin-side { width: 250px; }
  .admin-burger { display: inline-grid; }
  .admin-head { padding: 16px 14px 6px; }
  .admin-title { font-size: 19px; }
  .admin-cols { grid-template-columns: 1fr; }
  .stat-grid { padding: 10px 12px 2px; }
  .admin-card { margin: 10px 12px; }
  .ulist { padding: 4px 12px; }
}

@media (min-width: 1024px) {
  .admin-side { transform: none; width: 244px; }
  .admin-mask { display: none; }
  .admin-main { margin-left: 244px; }
  .admin-burger { display: none; }
  .admin-head { padding: 26px 24px 8px; }
  .admin-cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 6px; padding-right: 16px; }
  .admin-cols > div > .admin-card { margin-left: 8px; margin-right: 8px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 14px 24px 6px; max-width: 1180px; margin: 0 auto; }
  .ulist { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 4px 20px; max-width: 1180px; margin: 0 auto; }
  .admin-card { max-width: 1180px; margin: 12px 20px; }
  .admin-cols .admin-card { max-width: none; }
  .admin-count-row, .seg, .admin-search, .admin-toolbar { max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
  .admin-card .list-row { padding-left: 18px; padding-right: 18px; }

  html.admin-collapsed .admin-side { width: 72px; }
  html.admin-collapsed .admin-main { margin-left: 72px; }
  html.admin-collapsed .as-brand-text,
  html.admin-collapsed .as-item span,
  html.admin-collapsed .as-group,
  html.admin-collapsed .as-user-main,
  html.admin-collapsed .as-badge { display: none; }
  html.admin-collapsed .as-head { flex-direction: column; gap: 10px; }
  html.admin-collapsed .as-item { justify-content: center; padding: 10px 0; }
  html.admin-collapsed .as-user { justify-content: center; }
  html.admin-collapsed .as-collapse { transform: scaleX(-1); }
}

/* ---------- 后台保存条 ---------- */
.admin-savebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 4px 0 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 -6px 24px rgba(20, 20, 30, .06);
}
.admin-savebar .asb-hint {
  font-size: 12.5px;
  color: var(--muted);
}
.admin-savebar .btn { height: 40px; padding: 0 22px; }
@media (max-width: 720px) {
  .admin-savebar {
    padding: 10px 12px;
    border-radius: 14px;
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .admin-savebar .asb-hint { text-align: center; }
  .admin-savebar .btn { width: 100%; }
}

/* 我的页标签：窄屏收敛，避免横向裁切 */
@media (max-width: 430px) {
  .me-tabs { gap: 2px; }
  .me-tabs a { flex: 1 1 0; justify-content: center; padding: 8px 4px; font-size: 12.5px; }
  .me-tabs a i { display: none; }
}

/* ---------------- 「我的」更多功能面板 ---------------- */
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: -6px auto 14px;
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.more-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 2px;
  border-radius: 14px;
  color: var(--text);
  transition: background .16s;
}
.more-item:active { background: var(--card-2); }
.more-ic {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(20, 20, 40, .05);
}
.more-label { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.more-item em {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 9.5px;
  line-height: 1;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg);
}
@media (min-width: 1024px) {
  .more-grid { grid-template-columns: repeat(5, 1fr); }
}

/* 我的页空状态收紧，避免列表与上方内容隔太远 */
.me-empty { padding: 26px 0 18px !important; }
.me-empty .empty-ic { width: 52px; height: 52px; margin-bottom: 10px; }

/* ---------------- 首页触底加载 ---------------- */
.feed-more {
  height: 1px;
  margin-top: -1px;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.feed-more.on { opacity: 0; }
.feed-more.feed-more-error {
  height: auto;
  margin: 10px 0 20px;
  overflow: visible;
}
.feed-more .spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
  opacity: .5;
}
.feed-more.on .spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 聊天页：无遮挡布局（头/滚动区/输入区三段式） ---------------- */
.chat-page .app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.chat-page .chat-topbar {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  height: auto;
  min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.chat-title { flex: 1; min-width: 0; text-align: center; }
.chat-title-main {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-title-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 16px;
  display: block;
  overscroll-behavior: contain;
}
#chatList { display: grid; gap: 14px; }
/* 大消息（图/视频）头像贴顶，避免头像被压到图片下方 */
.bubble-row { align-items: flex-start; }
.bubble-name { font-size: 11px; color: var(--muted); margin: 0 0 4px 4px; }

.chat-input.chat-input-rich {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  max-width: none;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  padding-bottom: calc(8px + var(--safe-b));
  z-index: 5;
}
.chat-empty { padding: 46px 0; text-align: center; color: var(--muted); }
.chat-empty .empty-ic {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 18px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--muted-2);
}
.chat-empty .empty-title { font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.chat-empty .empty-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* 录音条 */
.rec-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 4px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.rec-mid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent);
}
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  animation: micPulse .9s ease-in-out infinite;
}
.rec-btn {
  border: 0;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
}
.rec-stop { background: var(--accent); color: #fff; }
.rec-stop:active { opacity: .86; }

/* 图片/视频气泡保持圆角，不被「我的」气泡小圆角覆盖 */
.bubble-row.me .bubble.bubble-media,
.bubble-row.me .bubble.bubble-video { border-radius: 14px; }

/* 录音时让录音条占满整行 */
.chat-input.recording .chat-tools,
.chat-input.recording .chat-send { display: none; }
.chat-input.recording .chat-input-wrap { flex: 1 1 100%; }
.rec-bar { padding: 0 4px; }
.rec-cancel { padding: 0 10px; }
.rec-stop { padding: 0 14px; }
.chat-input.recording .chat-input-wrap { min-height: 42px; }

/* ---------------- 群聊操作条 ---------------- */
.group-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 16px 10px;
  flex-wrap: wrap;
}
.group-bar .btn { height: 34px; padding: 0 14px; font-size: 13px; }
.group-bar-tip { font-size: 11.5px; color: var(--muted); margin-left: auto; }

.pick-list {
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: var(--card);
}
.pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.pick-item:active { background: var(--card-2); }
.pick-item input { accent-color: var(--accent); width: 16px; height: 16px; }
.pick-name { font-size: 13.5px; font-weight: 600; }
.pick-uid { font-size: 11px; color: var(--muted); margin-left: auto; }

/* ---------------- 后台：轮播图列表 ---------------- */
.banner-row { align-items: flex-start; }
.banner-row.is-off { opacity: .62; }
.banner-thumb {
  flex: none;
  width: 96px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.banner-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-thumb-empty { color: var(--muted-2); }
.banner-tools { display: flex; align-items: center; gap: 2px; }
.banner-preview {
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 260px;
}
.banner-preview img { width: 100%; display: block; }
@media (max-width: 560px) {
  .banner-thumb { width: 76px; height: 44px; }
  .banner-tools { flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------------- 后台：垃圾清理 ---------------- */
.clean-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.clean-row:first-of-type { border-top: 0; }
.clean-row input { margin-top: 3px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.clean-main { flex: 1; min-width: 0; }
.clean-main b { display: block; font-size: 14px; font-weight: 600; }
.clean-main em { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-style: normal; line-height: 1.6; }
.clean-num { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------------- 上传进度胶囊 ---------------- */
.up-pill {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-b));
  transform: translate(-50%, 10px);
  z-index: 320;
  width: min(300px, 76vw);
  padding: 10px 14px 11px;
  border-radius: 14px;
  background: rgba(22, 22, 28, .88);
  backdrop-filter: blur(10px);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.up-pill.on { opacity: 1; transform: translate(-50%, 0); }
.up-pill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: .2px;
}
.up-pill-row b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.up-pill-bar {
  display: block;
  height: 4px;
  margin-top: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .24);
  overflow: hidden;
}
.up-pill-bar em {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: #fff;
  transition: width .18s linear;
}
