/* ============ 基础重置 ============ */
[hidden] { display: none !important; }

/* ============ 主题变量 ============ */
/* 默认：夜间（黑色）主题 */
:root {
  --bg: #0a0b10;
  --bg-soft: #0e1017;
  --elev: #13151d;
  --elev-2: #171a23;
  --text: #eceef5;
  --text-2: #b9c0d2;
  --muted: #7b839a;
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .16);
  --brand: #e6c07b;
  --brand-2: #f7e3b6;
  --brand-soft: rgba(230, 192, 123, .14);
  --danger: #ff7b7b;
  --ok: #4fd6a3;
  --gold: #e6c07b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-bg: rgba(16, 18, 26, .82);
  --nav-h: 62px;
}

[data-theme="dark"] {
  --nav-bg: rgba(16, 18, 26, .82);
}

/* 可选：白天主题 */
[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-soft: #eff1f7;
  --elev: #ffffff;
  --elev-2: #fbfcfe;
  --text: #1a1e2b;
  --text-2: #4b5266;
  --muted: #8b92a6;
  --line: #e7eaf3;
  --line-strong: #d8dded;
  --brand: #5b7cfa;
  --brand-2: #8b6cf6;
  --brand-soft: rgba(91, 124, 250, .1);
  --danger: #e0575b;
  --ok: #22b07d;
  --gold: #d99a2b;
  --shadow-sm: 0 2px 8px rgba(23, 32, 66, .05);
  --shadow: 0 8px 28px rgba(23, 32, 66, .08);
  --shadow-lg: 0 18px 50px rgba(23, 32, 66, .14);
  --nav-bg: rgba(255, 255, 255, .84);
}
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

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

::selection { background: var(--brand-soft); }

/* ============ 顶部导航 ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(91, 124, 250, .3);
}

.brand-mark svg { width: 16px; height: 16px; }

.search {
  flex: 1;
  max-width: 340px;
  position: relative;
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 34px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.search input:focus {
  border-color: var(--brand);
  background: var(--elev);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  opacity: .5;
  pointer-events: none;
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

.dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  font-weight: 700;
  display: none;
}
.dot.show { display: block; }

/* ============ 按钮 ============ */
.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-soft);
  color: var(--text-2);
  transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(91, 124, 250, .28);
}
.btn.primary:hover { box-shadow: 0 10px 26px rgba(91, 124, 250, .36); }
.btn.ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); background: transparent; border: 1px solid transparent; }
.btn.danger:hover { background: rgba(224, 87, 91, .1); }

.link-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.link-btn:hover { color: var(--brand); background: var(--brand-soft); }
.link-btn.danger:hover { color: var(--danger); background: rgba(224, 87, 91, .1); }

/* ============ 布局 ============ */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--elev);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* ============ 发帖框 ============ */
.composer { padding: 16px 18px 14px; margin-bottom: 18px; }

.composer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.composer-head .who {
  font-size: 13.5px;
  color: var(--muted);
}
.composer-head .who strong { color: var(--text); font-weight: 600; }

.composer textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.composer textarea:focus {
  border-color: var(--brand);
  background: var(--elev);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  gap: 10px;
  flex-wrap: wrap;
}

.composer-foot .left { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }

#guestName {
  width: 150px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
#guestName:focus { border-color: var(--brand); background: var(--elev); }

/* ============ 列表工具条 ============ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}
.tabs { display: flex; gap: 4px; }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.tab:hover { color: var(--text); background: var(--bg-soft); }
.tab.active { color: var(--brand); background: var(--brand-soft); }
.toolbar .count { font-size: 12.5px; color: var(--muted); }

/* ============ 留言卡片 ============ */
.list { display: flex; flex-direction: column; gap: 14px; }

.msg {
  padding: 16px 18px;
  transition: transform .16s, box-shadow .2s, border-color .2s;
  animation: rise .32s cubic-bezier(.2, .7, .3, 1) both;
}
.msg:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

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

.msg-head { display: flex; align-items: flex-start; gap: 11px; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; box-shadow: none; }
.avatar.xs { width: 24px; height: 24px; font-size: 11px; box-shadow: none; }

