/* ==========================================================================
   WallTHU 校园墙 —— 全局样式
   ========================================================================== */
:root {
  /* 清华紫配色：主色取自校徽/校名，背景统一为淡紫 */
  --bg: #f4ecf7;
  --bg-soft: #ece0f1;
  --card: #fffdfe;
  --card-2: #faf3fc;
  --text: #241a29;
  --text-2: #57465f;
  --muted: #8b7a96;
  --line: #e9dcef;
  --line-strong: #d9c6e2;
  --brand: #7a2f86;
  --brand-2: #a855b5;
  --brand-soft: #f7ecfa;
  --accent: #5a2a86;
  --green: #0f9d72;
  --blue: #3b6fd4;
  --orange: #c47a09;
  --danger: #d63a63;
  --glow-1: rgba(153, 71, 121, .16);
  --glow-2: rgba(90, 42, 134, .11);
  --shadow-sm: 0 1px 2px rgba(52, 22, 60, .06);
  --shadow-md: 0 10px 30px -18px rgba(52, 22, 60, .38);
  --shadow-lg: 0 24px 60px -24px rgba(52, 22, 60, .34);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC",
    "Source Han Sans SC", sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #130e17;
  --bg-soft: #1b1322;
  --card: #1d1424;
  --card-2: #24182c;
  --text: #f1e8f5;
  --text-2: #cfbcd8;
  --muted: #9d88a9;
  --line: #31233a;
  --line-strong: #432f4f;
  --brand: #c77ad4;
  --brand-2: #e2a4ea;
  --brand-soft: #2c1a34;
  --accent: #b79bf0;
  --green: #34d399;
  --blue: #82aef8;
  --orange: #fbbf24;
  --danger: #ff6b8a;
  --glow-1: rgba(199, 122, 212, .10);
  --glow-2: rgba(120, 70, 180, .13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .42);
  --shadow-md: 0 12px 36px -20px rgba(0, 0, 0, .78);
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, .82);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* 确保 hidden 属性始终生效（会被 .login-wrap/.load-more 等 display 规则覆盖） */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 540px at 6% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 480px at 104% -2%, var(--glow-2), transparent 58%),
    radial-gradient(760px 420px at 50% 108%, var(--glow-2), transparent 62%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
::selection { background: rgba(122, 47, 134, .22); }

.container { width: min(760px, 100% - 28px); margin: 0 auto; }
.container-wide { width: min(1120px, 100% - 28px); margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------- 顶栏 ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--card) 84%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(1080px, 100% - 24px); margin: 0 auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
/* 校名文字 + 校徽 */
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-school { display: flex; align-items: center; padding: 3px 0; }
.brand-school img { height: 24px; width: auto; display: block; }
.brand-school:hover img { opacity: .78; }
.brand-logo { display: grid; place-items: center; }
.brand-logo img { width: 37px; height: 37px; display: block; }
.brand-wall {
  font-size: 11px; letter-spacing: .18em; color: var(--muted);
  white-space: nowrap; padding-left: 1px;
}
[data-theme="dark"] .brand-logo img { filter: brightness(1.45); }
[data-theme="dark"] .brand-school img { filter: brightness(1.45); }

/* 管理后台 logo */
.logo { display: flex; align-items: center; gap: 9px; flex: none; }
.logo-img { width: 32px; height: 32px; display: block; }
[data-theme="dark"] .logo-img { filter: brightness(1.45); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text b { font-size: 15.5px; letter-spacing: .2px; }
.logo-text small { font-size: 10.5px; color: var(--muted); letter-spacing: 1.5px; }

.header-search {
  flex: 1; max-width: 380px; position: relative;
  display: flex; align-items: center;
}
.header-search input {
  width: 100%; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft);
  padding: 0 40px 0 15px; outline: none; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: var(--card);
}
.header-search button {
  position: absolute; right: 5px; width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); display: grid; place-items: center;
}
.header-search button:hover { color: var(--brand); background: var(--bg-soft); }
.header-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.header-nav a {
  padding: 7px 10px; border-radius: 9px; font-size: 13.5px;
  color: var(--text-2); white-space: nowrap;
}
.header-nav a:hover { background: var(--bg-soft); color: var(--text); }
.header-nav a.active { color: var(--brand); font-weight: 600; }
.icon-btn {
  border: 0; background: transparent; width: 36px; height: 36px;
  border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); font-size: 17px;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.chat-entry {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line));
  background: var(--brand-soft); color: var(--brand);
  font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px;
  white-space: nowrap; transition: all .16s;
}
.chat-entry:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.chat-icon { display: none; font-size: 13px; line-height: 1; }
.chat-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.chat-entry:hover .chat-dot { box-shadow: 0 0 0 2px var(--brand); }

