/* ============================================================
   省二校园墙墙 · 全局样式
   Twitter/X 式三栏布局，移动端单栏 + 底部导航
   ============================================================ */

:root {
  --brand:      #4f46e5;
  --brand-2:    #7c3aed;
  --brand-soft: #eef0ff;
  --bg:         #f6f7f9;
  --card:       #ffffff;
  --line:       #e8eaef;
  --text:       #0f172a;
  --text-2:     #475569;
  --muted:      #8892a4;
  --danger:     #e11d48;
  --warn:       #f59e0b;
  --ok:         #10b981;
  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .10);
  --shadow-lg:  0 12px 40px -12px rgba(16, 24, 40, .22);
  --nav-h:      56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

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

img, video { max-width: 100%; display: block; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection { background: #ddd6fe; }

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5d9e2; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b9bfcc; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   布局
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 330px;
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  align-items: start;
}

.col-left  { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 0; }
.col-main  { min-width: 0; max-width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--card); min-height: 100vh; }
.col-right { position: sticky; top: 0; padding: 14px 0 40px; height: 100vh; overflow-y: auto; }

/* ---------------- 左侧导航 ---------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 18px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.3px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  color: #fff; font-size: 19px; font-weight: 800;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6);
  flex: none;
}
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: 1.35; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover { background: #f0f1f5; text-decoration: none; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-item svg { flex: none; }

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 12px 6px;
}

/* 校区折叠树 */
.tree-section { border-radius: 12px; }
.tree-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  user-select: none;
}
.tree-head:hover { background: #f0f1f5; }
.tree-head.active { background: var(--brand-soft); color: var(--brand); }
.tree-head .chev { margin-left: auto; transition: transform .18s ease; color: var(--muted); }
.tree-section.open .chev { transform: rotate(90deg); }
.tree-body { display: none; padding: 2px 0 6px 14px; margin-left: 10px; border-left: 2px solid var(--line); }
.tree-section.open .tree-body { display: block; }
.tree-body a {
  display: block;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-body a:hover { background: #f0f1f5; text-decoration: none; color: var(--text); }
.tree-body a.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); }

.btn-post {
  margin: 14px 0 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .65);
  transition: transform .12s ease, box-shadow .2s ease;
}
.btn-post:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(79, 70, 229, .7); }
.btn-post:active { transform: translateY(0) scale(.985); }