/* 表情头像 */
.avatar.emoji {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: none;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}
.avatar.sm.emoji { font-size: 17px; }
.avatar.xs.emoji { font-size: 14px; }

.msg-meta { flex: 1; min-width: 0; padding-top: 1px; }
.msg-who { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; line-height: 1.5; }

.name-link {
  font-weight: 650;
  font-size: 14.5px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.name-link:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  letter-spacing: .3px;
}
.badge.admin { color: var(--gold); background: rgba(217, 154, 43, .12); }
.badge.reply-to { color: var(--brand); background: var(--brand-soft); font-weight: 500; }
.badge.pending { color: #b8860b; background: rgba(184, 134, 11, .12); }

.msg-time { font-size: 12px; color: var(--muted); margin-top: 2px; }

.msg-body {
  margin: 11px 0 0 51px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.75;
}
.msg-body .mention { color: var(--brand); font-weight: 600; }

.msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0 51px;
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.act[hidden] { display: none; }
.act:hover { color: var(--brand); background: var(--brand-soft); }
.act.on { color: var(--danger); background: rgba(224, 87, 91, .1); }
.act.on:hover { color: var(--danger); }
.act svg { width: 15px; height: 15px; }
.act.pop { animation: pop .35s cubic-bezier(.3, 1.4, .5, 1); }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* 回复区 */
.replies {
  margin: 12px 0 0 51px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.replies:empty { display: none; }

.reply-row { display: flex; gap: 8px; align-items: flex-start; }
.reply-row .r-main { flex: 1; min-width: 0; }
.reply-row .r-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.reply-row .r-name { color: var(--text-2); font-weight: 600; font-size: 13px; }
.reply-row .r-del { margin-left: auto; font-size: 12px; padding: 2px 6px; }
.reply-row .r-text {
  font-size: 13.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
}

.more-replies {
  align-self: flex-start;
  margin-left: 0;
}

/* 内联回复输入 */
.inline-reply {
  display: none;
  margin: 12px 0 0 51px;
  gap: 8px;
}
.inline-reply.open { display: flex; }
.inline-reply input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.inline-reply input:focus { border-color: var(--brand); background: var(--elev); }
.inline-reply .btn { padding: 0 16px; height: 36px; }

/* ============ 侧栏 ============ */
.aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--nav-h) + 22px); }

.side-card { padding: 16px 18px; }

.side-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  text-align: center;
  padding: 10px 4px;
  border-radius: 10px;
  background: var(--bg-soft);
}
.stat .num { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat .lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.side-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.side-note p { margin: 0 0 6px; }
.side-note p:last-child { margin-bottom: 0; }

.user-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.user-mini .info { min-width: 0; }
.user-mini .nm { font-weight: 700; font-size: 14.5px; }
.user-mini .bi { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 分页 ============ */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 22px 0 6px;
  flex-wrap: wrap;
}
.pager:empty { display: none; }
.pager button {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--elev);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .18s;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.pager button:disabled { opacity: .35; cursor: default; }
.pager .dots { color: var(--muted); padding: 0 3px; }

/* ============ 空状态 ============ */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .ico { font-size: 38px; margin-bottom: 10px; opacity: .8; }
.empty h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--text-2); font-weight: 600; }
.empty p { margin: 0; font-size: 13px; }

/* ============ 个人主页 ============ */
.profile {
  padding: 24px;
  margin-bottom: 16px;
}
.profile-top { display: flex; gap: 16px; align-items: center; }
.profile .avatar { width: 64px; height: 64px; font-size: 24px; }
.profile .avatar.emoji { font-size: 34px; }
.profile-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.profile-bio { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; }