/* ---------------------------------- 页头 ---------------------------------- */
.page-head { padding: 26px 0 6px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------------------------------- 首屏 ---------------------------------- */
.hero {
  margin: 20px 0 6px; padding: 20px 22px; border-radius: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background:
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    linear-gradient(120deg, color-mix(in srgb, var(--brand) 9%, var(--card)), var(--card) 70%);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
}
.hero h1 { margin: 0 0 5px; font-size: 19px; letter-spacing: -.4px; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .3px; }
.hero-link {
  flex: none; font-size: 13px; font-weight: 600; color: var(--brand);
  background: var(--card); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  padding: 8px 13px; border-radius: 11px; transition: all .16s;
}
.hero-link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.filter-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: 13px; color: var(--muted);
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px; color: var(--text-2);
}
.filter-chip button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; line-height: 1; padding: 0;
}
.filter-chip button:hover { color: var(--danger); }
.pinned-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--brand);
  margin: 4px 0 9px; letter-spacing: .2px;
}
.pinned-head span { font-weight: 400; color: var(--muted); }
#pinned-section { margin-bottom: 14px; }
#pinned-section .feed { gap: 10px; }

/* --------------------------------- 分类导航 -------------------------------- */
.cat-bar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cat-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 11px 0;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; border: 1px solid var(--line); background: var(--card);
  color: var(--text-2); padding: 7px 14px; border-radius: 999px;
  font-size: 13.5px; transition: all .16s ease; white-space: nowrap;
}
.cat-chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.cat-chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent; font-weight: 600;
  box-shadow: 0 6px 16px -8px rgba(122, 47, 134, .8);
}