.nav-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 99px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-top: 6px;
}
.nav-user:hover { background: #f0f1f5; text-decoration: none; }
.nav-user-info { min-width: 0; }
.nav-user-name { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-meta { font-size: 12px; color: var(--muted); }

/* ============================================================
   中间栏
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  min-width: 0; max-width: 100%;
}
.topbar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px;
}
.topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.topbar-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; min-width: 0; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border: 0;
  background: none;
  cursor: pointer;
}
.tab:hover { color: var(--text); text-decoration: none; background: #f6f7f9; border-radius: 10px 10px 0 0; }
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 3px;
  background: var(--brand);
}

/* ---------------- 发帖框（顶部） ---------------- */
.composer-mini {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: text;
}
.composer-mini .hint {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 15px;
  padding-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer-mini .mini-actions { display: flex; align-items: center; }

/* ============================================================
   帖子卡片
   ============================================================ */
.post {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .12s ease;
  position: relative;
  min-width: 0;
  max-width: 100%;
}
.post:hover { background: #fafbfc; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex: none;
  user-select: none;
  letter-spacing: -.5px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; }

.post-body { flex: 1; min-width: 0; }

.post-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px;
  flex-wrap: wrap;
}
.post-nick { font-weight: 700; color: var(--text); }
.post-nick:hover { text-decoration: none; color: var(--brand); }
.post-handle { color: var(--muted); font-size: 13.5px; }
.post-dot { color: var(--muted); font-size: 12px; }
.post-time { color: var(--muted); font-size: 13px; }
.post-time:hover { text-decoration: underline; }
.post-more {
  margin-left: auto;
  color: var(--muted);
  background: none; border: 0; cursor: pointer;
  padding: 4px 6px; border-radius: 999px; line-height: 0;
}
.post-more:hover { background: var(--brand-soft); color: var(--brand); }

/* 置顶图钉：只有审核员 / 管理员看得到，点了就切置顶 */
.post-pin {
  margin-left: auto;
  color: var(--muted);
  background: none; border: 0; cursor: pointer;
  padding: 4px 6px; border-radius: 999px; line-height: 0;
  transition: background .15s ease, color .15s ease;
}
.post-pin:hover { background: var(--brand-soft); color: var(--brand); }
.post-pin.is-on { background: #eef0ff; color: #4338ca; }
.post-pin + .post-more { margin-left: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 999px;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-mod { background: #ecfdf5; color: #047857; }
.badge-admin { background: #fef2f2; color: #b91c1c; }
.badge-pending { background: #fffbeb; color: #b45309; }

.cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f3f8;
  color: var(--text-2);
}
.cat-chip::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .85;
}

.post-text {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--text);
}
.post-text a { color: var(--brand); }
.post-title { font-weight: 700; margin: 4px 0 2px; font-size: 15.5px; }

/* 媒体网格 */
.media-grid {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 > :first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-item {
  position: relative;
  background: #0b1020;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.media-grid.n1 .media-item { aspect-ratio: auto; max-height: 510px; }
.media-item img, .media-item video {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.media-grid.n1 .media-item img { object-fit: contain; max-height: 510px; background: #0b1020; }

.file-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  background: #fafbfc;
  max-width: 100%;
}
.file-chip:hover { text-decoration: none; border-color: #c7cdfa; background: var(--brand-soft); color: var(--brand); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 操作栏 */
.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  margin-left: -8px;
}
.act {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
  line-height: 1;
}
.act:hover { text-decoration: none; }
.act svg { transition: transform .15s ease; }
.act-c:hover  { color: #0ea5e9; background: #eff9fe; }
.act-r:hover  { color: #10b981; background: #ecfdf5; }
.act-l:hover  { color: #e11d48; background: #fff1f4; }
.act-v:hover  { color: var(--brand); background: var(--brand-soft); }
.act.on { color: #e11d48; }
.act.on svg { transform: scale(1.08); }
.act:active svg { transform: scale(.88); }

/* ============================================================
   右栏
   ============================================================ */
.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.side-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.side-card p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.side-card p:last-child { margin-bottom: 0; }
.side-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.side-list a, .side-list span {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 8px; border-radius: 8px; font-size: 13.5px; color: var(--text-2);
}
.side-list a:hover { background: #f6f7f9; text-decoration: none; color: var(--text); }
.side-list b { font-weight: 700; color: var(--text); }

.mini-post { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-post:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-post-text { font-size: 13px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   通用组件
   ============================================================ */
.container-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 26px 16px 80px;
}

.page-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

h1.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin: 0 0 6px; }
p.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field .tip { font-size: 12px; color: var(--muted); margin-top: 5px; }

.input, .textarea, .select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  font-size: 15px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .8); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: #f6f7f9; }
.btn-danger { background: var(--danger); }
.btn-ok { background: var(--ok); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  line-height: 1.55;
}
.alert-err  { background: #fff1f4; border-color: #fecdd3; color: #9f1239; }
.alert-ok   { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--brand-soft); border-color: #ddd6fe; color: #3730a3; }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty svg { opacity: .35; margin-bottom: 12px; }
.empty p { margin: 0; font-size: 14px; }

.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }

/* ---------------- 未登录遮罩 ---------------- */
.guest-gate {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 0;
}
.guest-gate-inner {
  padding: 42px 24px;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, var(--brand-soft) 100%);
}
.guest-gate h3 { margin: 0 0 8px; font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.guest-gate p { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.guest-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------- 底部导航（移动端） ---------------- */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner {
  display: flex;
  height: var(--nav-h);
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  border: 0; background: none;
  cursor: pointer;
}
.bn-item:hover { text-decoration: none; color: var(--text-2); }
.bn-item.active { color: var(--brand); }
.bn-fab { flex: none; width: 64px; display: grid; place-items: center; }
.bn-fab .fab-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .85);
  margin-top: -14px;
  border: 3px solid #fff;
  cursor: pointer;
}

/* ---------------- 悬浮发帖按钮（桌面） ---------------- */
.fab-desktop {
  position: fixed;
  bottom: 28px;
  right: calc(50% - 660px + 20px);
  z-index: 50;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: none;
  place-items: center;
  box-shadow: 0 12px 28px -10px rgba(79, 70, 229, .9);
  cursor: pointer;
}

/* ============================================================
   帖子详情页
   ============================================================ */
.detail-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  width: 100%;
  background: none; border: 0; cursor: pointer;
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
}
.detail-back:hover { text-decoration: none; background: #f6f7f9; }

.post-detail { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.post-detail .post-head { font-size: 15px; }
.post-detail .post-text { font-size: 18px; line-height: 1.65; margin-top: 12px; }

.stat-bar {
  display: flex; flex-wrap: wrap; gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.stat-bar b { color: var(--text); font-weight: 700; }

.analytics {
  background: #fafbff;
  border: 1px solid #e0e4ff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0;
}
.analytics h4 { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--brand); letter-spacing: .3px; }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 12px; }
.analytics-item .v { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.analytics-item .k { font-size: 11.5px; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; margin-top: 12px; }
.spark i { flex: 1; background: linear-gradient(180deg, var(--brand), #c4b5fd); border-radius: 3px 3px 0 0; min-height: 2px; }

.comment {
  display: flex; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.comment.reply { padding-left: 58px; background: #fcfcfd; }
.comment-body { flex: 1; min-width: 0; }
.comment-text { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin: 3px 0 0; }
.comment-actions { display: flex; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.comment-actions button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-size: inherit; }
.comment-actions button:hover { color: var(--brand); }

.comment-form {
  display: flex; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.comment-form .textarea { min-height: 44px; padding: 10px 14px; border-radius: 999px; resize: none; }

/* ============================================================
   发帖页
   ============================================================ */
.compose-wrap { display: flex; gap: 12px; padding: 16px; }
.compose-wrap .textarea {
  border: 0; background: none; font-size: 18px; min-height: 120px; padding: 8px 0; line-height: 1.65;
}
.compose-wrap .textarea:focus { box-shadow: none; background: none; }

.preview-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.preview-thumb {
  position: relative;
  width: 86px; height: 86px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1020;
}
.preview-thumb img, .preview-thumb video { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb .rm {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff;
  border: 0; cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.preview-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 12.5px; color: var(--text-2); background: #fafbfc; max-width: 100%;
}

.compose-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  position: sticky; bottom: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
}
.compose-tools { display: flex; gap: 4px; }
.tool-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0; background: none;
  color: var(--brand);
  display: grid; place-items: center;
  cursor: pointer;
}
.tool-btn:hover { background: var(--brand-soft); }

.char-ring { position: relative; width: 30px; height: 30px; margin-right: 10px; }
.char-ring svg { transform: rotate(-90deg); }
.char-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--muted); font-weight: 700; }

/* ============================================================
   审核区
   ============================================================ */
.review-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.review-tabs .tab-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.review-tabs .tab-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.review-tabs .tab-pill .n {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  background: rgba(255,255,255,.25); border-radius: 99px; font-size: 11px;
}
.review-tabs .tab-pill:not(.active) .n { background: #eef0f4; color: var(--muted); }

.review-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.review-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.review-item-body { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.review-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.review-meta { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ============================================================
   封禁页
   ============================================================ */
.ban-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}
.ban-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #fff1f4;
  color: var(--danger);
  display: grid; place-items: center;
  margin: 0 auto 20px;
}
.ban-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 10px; }
.ban-reason {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 22px 0;
  text-align: left;
  box-shadow: var(--shadow);
}
.ban-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.ban-row:last-child { border-bottom: 0; }
.ban-row span { color: var(--muted); flex: none; }
.ban-row b { font-weight: 700; text-align: right; word-break: break-word; }
.countdown {
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--danger);
  margin: 8px 0 4px;
}

/* ============================================================
   折叠块（关于页用）
   ============================================================ */
details.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin: 14px 0;
  overflow: hidden;
}
details.fold > summary {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2);
  user-select: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: "＋";
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
  transition: transform .18s ease;
}
details.fold[open] > summary::after { content: "－"; }
details.fold > summary:hover { background: #fafbfc; }
details.fold .fold-body { padding: 4px 18px 18px; font-size: 14px; line-height: 1.75; color: var(--text-2); }
details.fold .fold-body ol, details.fold .fold-body ul { padding-left: 20px; }
details.fold .fold-body li { margin-bottom: 6px; }

/* ============================================================
   文档页（about / doc）
   ============================================================ */
.doc-page { max-width: 760px; margin: 0 auto; padding: 0 16px 100px; }
.doc-hero {
  padding: 48px 24px 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--brand-soft), transparent);
  border-radius: 0 0 24px 24px;
  margin-bottom: 26px;
}
.doc-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 0 0 10px; }
.doc-hero p { color: var(--text-2); font-size: 15px; margin: 0; }
.doc-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.doc-body h2 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; margin: 30px 0 12px; padding-left: 12px; border-left: 4px solid var(--brand); }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 15.5px; font-weight: 700; margin: 20px 0 8px; }
.doc-body p { font-size: 14.5px; line-height: 1.8; color: var(--text-2); margin: 0 0 12px; }
.doc-body ul, .doc-body ol { font-size: 14.5px; line-height: 1.8; color: var(--text-2); padding-left: 22px; }
.doc-body li { margin-bottom: 6px; }
.doc-body strong { color: var(--text); }

.toc {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 13.5px;
}
.toc b { display: block; margin-bottom: 8px; font-size: 13px; color: var(--text); }
.toc a { display: block; padding: 3px 0; color: var(--text-2); }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 26px; margin: 18px 0; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand);
}
.tl-item.done::before { background: var(--brand); }
.tl-item h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 700; }
.tl-item p { margin: 0; font-size: 13.5px; color: var(--text-2); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
  .app { grid-template-columns: 240px minmax(0, 1fr); }
  .col-right { display: none; }
  .fab-desktop { display: grid; right: 24px; }
}

@media (max-width: 900px) {
  body { font-size: 14.5px; }
  .app {
    display: block;
    padding: 0;
    max-width: 100%;
  }
  .col-left { display: none; }
  .col-main {
    border-left: 0; border-right: 0;
    min-height: auto;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  }
  .bottom-nav { display: block; }
  .fab-desktop { display: none; }
  .topbar-head { padding: 10px 14px 8px; }
  .topbar-title { font-size: 16.5px; }
  .post { padding: 12px 14px; gap: 10px; }
  .avatar { width: 38px; height: 38px; font-size: 15px; }
  .post-text { font-size: 14.5px; }
  .post-detail { padding: 14px 16px; }
  .post-detail .post-text { font-size: 16.5px; }
  .container-page { padding: 16px 12px 90px; }
  .page-card { padding: 18px 16px; border-radius: 14px; }
  h1.page-title { font-size: 21px; }
  .doc-hero { padding: 32px 18px 26px; }
  .doc-hero h1 { font-size: 23px; }
  .doc-body { padding: 20px 16px; }
  .comment { padding: 11px 14px; }
  .comment.reply { padding-left: 46px; }
  .tab { padding: 10px 11px; font-size: 13.5px; }
  .review-item { padding: 14px; }
  .media-grid.n3 { grid-template-columns: 1fr 1fr; }
  .media-grid.n3 > :first-child { grid-row: span 1; }
}

/* 移动端：隐藏桌面专用的东西 */
.only-mobile { display: none; }
@media (max-width: 900px) { .only-mobile { display: block; } .only-desktop { display: none !important; } }

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 打印 */
@media print {
  .col-left, .col-right, .bottom-nav, .post-actions, .topbar { display: none; }
}

/* 上传头像（render_avatar 走 <img> 时用） */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 称号与金色用户名 ---------- */
/* 有称号的人，用户名在整站都是金色（无 background-clip 支持时退成纯金棕，保证能看清） */
.nick-gold { color: #b07d0a; font-weight: 800; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .nick-gold {
    background-image: linear-gradient(100deg, #9a6b10 0%, #e2ab1f 26%, #f5cf57 48%, #c08a0f 72%, #8a5f0c 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* 称号小标签 */
.badge-title {
  background: linear-gradient(180deg, #fff9e8, #fdeecb);
  color: #8a6510;
  border: 1px solid #f0d59a;
}

/* ---------- 赞助者：银灰名字 + 「赞助者」小标签 ---------- */
/* 有称号的（比如冰块）保持金色，只加标签；没有称号的才转银灰 */
.nick-silver { color: #8b93a1; font-weight: 800; }

.nick-sup::after {
  content: "赞助者";
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: .2px;
  vertical-align: 1px;
  border-radius: 4px;
  color: #6b7280;
  background: linear-gradient(180deg, #f7f8fa, #e6e9ee);
  border: 1px solid #d6dbe3;
  -webkit-text-fill-color: #6b7280;   /* 金色用了 background-clip:text，这里要拉回来 */
  text-shadow: none;
  white-space: nowrap;
}

/* 「站长」这枚：金色实心，比普通称号显眼 */
.badge-owner {
  background: linear-gradient(135deg, #f7d97b 0%, #d3a02c 55%, #b8821a 100%);
  color: #fff;
  border: 1px solid #c89020;
  text-shadow: 0 1px 1px rgba(120, 80, 0, .35);
}

/* ---------- 左侧音乐小抽屉（电脑版） ---------- */
.fm-dock {
  position: fixed; left: 0; z-index: 70;
  display: flex; align-items: flex-start;
  transition: top .16s ease;
}
.fm-dock.is-dragging { transition: none; }

.fm-handle {
  width: 26px; height: 86px; flex: 0 0 26px;
  border: 1px solid #d5daea; border-left: 0;
  border-radius: 0 13px 13px 0;
  background: #fff; color: #6c7385;
  font: 700 16px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: grab;
  box-shadow: 3px 4px 16px rgba(15, 23, 42, .13);
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.fm-handle:hover { color: var(--brand); border-color: #c7cbe0; background: #fbfbff; }
.fm-dock.is-dragging .fm-handle { cursor: grabbing; }
.fm-dock.is-open .fm-handle { color: var(--brand); border-color: #c7cbe0; }

.fm-clip {
  width: 330px; height: 86px; overflow: hidden;
  pointer-events: none;
}
.fm-dock.is-open .fm-clip {
  pointer-events: auto;
  border-radius: 0 13px 13px 0;
  box-shadow: 6px 10px 30px rgba(15, 23, 42, .18);
}

.fm-panel {
  width: 330px; height: 86px;
  transform: translateX(-104%);
  transition: transform .28s cubic-bezier(.22, .61, .36, 1);
}
.fm-dock.is-open .fm-panel { transform: none; }
.fm-panel iframe { display: block; width: 330px; height: 86px; border: 0; background: #fff; }

/* 手机端：把手贴在右边，点开向左弹出播放器 */
@media (max-width: 900px) {
  .fm-dock { left: auto; right: 0; flex-direction: row-reverse; }
  .fm-handle {
    border: 1px solid #d5daea; border-right: 0;
    border-radius: 13px 0 0 13px;
    box-shadow: -3px 4px 16px rgba(15, 23, 42, .13);
  }
  .fm-clip { position: absolute; right: 26px; top: 0; width: min(330px, calc(100vw - 46px)); height: 86px; }
  .fm-dock.is-open .fm-clip { border-radius: 13px 0 0 13px; }
  .fm-panel { width: 100%; transform: translateX(106%); }
  .fm-panel iframe { width: 100%; }
}
@media print { .fm-dock { display: none; } }

/* ============================================================
   Markdown 正文（帖子）
   ============================================================ */
.md-body { font-size: 15px; line-height: 1.8; color: var(--text); word-wrap: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body .md-h { font-weight: 800; letter-spacing: -.3px; margin: 1.05em 0 .5em; line-height: 1.35; }
.md-body .md-h1 { font-size: 22px; border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.md-body .md-h2 { font-size: 19px; border-bottom: 1px solid var(--line); padding-bottom: .25em; }
.md-body .md-h3 { font-size: 17px; }
.md-body .md-h4, .md-body .md-h5, .md-body .md-h6 { font-size: 15.5px; }
.md-body .md-p { margin: .7em 0; }
.md-body .md-list { margin: .6em 0; padding-left: 1.35em; }
.md-body .md-list .md-list { margin: .25em 0; }
.md-body .md-li { margin: .22em 0; }
.md-body ul.md-list { list-style: disc; }
.md-body ol.md-list { list-style: decimal; }
.md-body .md-quote {
  margin: .8em 0; padding: .5em .9em;
  border-left: 3px solid #c7cdf0; background: #f7f8fe; color: var(--text-2);
  border-radius: 0 8px 8px 0;
}
.md-body .md-code {
  background: #f1f3f9; border: 1px solid #e6e9f2; border-radius: 5px;
  padding: 1px 5px; font-size: .9em; font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #be185d;
}
.md-body .md-pre {
  position: relative; margin: .85em 0; padding: 12px 14px; overflow: auto;
  background: #0f172a; color: #e8ecf7; border-radius: 10px;
  font-size: 13px; line-height: 1.65;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.md-body .md-pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.md-body .md-pre-lang {
  position: absolute; top: 0; right: 0; padding: 2px 8px;
  font-size: 11px; color: #94a3b8; background: rgba(255, 255, 255, .07);
  border-radius: 0 9px 0 9px; letter-spacing: .5px;
}
.md-body .md-hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md-body .md-img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: .7em 0; }
.md-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.md-body a:hover { color: #3730a3; }
.md-body .md-task { margin-right: 5px; vertical-align: -1px; }
.md-body .md-table-wrap { overflow-x: auto; margin: .85em 0; }
.md-body .md-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md-body .md-table th, .md-body .md-table td {
  border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top;
}
.md-body .md-table th { background: #f6f7fb; font-weight: 700; }
.md-body .md-table tr:nth-child(even) td { background: #fafbfe; }

/* 列表页里的 Markdown：限高 + 底部渐隐，点进帖子看全文 */
.md-clamp {
  max-height: 340px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}

/* ============================================================
   发帖页：纯文本 / Markdown 切换
   ============================================================ */
.compose-fmt { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #f2f4fa; border-radius: 999px; padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--text-2); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.seg input:checked + label { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.fmt-help { border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--brand); cursor: pointer; font-family: inherit; }
.fmt-help:hover { text-decoration: underline; }
.fmt-help-box {
  margin: 0 16px 12px; padding: 12px 14px; background: #f7f8fe;
  border: 1px solid #e3e7f6; border-radius: 12px; font-size: 13px; color: var(--text-2);
}
.fmt-help-box pre {
  margin: 8px 0; padding: 10px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; overflow-x: auto; font-size: 12.5px; line-height: 1.7;
  font-family: ui-monospace, Menlo, Consolas, monospace; color: #334155;
}

/* ============================================================
   发帖页：嵌入网页
   ============================================================ */
.embed-box { margin: 0 16px 14px; border: 1px dashed #cdd5ee; border-radius: 12px; background: #fbfcff; }
.embed-box > summary {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; list-style: none;
}
.embed-box > summary::-webkit-details-marker { display: none; }
.embed-box[open] > summary { border-bottom: 1px dashed #dde3f4; }
.embed-tag {
  margin-left: auto; font-size: 11px; font-weight: 700; color: #b45309;
  background: #fef3c7; padding: 2px 8px; border-radius: 999px;
}
.embed-box-body { padding: 12px 14px 14px; }
.embed-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* ============================================================
   帖子里的嵌入卡片
   ============================================================ */
.embed-card {
  margin: 12px 0 2px; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: #fff; box-shadow: 0 2px 10px -6px rgba(15, 23, 42, .18);
}
.embed-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #f6f7fb; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.embed-dot { width: 8px; height: 8px; border-radius: 50%; background: #4f46e5; flex: none; }
.embed-host { font-weight: 700; color: var(--text-2); }
.embed-title { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-open { margin-left: auto; color: var(--brand); font-size: 12px; flex: none; }
.embed-open:hover { text-decoration: underline; }
.embed-frame { display: block; width: 100%; border: 0; background: #f8fafc; }

.embed-card-mini {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  text-decoration: none; color: inherit;
}
.embed-card-mini:hover { background: #fafbff; }
.embed-fav {
  width: 30px; height: 30px; flex: none; border-radius: 9px; background: #eef0ff; color: #4338ca;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; text-transform: uppercase;
}
.embed-mini-txt { display: flex; flex-direction: column; min-width: 0; }
.embed-mini-txt b { font-size: 13.5px; }
.embed-mini-txt span { font-size: 12px; color: var(--muted); }

.embed-note {
  margin: 12px 0 2px; padding: 10px 12px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.75;
}
.embed-note-wait { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.embed-note-no { background: #fff1f4; border: 1px solid #fecdd3; color: #9f1239; }
.embed-note-url { word-break: break-all; color: var(--muted); font-size: 11.5px; }

/* 审核台：嵌入网页条目 */
.embed-review { margin: 10px 0; padding: 10px 12px; background: #f8f9fd; border-radius: 12px; }
.embed-review-line { display: flex; align-items: center; gap: 10px; }
.embed-h-badge {
  flex: none; font-size: 11px; font-weight: 700; color: var(--text-2);
  background: #e9edf9; padding: 3px 8px; border-radius: 999px;
}