.profile-stats {
  display: flex;
  gap: 28px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.profile-stats .ps { text-align: left; }
.profile-stats .num { font-size: 20px; font-weight: 800; }
.profile-stats .lbl { font-size: 12px; color: var(--muted); }

/* ============ 抽屉 / 模态 ============ */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(12, 15, 25, .5);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.mask.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: -400px;
  bottom: 0;
  width: min(400px, 92vw);
  background: var(--elev);
  z-index: 70;
  transition: right .3s cubic-bezier(.2, .8, .3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer.open { right: 0; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; background: var(--elev); }

.notice-row {
  display: flex;
  gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.notice-row:hover { background: var(--bg-soft); }
.notice-row.unread { background: var(--brand-soft); }
.notice-row .n-main { flex: 1; min-width: 0; }
.notice-row .n-title { font-size: 13.5px; color: var(--text-2); }
.notice-row .n-title b { color: var(--text); font-weight: 650; }
.notice-row .n-text {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-row .n-time { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }

.modal {
  position: fixed;
  z-index: 70;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(.96);
  width: min(400px, 92vw);
  background: var(--elev);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s cubic-bezier(.2, .8, .3, 1);
  overflow: hidden;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.modal-head {
  padding: 22px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.modal-body { padding: 18px 24px 22px; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--brand);
  background: var(--elev);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { height: 72px; padding: 10px 13px; resize: vertical; }
.field-tip { margin-top: 5px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.field-tip.warn { color: var(--brand); }
.field input:disabled { opacity: .65; cursor: not-allowed; }

.switch-line {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.switch-line button {
  border: 0;
  background: none;
  color: var(--brand);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.avatar-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-picker span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}
.avatar-picker span:hover { transform: scale(1.12); }
.avatar-picker span.sel { border-color: var(--text); }
.avatar-picker .pick-emoji {
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 17px;
  line-height: 1;
}
.avatar-picker .pick-emoji.sel { border-color: var(--brand); }
.avatar-picker .pick-emoji:hover { border-color: var(--brand); }

/* ============ 提示条 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 16px);
  z-index: 90;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(24, 28, 40, .94);
  color: #fff;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: 88vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(200, 60, 64, .96); }
.toast.ok { background: rgba(28, 150, 110, .96); }

/* ============ 页脚 ============ */
.footer {
  max-width: 1080px;
  margin: 30px auto 0;
  padding: 22px 16px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.footer .links { display: flex; gap: 14px; }

/* ============ 加载骨架 ============ */
.skeleton { padding: 16px 18px; }
.sk-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--line) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 9px;
}
.sk-line.w40 { width: 40%; }
.sk-line.w80 { width: 80%; }
.sk-line.w60 { width: 60%; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .aside { position: static; order: 2; }
  .aside .side-card.hide-sm { display: none; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .shell { padding: 14px 12px 48px; }
  .nav { padding: 0 12px; gap: 8px; }
  .brand { font-size: 15px; gap: 7px; }
  .brand-mark { width: 26px; height: 26px; }
  .search { max-width: none; }
  .search input { height: 34px; font-size: 13px; padding-left: 30px; }
  .composer { padding: 14px; }
  .msg { padding: 14px; }
  .msg-body, .msg-actions, .replies, .inline-reply { margin-left: 0; }
  .msg-body { margin-top: 10px; }
  .msg-actions { margin-top: 8px; }
  .profile { padding: 18px; }
  .profile .avatar { width: 52px; height: 52px; font-size: 20px; }
  .profile-name { font-size: 17px; }
  .profile-stats { gap: 20px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

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

/* ============ 管理后台 ============ */
.adm-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.adm-stat { padding: 14px 16px; }
.adm-stat .lbl { font-size: 12px; color: var(--muted); }
.adm-stat .num { font-size: 22px; font-weight: 800; line-height: 1.3; }

.adm-panel { padding: 6px 18px 20px; }
.adm-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel { padding-top: 14px; }
.panel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-bar select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.muted { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.adm-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.adm-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-2);
}
.adm-table tr:hover td { background: var(--bg-soft); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.content-cell { max-width: 380px; }
.content-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops { white-space: nowrap; }
.st { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.st-ok { color: var(--ok); background: rgba(34, 176, 125, .12); }
.st-pending { color: #b8860b; background: rgba(184, 134, 11, .12); }
.st-hidden { color: var(--muted); background: var(--bg-soft); }

.words-box {
  width: 100%;
  min-height: 200px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
}
.words-box:focus { border-color: var(--brand); background: var(--elev); }

@media (max-width: 900px) {
  .adm-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .adm-stats { grid-template-columns: repeat(2, 1fr); }
  .adm-panel { padding: 6px 12px 16px; }