/* --------------------------------- 排序栏 --------------------------------- */
.feed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 0 12px;
}
.sort-tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 12px; }
.sort-tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 13px; border-radius: 9px; font-size: 13.5px; transition: all .16s;
}
.sort-tab:hover { color: var(--text); }
.sort-tab.active {
  background: var(--card); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.feed-count { font-size: 12.5px; color: var(--muted); }

/* --------------------------------- 帖子卡片 -------------------------------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  animation: card-in .32s ease both;
}
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
.post-card.is-pinned {
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, var(--card)), var(--card) 90px);
}
.post-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2);
}
.badge-pinned {
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  color: var(--brand);
}
.badge-anon { background: var(--bg-soft); color: var(--muted); font-weight: 500; }
.badge-named { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.badge-uid {
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.post-time { margin-left: auto; font-size: 12.5px; color: var(--muted); }

[data-cat="表白捞人"] { --cat: #ec4899; }
[data-cat="失物招领"] { --cat: #3b82f6; }
[data-cat="闲置交易"] { --cat: #10b981; }
[data-cat="求助问答"] { --cat: #8b5cf6; }
[data-cat="树洞吐槽"] { --cat: #64748b; }
[data-cat="绘画分享"] { --cat: #f43f5e; }
[data-cat="音乐交流"] { --cat: #06b6d4; }
[data-cat="活动通知"] { --cat: #f59e0b; }
.badge-cat {
  background: color-mix(in srgb, var(--cat, var(--brand)) 13%, transparent);
  color: var(--cat, var(--brand));
}

.post-content {
  font-size: 15.5px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card.is-detail .post-content { -webkit-line-clamp: unset; display: block; }
.post-content a { color: var(--accent); text-decoration: underline; }

.post-images {
  display: grid; gap: 6px; margin-top: 12px;
  grid-template-columns: repeat(3, 1fr);
}
.post-images.n1 { grid-template-columns: 1fr; }
.post-images.n2 { grid-template-columns: repeat(2, 1fr); }
.post-images.n2 .img-cell { aspect-ratio: 4 / 3; }
.img-cell {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 1 / 1; background: var(--bg-soft); cursor: zoom-in;
}
.post-images.n1 .img-cell { aspect-ratio: 16 / 10; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.img-cell:hover img { transform: scale(1.03); }
.img-more {
  position: absolute; inset: 0; background: rgba(10, 12, 18, .5);
  color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700;
}

.post-footer {
  display: flex; align-items: center; gap: 4px;
  margin-top: 14px; padding-top: 11px; border-top: 1px dashed var(--line);
}
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 10px; border-radius: 9px; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.action-btn:hover { background: var(--bg-soft); color: var(--text); }
.action-btn.liked { color: var(--brand); }
.action-btn.liked .heart { transform: scale(1.15); }
.action-btn .heart { transition: transform .18s; display: inline-block; }
.action-btn.report { margin-left: auto; font-size: 12.5px; opacity: .75; }
.action-btn.report:hover { color: var(--danger); opacity: 1; }
.action-btn.danger { font-size: 12.5px; opacity: .8; }
.action-btn.danger:hover { color: var(--danger); opacity: 1; background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* 空状态 / 骨架 */
.empty-state {
  text-align: center; padding: 64px 20px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty-state .emoji { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-state b { display: block; color: var(--text-2); margin-bottom: 4px; }
.skeleton {
  height: 148px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card) 30%, var(--bg-soft) 50%, var(--card) 70%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.load-more {
  display: block; width: 100%; margin: 18px 0 8px;
  padding: 13px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text-2); font-size: 14px;
  transition: all .16s;
}
.load-more:hover { border-color: var(--line-strong); background: var(--card-2); }
.load-more:disabled { opacity: .6; cursor: default; }

/* --------------------------------- 悬浮按钮 -------------------------------- */
.fab {
  position: fixed; right: max(18px, calc((100vw - 800px) / 2 + 10px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 55; border: 0; border-radius: 999px;
  padding: 14px 22px; display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 14px 30px -10px rgba(122, 47, 134, .62), 0 2px 6px rgba(0, 0, 0, .1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.fab:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 38px -12px rgba(122, 47, 134, .68); }
.fab:active { transform: scale(.98); }
.fab .plus { font-size: 20px; line-height: 1; margin-top: -2px; }

/* ---------------------------------- 弹层 ---------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(12, 15, 22, .48); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: min(88vh, 860px);
  overflow-y: auto; background: var(--card); border-radius: 22px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: modal-in .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.modal-close {
  border: 0; background: var(--bg-soft); color: var(--text-2);
  width: 32px; height: 32px; border-radius: 50%; font-size: 16px;
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--line); color: var(--text); }
.modal-body { padding: 6px 20px 22px; }

/* ---------------------------------- 表单 ---------------------------------- */
.field { margin-bottom: 16px; }
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px;
}
.field-label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--card-2);
  border-radius: 12px; padding: 11px 13px; outline: none; font-size: 14.5px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line-strong));
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.textarea { resize: vertical; min-height: 128px; line-height: 1.7; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 5px; }
.counter.over { color: var(--danger); font-weight: 600; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line);
}
.switch-row .switch-text { display: flex; flex-direction: column; gap: 1px; }
.switch-row .switch-text b { font-size: 13.5px; }
.switch-row .switch-text span { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line-strong); transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 上传 */
.upload-zone {
  border: 1.5px dashed var(--line-strong); border-radius: 14px;
  padding: 20px 16px; text-align: center; color: var(--muted);
  background: var(--card-2); cursor: pointer; transition: all .16s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--brand); color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--card-2));
}
.upload-zone b { color: var(--text-2); font-size: 13.5px; display: block; }
.upload-zone span { font-size: 12px; }
.upload-zone.dragover b { color: var(--brand); }
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 9px; }
.preview-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6);
  color: #fff; font-size: 11px; line-height: 1; display: grid; place-items: center;
}
.post-audios { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.audio-player { width: 100%; max-width: 420px; height: 38px; display: block; }
.audio-preview-list { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.audio-preview-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px; background: var(--bg-soft);
}
.audio-preview-item audio { flex: 1; min-width: 0; height: 34px; }
.audio-preview-name {
  font-size: 12px; color: var(--muted); max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.audio-preview-item button {
  width: 20px; height: 20px; border: 0; border-radius: 50%; flex-shrink: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; line-height: 1;
  display: grid; place-items: center;
}
.post-zips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.zip-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 999px; padding: 6px 12px; text-decoration: none;
  max-width: 100%; overflow: hidden;
}
.zip-chip:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.zip-preview-list { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.zip-preview-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px; background: var(--bg-soft);
}
.zip-preview-icon { flex-shrink: 0; }
.zip-preview-name {
  font-size: 12px; color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zip-preview-item button {
  width: 20px; height: 20px; border: 0; border-radius: 50%; flex-shrink: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; line-height: 1;
  display: grid; place-items: center;
}

.captcha-row { display: flex; gap: 9px; align-items: stretch; }
.captcha-row .input { flex: 1; min-width: 0; }
.captcha-img {
  height: 46px; width: 130px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); flex: none;
}
.captcha-img:hover { opacity: .85; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--card);
  color: var(--text); border-radius: 12px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; transition: all .16s;
}
.btn:hover { background: var(--card-2); border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px -10px rgba(122, 47, 134, .75);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  filter: brightness(1.06); transform: translateY(-1px);
}
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 13%, var(--card)); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.notice {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
  background: var(--bg-soft); border-radius: 10px; padding: 9px 11px;
}
.notice.warn { background: color-mix(in srgb, var(--orange) 11%, transparent); color: color-mix(in srgb, var(--orange) 72%, var(--text)); }
.notice.brand { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 75%, var(--text)); }

/* --------------------------------- 详情页 --------------------------------- */
.detail-wrap { padding: 18px 0 50px; }
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 13.5px; margin-bottom: 12px;
}
.back-link:hover { color: var(--brand); }
.detail-card { padding: 22px 22px 16px; }
.detail-card .post-content { font-size: 16.5px; line-height: 1.85; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.detail-actions { display: flex; align-items: center; gap: 6px; margin-top: 16px; padding-top: 13px; border-top: 1px dashed var(--line); }

.disclaimer {
  margin-top: 18px; padding: 10px 13px; border-radius: 10px;
  background: var(--bg-soft); color: var(--muted); font-size: 12px; line-height: 1.65;
}
.disclaimer + .disclaimer { margin-top: 8px; }

.comments-section { margin-top: 26px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px; font-size: 16px; letter-spacing: -.2px;
}
.section-title .count { color: var(--muted); font-size: 13px; font-weight: 400; }
.comment-form-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.comment-form-card .textarea { min-height: 84px; }
.comment-form-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.comment-form-foot .captcha-row { flex: 1; min-width: 210px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px;
}
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-head .name { font-size: 13px; font-weight: 600; color: var(--text-2); }
.comment-head .time { margin-left: auto; font-size: 12px; color: var(--muted); }
.comment-content { font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.comment-report {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; padding: 3px 0 0; opacity: .7;
}
.comment-report:hover { color: var(--danger); opacity: 1; }
.comment-actions { display: flex; gap: 14px; margin-top: 7px; }
.comment-reply {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; padding: 3px 0 0; opacity: .7;
}
.comment-reply:hover { color: var(--brand); opacity: 1; }
.comment-dm {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; padding: 3px 0 0; opacity: .7;
}
.comment-dm:hover { color: var(--accent); opacity: 1; }
.comment-delete {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; padding: 3px 0 0; opacity: .7;
}
.comment-delete:hover { color: var(--danger); opacity: 1; }
.comment-like {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; padding: 3px 0 0; opacity: .7;
  display: inline-flex; align-items: center; gap: 4px;
}
.comment-like:hover { color: var(--brand); opacity: 1; }
.comment-like.liked { color: var(--brand); opacity: 1; }
.badge-mine {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand); font-size: 10.5px; padding: 2px 7px;
}
.replies {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 9px; padding-left: 14px;
  border-left: 2px solid var(--line);
}
.reply-item {
  background: var(--bg-soft); border-radius: 10px; padding: 9px 11px;
}
.reply-item .comment-content { font-size: 13.5px; }
.reply-mention {
  color: var(--blue); font-size: 12.5px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border-radius: 6px; padding: 1px 6px; margin-right: 4px;
}
.reply-mention b { font-weight: 600; }
.reply-slot { margin-top: 8px; }
.reply-form {
  background: var(--bg-soft); border-radius: 10px; padding: 9px 11px;
}
.reply-form .textarea { min-height: 54px; font-size: 13.5px; }
.reply-form-bar {
  display: flex; align-items: center; gap: 10px; margin-top: 7px;
}
.reply-identity { font-size: 12px; color: var(--muted); flex: 1; }

/* 「我的」页 */
.me-stats { margin: 18px 0 0; }
.me-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px 15px; margin-bottom: 10px;
}
.me-item .comment-content { font-size: 14.5px; line-height: 1.7; word-break: break-word; }
.me-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12.5px; color: var(--muted);
}
.me-meta a { color: var(--brand); }
.me-reply-to {
  margin-top: 6px; font-size: 12.5px; color: var(--muted);
  background: var(--bg-soft); border-radius: 8px; padding: 6px 9px;
  white-space: pre-wrap; word-break: break-word;
}

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px;
}
.post-nav a, .post-nav span {
  display: flex; flex-direction: column; gap: 2px;
  padding: 13px 15px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--card); font-size: 13.5px; color: var(--text-2);
  transition: all .16s;
}
.post-nav a:hover { border-color: var(--brand); color: var(--brand); }
.post-nav span { opacity: .45; }
.post-nav .dir { font-size: 11.5px; color: var(--muted); }
.post-nav .next { text-align: right; }
.to-top {
  position: fixed; right: 22px; bottom: 96px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  box-shadow: var(--shadow-md); display: none; place-items: center; font-size: 17px;
}
.to-top.show { display: grid; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }

/* ---------------------------------- 画廊 ---------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8, 10, 14, .92); align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; animation: fade-in .15s; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 18px; right: 20px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 20px;
}
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .8); font-size: 13px;
}

/* ---------------------------------- 私信 ---------------------------------- */
.chat-modal { width: min(540px, 100%); }
.chat-body { display: flex; flex-direction: column; gap: 11px; }
.chat-list {
  height: min(52vh, 430px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 13px; border-radius: 14px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.chat-empty {
  margin: auto; text-align: center; color: var(--muted);
  font-size: 13px; line-height: 1.9;
}
.chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 84%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.chat-who { font-size: 11px; color: var(--muted); padding-left: 5px; }
.chat-bubble {
  padding: 9px 13px; border-radius: 15px; font-size: 14px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  background: var(--card); border: 1px solid var(--line);
}
.chat-msg.mine .chat-bubble {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff; border-bottom-right-radius: 5px;
}
.chat-msg.theirs .chat-bubble { border-bottom-left-radius: 5px; }
.chat-time { font-size: 10.5px; color: var(--muted); padding: 0 5px; }
.chat-form { display: flex; gap: 9px; align-items: flex-end; }
.chat-form .textarea { min-height: 58px; max-height: 140px; flex: 1; }
.admin-chat-list { height: min(50vh, 400px); }

/* ---------------------------------- Toast --------------------------------- */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  background: var(--text); color: var(--card);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: toast-in .22s ease;
  max-width: 92vw; text-align: center;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: #0f9d6e; color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* --------------------------------- 静态页 --------------------------------- */
.static-page { padding: 12px 0 70px; }
.static-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 30px;
  box-shadow: var(--shadow-sm);
}
.static-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.4px; }
.static-card .lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.static-card h2 {
  margin: 26px 0 10px; font-size: 17px; letter-spacing: -.2px;
  padding-left: 11px; border-left: 3px solid var(--brand); line-height: 1.3;
}
.static-card h3 { margin: 18px 0 6px; font-size: 14.5px; }
.static-card p, .static-card li { font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.static-card ul, .static-card ol { padding-left: 22px; margin: 8px 0; }
.static-card li { margin: 3px 0; }
.static-card code {
  background: var(--bg-soft); padding: 1px 6px; border-radius: 6px;
  font-size: 13px; font-family: ui-monospace, monospace;
}
.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.rule-box {
  border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px;
  background: var(--card-2);
}
.rule-box b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.rule-box span { font-size: 13px; color: var(--muted); line-height: 1.65; }
.rule-box.bad b { color: var(--danger); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.tag-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 15px; font-size: 14px;
  transition: all .16s;
}
.tag-pill:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.tag-pill small { color: var(--muted); font-size: 11.5px; }

/* ---------------------------------- 页脚 ---------------------------------- */
.site-footer {
  margin-top: 46px; padding: 26px 0 34px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--brand); }
.footer-note { line-height: 1.7; max-width: 560px; }

/* ---------------------------------- 管理端 -------------------------------- */
.admin-body { background: var(--bg); }
.admin-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.admin-header-inner {
  width: min(1180px, 100% - 28px); margin: 0 auto; height: 60px;
  display: flex; align-items: center; gap: 12px;
}
.admin-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  background: var(--text); color: var(--card); padding: 3px 8px; border-radius: 6px;
}
.admin-header .spacer { flex: 1; }
.admin-main { padding: 24px 0 60px; }
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 15px; padding: 15px 17px; box-shadow: var(--shadow-sm);
}
.stat-card .label { font-size: 12.5px; color: var(--muted); }
.stat-card .value { font-size: 25px; font-weight: 750; letter-spacing: -.6px; margin-top: 2px; }
.stat-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.stat-card.hot { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.stat-card.hot .value { color: var(--brand); }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px;
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 14px; font-size: 13.5px; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tab .pill {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 5px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 10.5px; line-height: 17px; text-align: center; vertical-align: 1px;
}

.admin-toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-toolbar .input { flex: 1; min-width: 180px; max-width: 340px; }
.admin-toolbar .select { width: auto; min-width: 130px; }

.admin-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 15px; padding: 15px 17px; margin-bottom: 11px;
  box-shadow: var(--shadow-sm);
}
.admin-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.admin-item-head .time { margin-left: auto; color: var(--muted); font-size: 12px; }
.admin-item .content {
  font-size: 14px; line-height: 1.7; white-space: pre-wrap;
  word-break: break-word; color: var(--text);
}
.admin-item .content.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.admin-item .meta-line {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted); margin-top: 7px;
}
.admin-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.admin-thumbs img { width: 66px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.admin-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.admin-actions .spacer { flex: 1; }
.reject-reason {
  margin-top: 9px; padding: 8px 11px; border-radius: 9px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger); font-size: 12.5px;
}
.admin-empty { padding: 50px 20px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: 15px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(380px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 30px 28px; box-shadow: var(--shadow-lg);
}
.login-card .logo { justify-content: center; margin-bottom: 18px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 4px; }
.login-card p { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 12px 2px 0; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%; max-width: 42px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 45%, var(--bg)));
  min-height: 3px; transition: height .4s ease;
}
.chart .bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart .bar-num { font-size: 10.5px; color: var(--text-2); font-weight: 600; }
.admin-section-title { font-size: 15px; margin: 28px 0 12px; display: flex; align-items: center; justify-content: space-between; }

/* ---------------------------------- 响应式 -------------------------------- */
@media (max-width: 1000px) {
  .brand-wall { display: none; }
}

@media (max-width: 760px) {
  .header-inner { width: calc(100% - 20px); gap: 10px; }
  .admin-header-inner { gap: 8px; }
  .admin-tag { display: none; }
  .admin-header .logo-text { display: none; }
  .admin-header .btn { padding: 6px 9px; font-size: 12px; }
  .logo-text small { display: none; }
  .header-nav a { display: none; }
  .header-search { max-width: none; }
  .brand { gap: 7px; }
  .brand-school img { height: 21px; }
  .brand-logo img { width: 33px; height: 33px; }
  .chat-entry { padding: 6px 9px; font-size: 12px; }
  .chat-list { height: 46vh; }
  .cat-bar { top: var(--header-h); }
  .feed-toolbar { padding: 13px 0 10px; }
  .post-card { padding: 15px 15px 12px; border-radius: 16px; }
  .detail-card { padding: 17px 16px 14px; }
  .detail-card .post-content { font-size: 16px; }
  .static-card { padding: 22px 18px; }
  .rule-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .fab { right: 18px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); padding: 13px 19px; }
  .to-top { right: 18px; bottom: 88px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0;
    border-bottom: 0; animation: sheet-in .25s cubic-bezier(.2, .8, .3, 1);
  }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: .5; } }
  .modal-body { padding-bottom: max(26px, env(safe-area-inset-bottom, 0px)); }
  .preview-grid { grid-template-columns: repeat(4, 1fr); }
  .admin-actions .btn { flex: 1; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .brand-school img { height: 19px; }
  .brand { gap: 6px; }
  .brand-logo img { width: 30px; height: 30px; }
  .chat-entry { padding: 6px 8px; }
  .chat-entry .chat-label { display: none; }
  .chat-entry .chat-icon { display: inline; }
  .header-search input { padding-left: 10px; }
  .header-search input::placeholder { font-size: 12px; }
  .login-entry { padding: 6px 9px; font-size: 12px; }
  .user-chip { max-width: 108px; padding-left: 8px; }
  .user-chip .user-name { max-width: 52px; }
}

@media (max-width: 420px) {
  body { font-size: 14.5px; }
  .post-images { gap: 5px; }
  .action-btn { padding: 7px 8px; font-size: 13px; }
  .action-btn.report { font-size: 12px; }
  .logo-text b { font-size: 14.5px; }
}

/* ------------------------------- 用户登录态 ------------------------------- */
.auth-area { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.login-entry {
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line));
  background: var(--brand-soft); color: var(--brand);
  font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px;
  white-space: nowrap; transition: all .16s;
}
.login-entry:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  padding: 3px 5px 3px 11px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card); white-space: nowrap;
  max-width: 168px;
}
.user-chip .user-name { overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.user-chip .user-id { color: var(--muted); font-weight: 500; font-size: 11px; max-width: 64px;
  overflow: hidden; text-overflow: ellipsis; }
.user-chip .logout-btn {
  border: 0; background: var(--bg-soft); color: var(--muted);
  font-size: 12px; padding: 3px 9px; border-radius: 999px; transition: all .15s;
}
.user-chip .logout-btn:hover { background: var(--danger); color: #fff; }

/* ------------------------------- 登录 / 注册 ------------------------------- */
.auth-modal { width: min(400px, 100%); }
.auth-tabs { display: flex; gap: 4px; padding: 0 20px 12px; }
.auth-tab {
  flex: 1; border: 0; background: var(--bg-soft); color: var(--muted);
  padding: 8px 0; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  transition: all .16s;
}
.auth-tab.active { background: var(--brand); color: #fff; }
.auth-pane .field:first-child { margin-top: 4px; }

/* ------------------------------- 用户间私信 ------------------------------- */
/* 私信面板：固定在网页右侧的抽屉，参考电脑版抖音侧边布局 */
.dm-backdrop {
  position: fixed; inset: 0; z-index: 99; background: rgba(0, 0, 0, .32);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.dm-backdrop.open { opacity: 1; pointer-events: auto; }
.dm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(400px, 92vw);
  background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(0, 0, 0, .16);
  transform: translateX(100%); transition: transform .24s ease;
  display: flex; flex-direction: column;
}
.dm-drawer.open { transform: translateX(0); }
.dm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line); flex: none;
}
.dm-head h2 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.dm-close {
  border: 0; background: var(--bg-soft); color: var(--text-2);
  width: 30px; height: 30px; border-radius: 9px; font-size: 15px; flex: none;
  transition: all .15s;
}
.dm-close:hover { background: var(--line); color: var(--text); }
.dm-drawer .dm-body {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px; gap: 10px;
}
.dm-drawer .dm-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.dm-drawer .dm-conv-list { max-height: none; flex: 1; min-height: 0; }
.dm-drawer .dm-peer { flex: 1; min-width: 0; }
.dm-drawer #dm-chat-view .chat-list { height: auto; flex: 1; min-height: 0; }
.dm-block-btn {
  border: 0; background: var(--bg-soft); color: var(--danger);
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; flex: none;
  transition: all .15s;
}
.dm-block-btn:hover { background: var(--danger); color: #fff; }
.dm-block-notice {
  font-size: 12.5px; color: var(--text-2); background: var(--bg-soft);
  border-radius: 10px; padding: 9px 12px;
}
.dm-modal { width: min(480px, 100%); }
.dm-body { display: flex; flex-direction: column; }
.dm-view { display: flex; flex-direction: column; gap: 10px; }
.dm-search .input { width: 100%; }
.dm-search-results {
  display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
}
.dm-search-item {
  border: 0; background: transparent; text-align: left; padding: 8px 11px;
  border-radius: 8px; font-size: 14px; color: var(--text); transition: background .12s;
}
.dm-search-item:hover { background: var(--bg-soft); }
.dm-search-empty { font-size: 13px; color: var(--muted); padding: 8px 11px; }
.dm-conv-list {
  display: flex; flex-direction: column; gap: 6px; max-height: 48vh; overflow-y: auto;
}
.dm-conv {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 11px 13px; text-align: left; transition: all .15s;
}
.dm-conv:hover { border-color: var(--line-strong); background: var(--card-2); }
.dm-conv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dm-conv-name { font-weight: 600; font-size: 14px; color: var(--text); }
.dm-conv-preview {
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.dm-conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.dm-conv-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dm-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.dm-chat-head { display: flex; align-items: center; gap: 9px; }
.dm-back {
  border: 0; background: var(--bg-soft); color: var(--text-2);
  width: 30px; height: 30px; border-radius: 9px; font-size: 15px; flex: none;
  transition: all .15s;
}
.dm-back:hover { background: var(--brand); color: #fff; }
.dm-peer { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dm-chat-view .chat-list { height: min(46vh, 360px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
