/* Chat&Share — 设计系统 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;
  --text: #101418;
  --text-2: #667085;
  --text-3: #98a2b3;
  --ink: #111418;
  --ink-hover: #2b3138;
  --accent: #2563eb;
  --rose: #f0355c;
  --rose-soft: #fdf0f3;
  --green: #12805c;
  --amber: #b25e09;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.14);
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button {
  font-family: inherit; cursor: pointer; border: none; background: none;
  font-size: 14px; color: inherit; transition: all 0.16s var(--ease);
}
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; color: var(--text); }
img { display: block; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.ic { display: block; flex: none; }

::selection { background: #dbe4ff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.wordmark {
  font-weight: 800; letter-spacing: -0.035em; color: var(--text); white-space: nowrap;
}

/* ---------- 按钮 ---------- */
.btn-primary {
  background: var(--ink); color: #fff; border-radius: var(--r-sm);
  padding: 9px 18px; font-weight: 600;
}
.btn-primary:hover { background: var(--ink-hover); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-light {
  background: #f1f3f6; color: var(--text); border-radius: var(--r-sm);
  padding: 9px 18px; font-weight: 600;
}
.btn-light:hover { background: #e7eaef; }
.btn-danger { background: var(--rose); color: #fff; border-radius: var(--r-sm); padding: 9px 18px; font-weight: 600; }
.btn-text-blue { color: var(--accent); font-weight: 600; }
.btn-text-blue:hover { opacity: 0.75; }
.btn-text-red { color: var(--rose); font-weight: 600; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; color: var(--text);
}
.icon-btn:hover { background: #f1f3f6; }
.icon-btn.subtle { color: var(--text-3); }
.icon-btn.subtle:hover { color: var(--text); }

/* ---------- 登录页 ---------- */
#view-auth {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px;
  background:
    radial-gradient(48rem 30rem at 85% -10%, #eef1ff 0%, transparent 60%),
    radial-gradient(40rem 26rem at 0% 110%, #fdf0f3 0%, transparent 55%),
    var(--bg);
}
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  width: 100%; max-width: 384px; padding: 44px 36px 30px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.auth-card h1 {
  font-size: 34px; margin-bottom: 6px;
  background: linear-gradient(100deg, #1b1f27 30%, #4956d4 75%, #c2447c);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-card .tagline { color: var(--text-3); font-size: 13px; margin-bottom: 30px; }
.auth-card input {
  width: 100%; height: 44px; padding: 0 14px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd;
  transition: border-color 0.16s;
}
.auth-card input:focus { border-color: var(--ink); background: #fff; }
.auth-card .btn-primary { width: 100%; height: 44px; margin-top: 6px; font-size: 15px; }
.auth-switch { margin-top: 20px; font-size: 13.5px; color: var(--text-2); }
.auth-err { color: var(--rose); font-size: 13px; margin: 6px 0; min-height: 18px; }

/* ---------- 应用布局 ---------- */
#app { display: none; }
#app.active { display: block; }
:root { --sidebar-w: 256px; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--card); border-right: 1px solid var(--border);
  padding: 28px 14px 18px; display: flex; flex-direction: column; z-index: 50;
}
.sidebar .logo { font-size: 24px; padding: 0 12px 30px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 12px;
  border-radius: var(--r-md); font-size: 15px; width: 100%; text-align: left;
  margin-bottom: 2px; color: var(--text); font-weight: 500;
}
.nav-item:hover { background: #f1f3f6; }
.nav-item.active { font-weight: 700; background: #f1f3f6; }
.nav-item .ic { color: var(--text); }
.sidebar .spacer { flex: 1; }

.main { margin-left: var(--sidebar-w); min-height: 100dvh; }
.view { max-width: 640px; margin: 0 auto; padding: 32px 20px 90px; }

.topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: 52px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 60;
  align-items: center; justify-content: space-between; padding: 0 14px;
}
.topbar .logo { font-size: 20px; }
.bottombar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 54px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); z-index: 60;
  justify-content: space-around; align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottombar button {
  flex: 1; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.bottombar button.active { color: var(--text); }

@media (max-width: 1100px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 28px 12px 18px; align-items: center; }
  .sidebar .logo { font-size: 19px; padding: 0 0 26px; }
  .nav-item span.label { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .bottombar { display: flex; }
  .view { padding: 68px 0 78px; }
}

/* ---------- 头像 ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: #e7eaef; flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; cursor: pointer;
}
.avatar.md { width: 44px; height: 44px; font-size: 17px; }
.avatar.lg { width: 56px; height: 56px; font-size: 21px; }
.avatar.xl { width: 92px; height: 92px; font-size: 34px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.group-mark { background: var(--ink); color: #fff; }
.avatar.group-mark .ic { color: #fff; }

/* ---------- 帖子卡片 ---------- */
.feed-tabs {
  display: flex; justify-content: center; margin-bottom: 22px;
  background: #eceef2; border-radius: 999px; padding: 3px; width: max-content;
  margin-left: auto; margin-right: auto;
}
.feed-tabs button {
  padding: 7px 26px; border-radius: 999px; font-weight: 600; color: var(--text-2); font-size: 13.5px;
}
.feed-tabs button.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.feed-filter { display: flex; justify-content: center; margin: -8px 0 16px; }
.feed-filter button {
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--border); background: var(--card);
  padding: 5px 14px; border-radius: 999px;
}
.feed-filter button:hover { color: var(--text); border-color: var(--text-3); }
.feed-filter button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 发布入口 */
.compose-bar {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 12px 16px; margin: 0 auto 18px; max-width: 480px; box-shadow: var(--shadow-sm);
  transition: border-color 0.16s;
}
.compose-bar:hover { border-color: var(--text-3); }
.compose-bar .compose-hint { flex: 1; color: var(--text-3); font-size: 14px; }
.compose-bar .compose-btn {
  background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 16px;
  font-weight: 600; font-size: 13px; flex: none;
}
@media (max-width: 768px) { .compose-bar { border-radius: 0; border-left: none; border-right: none; margin-bottom: 12px; } }

.hot-chip {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  background: #fff1e8; color: #c2410c; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; vertical-align: 1px;
}

/* 通知铃 + 下拉面板 */
.notif-bell {
  position: fixed; top: 20px; right: 28px; z-index: 70;
  width: 42px; height: 42px; border-radius: 50%; background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.notif-bell:hover { background: #f1f3f6; }
@media (max-width: 768px) { .notif-bell { display: none; } }

.notif-panel {
  position: fixed; top: 70px; right: 28px; z-index: 80;
  width: min(360px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-md); overflow: hidden;
  animation: modalIn 0.18s var(--ease);
}
@media (max-width: 768px) { .notif-panel { top: 56px; right: 8px; } }
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px;
}
.notif-panel-body { max-height: min(60dvh, 460px); overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 16px;
  cursor: pointer; border-bottom: 1px solid #f4f5f7;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8f9fb; }
.notif-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; word-break: break-word; }
.notif-time { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }

.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  margin: 0 auto 20px; max-width: 480px; overflow: hidden; box-shadow: var(--shadow-sm);
}
@media (max-width: 768px) {
  .post-card { border-left: none; border-right: none; border-radius: 0; box-shadow: none; }
}
.post-head { display: flex; align-items: center; padding: 13px 16px 11px; gap: 11px; }
.post-head .name { font-weight: 650; cursor: pointer; font-size: 14px; }
.post-head .name:hover { color: var(--text-2); }
.post-head .time { color: var(--text-3); font-size: 12px; margin-top: 1px; }
.post-head .flex { flex: 1; }
.post-media { position: relative; background: #0b0d10; }
.post-media img, .post-media video { width: 100%; max-height: 600px; object-fit: contain; }
/* 图片加载失败的占位（替代静默裂图） */
.media-err {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 190px; padding: 26px 20px; text-align: center;
  background: #f4f6f9; color: var(--text-2);
}
.media-err svg { color: var(--rose); }
.media-err span { font-size: 13.5px; font-weight: 600; color: var(--text); }
.media-err small { font-size: 12px; color: var(--text-3); }
.media-err button { margin-top: 6px; }

.media-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.92); width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.media-nav:hover { background: #fff; }
.media-dots { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; }
.media-dots i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45); margin: 0 3px; transition: background 0.16s;
}
.media-dots i.on { background: #fff; }
.post-actions { display: flex; gap: 6px; padding: 8px 10px 0; }
.post-actions .icon-btn.liked { color: var(--rose); }
.post-body { padding: 2px 16px 15px; }
.post-body .likes { font-weight: 650; margin-bottom: 3px; font-size: 13.5px; }
.post-body .caption { word-break: break-word; white-space: pre-wrap; }
.post-body .caption b { font-weight: 650; margin-right: 4px; }
.post-body .view-comments { color: var(--text-3); margin-top: 5px; cursor: pointer; font-size: 13.5px; }
.post-body .view-comments:hover { color: var(--text-2); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: #f1f3f6; color: var(--text-2); vertical-align: 2px;
}

/* 问卷 */
.survey { padding: 10px 16px 4px; }
.survey-opt {
  position: relative; border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 14px; margin-bottom: 8px; cursor: pointer; overflow: hidden;
  transition: border-color 0.16s;
}
.survey-opt:hover { border-color: var(--ink); }
.survey-opt .bar {
  position: absolute; left: 0; top: 0; bottom: 0; background: #f1f3f6; z-index: 0;
  transition: width 0.45s var(--ease);
}
.survey-opt .row { position: relative; display: flex; justify-content: space-between; z-index: 1; gap: 10px; }
.survey-opt .row .pct { color: var(--text-2); font-variant-numeric: tabular-nums; }
.survey-opt.voted { border-color: var(--ink); font-weight: 650; }
.survey-total {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 12.5px; padding: 2px 0 6px;
}

/* ---------- 面板 / 列表 ---------- */
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
@media (max-width: 768px) { .panel { border-left: none; border-right: none; border-radius: 0; box-shadow: none; } }
.panel-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; letter-spacing: -0.01em;
}
.user-row {
  display: flex; align-items: center; gap: 13px; padding: 11px 20px; cursor: pointer;
  transition: background 0.13s;
}
.user-row:hover { background: #f8f9fb; }
.user-row .info { flex: 1; min-width: 0; }
.user-row .info .n { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.user-row .info .s {
  color: var(--text-2); font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
}
.user-row .end { color: var(--text-3); font-size: 12px; flex: none; }
.search-box { padding: 14px 20px; }
.search-box input {
  width: 100%; background: #f1f3f6; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 15px; transition: all 0.16s;
}
.search-box input:focus { background: #fff; border-color: var(--ink); }

/* ---------- 聊天 ---------- */
#view-room { max-width: 640px; display: flex; flex-direction: column; height: 100dvh; padding: 24px 20px; }
.room-shell {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
/* 手机端聊天室：独占全屏，并跟随「可视视口」以适配虚拟键盘
 *
 * 原来的问题有两个：
 *   1) 顶栏 52px 与底栏 54px 都是 position:fixed，而 #view-room 在手机上 padding 归零，
 *      于是输入框正好被底栏盖住 —— 表现为「输入框完全看不到」
 *   2) 100dvh 在键盘弹出时各浏览器行为不一致（iOS Safari 压根不改变布局视口），
 *      于是输入框位置乱跳 —— 表现为「位置极其不固定」
 *
 * 解决：进入聊天室时隐藏顶/底栏（room-head 自带返回按钮，不影响导航），
 * 容器改为 position:fixed，高度与顶部偏移取自 JS 写入的 --vv-h / --vv-top
 *（来自 visualViewport，键盘弹出时它才是真正可见的区域，iOS 上也准确）。
 */
@media (max-width: 768px) {
  #view-room { padding: 0; }
  .room-shell { border: none; border-radius: 0; box-shadow: none; }

  body.in-room { overflow: hidden; }
  body.in-room .topbar,
  body.in-room .bottombar,
  body.in-room .notif-panel { display: none; }

  body.in-room #view-room {
    position: fixed;
    left: 0; right: 0;
    top: var(--vv-top, 0px);
    height: var(--vv-h, 100dvh);
    max-width: none; margin: 0;
    z-index: 60;
  }
  /* 消息区滚动不要连带整页滚动 */
  body.in-room .room-msgs { overscroll-behavior: contain; }
  /* iPhone 底部小黑条：键盘弹出时该值自动为 0，因此可以常驻 */
  body.in-room .room-input { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
}
.room-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--card); flex: none;
}
.room-head .name { font-weight: 700; font-size: 15px; }
.room-head .sub { font-size: 12px; color: var(--text-3); }
.room-msgs {
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
  background: #fcfcfd;
}
.msg { display: flex; gap: 9px; max-width: 80%; align-items: flex-end; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble {
  background: #eef0f4; border-radius: 18px; padding: 9px 14px;
  word-break: break-word; white-space: pre-wrap;
}
.msg.mine .bubble { background: var(--ink); color: #fff; }
.msg .meta { font-size: 11px; color: var(--text-3); margin: 0 4px 3px; }
.msg .meta a { color: var(--text-3); text-decoration: underline; }
.msg .stack { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.msg.mine .stack { align-items: flex-end; }
.msg-media { max-width: 230px; max-height: 290px; border-radius: 14px; cursor: pointer; }
video.msg-media { background: #000; }
.msg-system { text-align: center; color: var(--text-3); font-size: 12px; margin: 2px 0; }
.msg-system.warn { color: var(--amber); }
.msg-deleted { font-style: italic; opacity: 0.55; }

/* 闪照气泡 */
.flash-bubble {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px;
  cursor: pointer; background: var(--card); color: var(--text); text-align: left;
  transition: border-color 0.16s; min-width: 190px;
}
.flash-bubble:hover { border-color: var(--rose); }
.flash-bubble .fire {
  width: 40px; height: 40px; border-radius: 50%; background: var(--rose-soft);
  color: var(--rose); display: flex; align-items: center; justify-content: center; flex: none;
}
.flash-bubble .t { font-weight: 650; font-size: 13.5px; }
.flash-bubble .s { color: var(--text-3); font-size: 12px; margin-top: 1px; }
.flash-bubble.burned { cursor: default; }
.flash-bubble.burned:hover { border-color: var(--border); }
.flash-bubble.burned .fire { background: #f1f3f6; color: var(--text-3); }
.flash-bubble.burned .t { color: var(--text-2); }

/* 游戏卡片 */
.game-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px;
  background: var(--card); color: var(--text); min-width: 200px; text-align: left;
}
.game-card .title {
  font-weight: 700; margin-bottom: 10px; font-size: 13.5px;
  display: flex; align-items: center; gap: 7px;
}
.game-card .title .ic { color: var(--text-2); }
.rps-btns { display: flex; gap: 7px; }
.rps-btns button {
  background: #f1f3f6; border-radius: 999px; padding: 7px 16px; font-weight: 600; font-size: 13px;
}
.rps-btns button:hover { background: var(--ink); color: #fff; }
.game-card .moves { color: var(--text-2); font-size: 13px; }
.game-card .result { margin-top: 8px; font-weight: 700; }
.game-card .dice-face { color: var(--ink); margin: 2px auto 0; display: flex; justify-content: center; }

/* 私聊限流 / 拉黑提示条 */
.dm-quota {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 8px 14px; font-size: 12.5px; border-top: 1px solid var(--border);
  background: #f6f9ff; color: var(--accent);
}
.dm-quota .ic { flex: none; }
.dm-quota.warn { background: #fdf4e3; color: #92400e; }
.dm-quota.blocked { background: var(--rose-soft); color: #c02650; }

.room-foot { position: relative; }
.room-input {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border-top: 1px solid var(--border); flex: none; background: var(--card);
}
.room-input input[type=text] {
  flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px;
  min-width: 0; background: #fbfcfd; transition: border-color 0.16s;
}
.room-input input[type=text]:focus { border-color: var(--ink); background: #fff; }
.send-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.send-btn:hover { background: var(--ink-hover); }
.tool-menu {
  position: absolute; bottom: 62px; right: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md);
  overflow: hidden; z-index: 20; padding: 6px; min-width: 180px;
}
.tool-menu button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  text-align: left; padding: 10px 12px; border-radius: 9px; font-weight: 500;
}
.tool-menu button:hover { background: #f1f3f6; }
.tool-menu button .ic { color: var(--text-2); }
.tool-menu .sep { height: 1px; background: var(--border); margin: 5px 8px; }

/* ---------- 闪照查看器 ---------- */
#flash-overlay {
  position: fixed; inset: 0; z-index: 999; background: #000;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#flash-overlay .media-wrap { position: relative; max-width: 100%; max-height: 100%; }
#flash-overlay img, #flash-overlay video, #flash-overlay canvas {
  max-width: 100vw; max-height: 100dvh; pointer-events: none; -webkit-user-drag: none;
  display: block;
}
#flash-watermark {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5;
  opacity: 0.32; display: flex; flex-wrap: wrap; align-content: space-around;
  transform: rotate(-18deg) scale(1.5);
}
#flash-watermark span {
  color: rgba(255, 255, 255, 0.8); font-size: 14px; white-space: nowrap; margin: 26px 30px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}
#flash-timer {
  position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 10;
  color: #fff; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px);
  border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
#flash-tip {
  position: fixed; bottom: max(26px, env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 10;
  text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 12.5px; pointer-events: none;
}
#flash-cover {
  position: absolute; inset: 0; z-index: 8; background: #000;
  display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
}
#flash-cover .ic { color: var(--rose); }

/* ---------- 个人主页 ---------- */
.profile-head { display: flex; gap: 30px; padding: 30px 24px; align-items: center; }
.profile-head .stats { display: flex; gap: 26px; margin: 12px 0 10px; color: var(--text-2); font-size: 13.5px; }
.profile-head .stats b { font-size: 16px; color: var(--text); margin-right: 3px; }
.profile-head .uname {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.profile-head .handle { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.profile-head .bio { white-space: pre-wrap; color: var(--text-2); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; }
.post-grid .cell {
  aspect-ratio: 1; background: #f1f3f6; position: relative; cursor: pointer;
  overflow: hidden; border-radius: 6px;
}
.post-grid .cell img, .post-grid .cell video { width: 100%; height: 100%; object-fit: cover; }
.post-grid .cell .txt {
  padding: 10px; font-size: 12px; color: var(--text-2); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
}
.post-grid .cell .tag {
  position: absolute; top: 8px; right: 8px; color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.post-grid .cell .tag-dark { position: absolute; top: 8px; right: 8px; color: var(--text-2); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 15, 20, 0.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 480px;
  max-height: 88dvh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.22s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.modal-body .field-label:first-child { margin-top: 0; }
.modal-body textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
  resize: vertical; background: #fbfcfd; transition: border-color 0.16s;
}
.modal-body textarea:focus { border-color: var(--ink); background: #fff; }
.modal-body input[type=text], .modal-body input[type=password] {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px;
  margin-bottom: 8px; background: #fbfcfd; transition: border-color 0.16s;
}
.modal-body input:focus { border-color: var(--ink); background: #fff; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-preview .thumb {
  position: relative; width: 86px; height: 86px; border-radius: 10px; overflow: hidden; background: #0b0d10;
}
.upload-preview .thumb img, .upload-preview .thumb video { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .thumb .rm {
  position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.62); color: #fff;
  border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.seg { display: flex; background: #eceef2; border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.seg button {
  flex: 1; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* 评论区 */
.comment-list { max-height: 42dvh; overflow-y: auto; }
.comment-item { display: flex; gap: 11px; padding: 9px 0; }
.comment-item .c-body { flex: 1; }
.comment-item .c-name { font-weight: 650; margin-right: 6px; }
.comment-item .c-time { color: var(--text-3); font-size: 11px; margin-top: 2px; }
.comment-input {
  display: flex; gap: 8px; border-top: 1px solid var(--border); padding: 12px 20px; align-items: center;
}
.comment-input input { flex: 1; border: none; font-size: 14px; }

/* ---------- 匹配 ---------- */
.match-tabs {
  display: flex; background: #eceef2; border-radius: 999px; padding: 3px;
  width: max-content; max-width: 100%; margin: 0 auto 18px; overflow-x: auto;
}
.match-tabs button {
  padding: 7px 20px; border-radius: 999px; font-weight: 600;
  color: var(--text-2); font-size: 13.5px; white-space: nowrap;
}
.match-tabs button.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.deck-wrap { display: flex; flex-direction: column; align-items: center; }
.deck {
  position: relative; width: min(92vw, 400px); aspect-ratio: 3 / 4.2;
  margin-bottom: 22px;
}
.mcard {
  position: absolute; inset: 0; border-radius: 20px; overflow: hidden;
  background: #0b0d10; box-shadow: var(--shadow-md); cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.mcard[data-layer="1"] { transform: scale(0.955) translateY(14px); filter: brightness(0.96); }
.mcard[data-layer="2"] { transform: scale(0.91) translateY(28px); filter: brightness(0.92); }
.mcard:active { cursor: grabbing; }
.mcard-media { position: relative; width: 100%; height: 100%; }
.mcard-media img, .mcard-media video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mcard-noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #2a2f38, #14171c); color: #4d5561;
}
.mcard-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 8, 11, 0.88) 0%, rgba(6, 8, 11, 0.28) 34%, transparent 60%);
}
.mcard-online {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(8, 10, 14, 0.55); backdrop-filter: blur(6px);
  color: #fff; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.mcard-online i {
  width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.mcard-seen {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  background: rgba(8, 10, 14, 0.5); backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.9); font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
}
.mcard-online + .mcard-seen { left: auto; right: 14px; top: 46px; }
.mcard-count {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(8, 10, 14, 0.55); backdrop-filter: blur(6px);
  color: #fff; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.mcard-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 22px; z-index: 2; color: #fff; }
.mcard-name {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
}
.mcard-handle { font-size: 13px; font-weight: 500; opacity: 0.7; letter-spacing: 0; }
.mcard-bio {
  margin-top: 6px; font-size: 14px; line-height: 1.5; opacity: 0.92;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mcard-bio.dim-bio { opacity: 0.55; }
.mcard-stamp {
  position: absolute; top: 34px; z-index: 4; opacity: 0;
  font-size: 26px; font-weight: 900; letter-spacing: 0.04em;
  padding: 6px 16px; border-radius: 10px; border: 4px solid; pointer-events: none;
}
.like-stamp { right: 24px; color: #22c55e; border-color: #22c55e; transform: rotate(14deg); }
.pass-stamp { left: 24px; color: var(--rose); border-color: var(--rose); transform: rotate(-14deg); }

.deck-actions { display: flex; gap: 26px; justify-content: center; }
.deck-btn {
  width: 62px; height: 62px; border-radius: 50%; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.14); border: 1px solid var(--border);
}
.deck-btn:hover { transform: translateY(-2px); }
.deck-btn:active { transform: scale(0.94); }
.deck-btn.pass { color: var(--text-2); }
.deck-btn.pass:hover { color: var(--rose); border-color: var(--rose); }
.deck-btn.like { color: var(--rose); }
.deck-btn.like:hover { background: var(--rose); color: #fff; border-color: var(--rose); }
.deck-hint {
  color: var(--text-3); font-size: 12.5px; text-align: center;
  margin-top: 18px; max-width: 360px; line-height: 1.6;
}

/* 在线速配 */
.online-hero {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 34px 20px 30px; text-align: center;
}
.pulse-ring { position: relative; display: flex; align-items: center; justify-content: center; }
.pulse-ring::before, .pulse-ring::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--rose); opacity: 0;
}
.pulse-ring.on::before { animation: pulse 2s var(--ease) infinite; }
.pulse-ring.on::after { animation: pulse 2s var(--ease) infinite 1s; }
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.7); opacity: 0; }
}
.online-count { font-size: 15px; color: var(--text-2); }
.online-count b { font-size: 26px; color: var(--text); font-weight: 800; margin-right: 4px; }
.online-desc { color: var(--text-3); font-size: 13px; max-width: 300px; }

/* 配对成功弹窗 */
.match-hit { padding: 34px 28px 28px; text-align: center; }
.match-hit-title {
  font-size: 25px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--rose), #b5179e);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.match-hit-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.match-hit-avatars {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px 0 14px;
}
.match-hit-heart { color: var(--rose); animation: beat 1.2s var(--ease) infinite; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
.match-hit-name { font-size: 17px; font-weight: 700; }
.match-hit-contact {
  margin-top: 12px; padding: 11px 14px; background: #f8f9fb; border-radius: 10px;
  font-size: 13.5px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.match-hit-contact b { color: var(--text); }

/* ---------- 性别 ---------- */
.gender-pick { display: flex; gap: 10px; margin-bottom: 8px; }
.gender-pick label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  cursor: pointer; font-weight: 600; background: #fbfcfd; transition: all 0.16s;
}
.gender-pick label:has(input:checked) { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--ink); }
.gender-pick input { accent-color: var(--ink); }
.gender-note { color: var(--text-3); font-size: 12px; margin-bottom: 4px; }
.gender-fixed {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px;
  background: #f8f9fb; font-weight: 600;
}
.gender-fixed small { display: block; font-weight: 400; color: var(--text-3); font-size: 12px; margin-top: 1px; }
.gender-chip {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  vertical-align: 2px; letter-spacing: 0;
}
.gender-chip.male { background: #e6efff; color: #1d4ed8; }
.gender-chip.female { background: #ffe9f1; color: #be1259; }
.mcard-name .gender-chip { background: rgba(255, 255, 255, 0.22); color: #fff; backdrop-filter: blur(4px); }

/* ---------- 来源判定标注 ---------- */
.post-caption-top {
  padding: 2px 16px 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}
.origin-flag {
  display: flex; align-items: center; gap: 7px; margin: 0 16px 10px;
  background: #fdf4e3; color: #92400e; border: 1px solid #fae5c0;
  border-radius: 9px; padding: 7px 11px; font-size: 12.5px; font-weight: 600;
}
.origin-flag .ic { color: #b45309; flex: none; }
.origin-flag b { margin-left: auto; font-weight: 700; opacity: 0.75; flex: none; }
.mcard-flag {
  position: absolute; bottom: 14px; right: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(180, 83, 9, 0.86); backdrop-filter: blur(6px);
  color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.flag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fdf4e3; color: #92400e; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}

/* ---------- 群管理 ---------- */
.badge.role-owner { background: #fdf1e3; color: #b45309; }
.badge.role-admin { background: #e9effd; color: #2456c4; }
.badge.role-muted { background: #fdeef1; color: #c02650; }
.mem-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none;
}
.mem-actions button { font-size: 12px; }
@media (max-width: 520px) {
  .mem-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
}
#msg-input:disabled { background: #f4f5f7; color: var(--text-3); cursor: not-allowed; }

/* 受保护媒体（禁止另存） */
canvas.pmedia {
  display: block; max-width: 230px; max-height: 290px; width: auto; height: auto;
  border-radius: 14px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none;
  background: #eef0f4;
}
.lightbox canvas.pmedia { max-width: 96vw; max-height: 92dvh; border-radius: 4px; }
.protected-video { -webkit-touch-callout: none; }

/* ---------- 群邀请 / 必答题 / JSON 说明 ---------- */
.invite-box { border-bottom: 1px solid var(--border); background: #f8fafd; }
.invite-head {
  display: flex; align-items: center; gap: 7px; padding: 11px 20px 4px;
  font-size: 12.5px; font-weight: 700; color: var(--accent);
}
.invite-box .btn-primary, .invite-box .btn-light { padding: 6px 14px; font-size: 12.5px; }
.req-star { color: var(--rose); font-weight: 700; margin-right: 3px; }
.req-toggle {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--text-2); cursor: pointer; font-weight: 600;
}
.req-toggle input { accent-color: var(--ink); }

.imp-msg { font-size: 12.5px; margin-top: 8px; line-height: 1.6; word-break: break-word; min-height: 18px; }
.imp-msg.ok { color: var(--green); }
.imp-msg.err { color: var(--rose); }

.spec-block { margin-bottom: 18px; }
.spec-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.spec-table th, .spec-table td {
  text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.spec-table th { color: var(--text-3); font-size: 11.5px; font-weight: 600; }
.spec-table td:first-child { white-space: nowrap; }
.spec-pre {
  background: #f8f9fb; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 11.5px; line-height: 1.6; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.spec-list { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
code {
  background: #f1f3f6; border-radius: 4px; padding: 1px 5px; font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 设备被封禁：整页拦截 */
.device-banned-screen {
  position: fixed; inset: 0; z-index: 9999; background: rgba(247, 248, 250, 0.97);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.dbs-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 34px 30px; max-width: 400px; text-align: center; box-shadow: var(--shadow-md);
}

/* ---------- 设备封禁提示 ---------- */
.banned-box { padding: 32px 28px 26px; text-align: center; }
.banned-icon {
  width: 68px; height: 68px; border-radius: 50%; background: var(--rose-soft);
  color: var(--rose); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.banned-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.banned-desc { color: var(--text-2); font-size: 13.5px; margin-top: 8px; line-height: 1.7; }

.mp-note {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 12px; margin-top: 6px;
}
.thumb-main {
  position: absolute; bottom: 3px; left: 3px; background: rgba(8, 10, 14, 0.7);
  color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 5px;
}

/* ---------- 问卷中心 ---------- */
.survey-item {
  display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid #f0f2f5;
  align-items: flex-start;
}
.survey-item:last-child { border-bottom: none; }
.sv-cover {
  width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: #f1f3f6;
}
.sv-cover-ph { display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.sv-info { flex: 1; min-width: 0; }
.sv-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-desc {
  color: var(--text-2); font-size: 13px; margin-top: 2px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sv-meta { color: var(--text-3); font-size: 12px; margin-top: 5px; }
.sv-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex: none; }
.sv-actions .btn-primary, .sv-actions .btn-light { padding: 7px 16px; font-size: 13px; }
.sv-actions .btn-text-blue, .sv-actions .btn-text-red { font-size: 12.5px; }
@media (max-width: 520px) {
  .survey-item { flex-wrap: wrap; }
  .sv-actions { flex-direction: row; width: 100%; justify-content: flex-end; align-items: center; }
}

.sv-fill { padding: 20px; }
.sv-fill-cover { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.sv-fill-desc { color: var(--text-2); margin-bottom: 18px; white-space: pre-wrap; }
.sv-question { margin-bottom: 22px; }
.sv-q-title { font-weight: 650; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-q-img { max-width: 100%; max-height: 260px; border-radius: 10px; margin-bottom: 10px; cursor: pointer; }
.sv-question textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px;
  resize: vertical; background: #fbfcfd;
}
.sv-question textarea:focus { border-color: var(--ink); background: #fff; }
.sv-text-ans {
  background: #f8f9fb; border-radius: 10px; padding: 10px 13px; margin-bottom: 6px;
  color: var(--text-2); word-break: break-word;
}
.sv-done-note { color: var(--text-3); font-size: 13px; text-align: center; padding: 8px 0 4px; }

/* ---- 用户 8 位 ID ---- */
.profile-head .handle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uid-chip {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: #f1f3f7; color: var(--text-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px 2px 7px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.3px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.uid-chip:hover { background: #e8ebf2; color: var(--text); }
.uid-chip svg { width: 13px; height: 13px; }
.uid-sep { color: var(--text-3); }
.uid-readonly {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: #f1f3f7; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 13px; margin-bottom: 2px;
}
.uid-readonly b { font-size: 16px; letter-spacing: 1.5px; font-variant-numeric: tabular-nums; }
.uid-readonly span { margin-left: auto; color: var(--text-3); font-size: 12px; }
.uid-readonly:hover { background: #e8ebf2; }

/* ---- 问卷 AI 反馈 ---- */
.badge.ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef2ff; color: #4338ca;
}
.badge.ai-badge svg { width: 12px; height: 12px; }
.sv-ai-hint {
  display: flex; align-items: center; gap: 6px; margin-top: 12px;
  color: #4338ca; background: #eef2ff; border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.sv-ai {
  margin-top: 16px; border: 1px solid #dfe3f5; border-radius: var(--r-md);
  background: linear-gradient(180deg, #f7f8ff 0%, #fdfdff 100%); padding: 14px 16px;
}
.sv-ai.err { border-color: #f6d3dc; background: var(--rose-soft); }
.sv-ai-head {
  display: flex; align-items: center; gap: 7px;
  font-weight: 650; color: #3730a3; margin-bottom: 8px;
}
.sv-ai.err .sv-ai-head { color: var(--rose); }
.sv-ai-head svg { width: 15px; height: 15px; }
.sv-ai-body { color: var(--text); line-height: 1.75; word-break: break-word; white-space: normal; }

/* 大模型回复里的 Markdown（加粗 / 列表 / 小标题） */
.md-p { margin: 0 0 2px; }
.md-gap { height: 8px; }
.md-h { font-weight: 700; margin: 12px 0 4px; line-height: 1.45; }
.md-h:first-child { margin-top: 0; }
.md-h1 { font-size: 16px; }
.md-h2 { font-size: 15px; }
.md-h3, .md-h4, .md-h5, .md-h6 { font-size: 14px; }
.md-ul, .md-ol { margin: 4px 0 6px; padding-left: 20px; }
.md-ul li, .md-ol li { margin: 3px 0; }
.md-quote {
  margin: 6px 0; padding: 6px 12px; border-left: 3px solid var(--border-strong);
  color: var(--text-2); background: rgba(0, 0, 0, 0.015);
}
.md-hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.sv-ai-body code, .md-p code {
  background: rgba(16, 24, 40, 0.06); padding: 1px 5px; border-radius: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92em;
}
.sv-ai-foot { margin-top: 10px; color: var(--text-3); font-size: 12px; }
.sv-ai.pending .sv-ai-body::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: currentColor; animation: aiPulse 1.1s infinite;
}
@keyframes aiPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.sv-ai-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); margin: 4px 0 8px; }
.sv-ai-toggle input { width: 16px; height: 16px; }

.svc-q { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.svc-q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.svc-q-head .btn-text-red { margin-left: auto; }
.svc-q input { margin-bottom: 6px !important; }

.lightbox {
  position: fixed; inset: 0; background: rgba(5, 7, 10, 0.94); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.lightbox img, .lightbox video { max-width: 96vw; max-height: 92dvh; border-radius: 4px; }

.empty {
  text-align: center; color: var(--text-3); padding: 56px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty .ic { color: #d0d5dd; }

/* ---------- 角标 / 未读 ---------- */
.badge-host { position: relative; }
.nav-dot {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px;
  background: var(--rose); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  padding: 0 4px; pointer-events: none; box-shadow: 0 0 0 2px var(--card);
}
.nav-item .nav-dot { top: 6px; left: 30px; right: auto; }
@media (max-width: 1100px) { .nav-item .nav-dot { left: auto; right: 8px; } }
.unread-chip {
  min-width: 19px; height: 19px; background: var(--rose); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 19px;
  text-align: center; padding: 0 5px; display: inline-block;
}
.notif-unread { background: #f6f9ff; }
.unread-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rose); flex: none;
}

/* ---------- 群权限选择 ---------- */
.policy-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer;
}
.policy-opt:has(input:checked) { border-color: var(--ink); background: #fafbfc; }
.policy-opt input { margin-top: 3px; accent-color: var(--ink); }
.policy-opt b { display: block; font-size: 13.5px; }
.policy-opt small { color: var(--text-3); font-size: 12px; }

/* ---------- 帖子详情弹窗 ---------- */
.detail-post { border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.detail-caption { padding: 10px 20px 4px; white-space: pre-wrap; word-break: break-word; }
.detail-stats {
  display: flex; align-items: center; gap: 4px; padding: 2px 12px 8px;
  color: var(--text-2); font-size: 13.5px;
}
.detail-stats b { color: var(--text); }
.detail-comments-head {
  padding: 12px 20px 6px; font-weight: 700; font-size: 13.5px; color: var(--text-2);
}

/* ---------------- 提示条 ---------------- */
#toast-root {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; flex-direction: column-reverse; align-items: center;
  gap: 8px; pointer-events: none; max-width: 92vw;
}
@media (min-width: 769px) { #toast-root { bottom: 40px; } }
.toast {
  display: flex; align-items: center; gap: 8px; pointer-events: auto; cursor: pointer;
  background: rgba(17, 20, 24, 0.94); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; max-width: 86vw; text-align: left; line-height: 1.45;
  box-shadow: var(--shadow-md); backdrop-filter: blur(6px);
  animation: toastIn 0.26s var(--ease);
}
.toast svg { flex: none; }
.toast.ok { background: rgba(9, 94, 68, 0.95); }
.toast.err { background: rgba(176, 26, 60, 0.95); }
.toast.out { animation: toastOut 0.2s var(--ease) forwards; }
.toast.shake { animation: shake 0.32s var(--ease); }
.toast-act {
  flex: none; background: rgba(255, 255, 255, 0.18); color: #fff; border: 0;
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.toast-act:hover { background: rgba(255, 255, 255, 0.3); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(0.97); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* ---------------- 顶部加载进度条 ---------------- */
#top-progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0; z-index: 900;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
  opacity: 0; transition: opacity 0.2s;
}
#top-progress.on { opacity: 1; animation: progressGrow 8s cubic-bezier(0.1, 0.8, 0.2, 1) forwards; }
#top-progress.done { animation: none; width: 100%; opacity: 0; transition: width 0.18s ease-out, opacity 0.3s 0.15s; }
@keyframes progressGrow {
  0% { width: 0; }
  30% { width: 55%; }
  70% { width: 82%; }
  100% { width: 94%; }
}

/* ---------------- 断网横幅 ---------------- */
#net-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 880;
  display: none; align-items: center; justify-content: center; gap: 7px;
  background: #b01a3c; color: #fff; font-size: 13px; padding: 8px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
#net-banner.on { display: flex; animation: slideDown 0.28s var(--ease); }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: none; } }

/* ---------------- 骨架屏 ---------------- */
.sk-wrap { display: flex; flex-direction: column; gap: 12px; }
.sk-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.sk-row { display: flex; align-items: center; gap: 12px; }
.sk-row.pad { padding: 12px 4px; }
.sk-row > div { display: flex; flex-direction: column; gap: 7px; }
.sk {
  background: linear-gradient(90deg, #eef0f4 25%, #e3e6ec 37%, #eef0f4 63%);
  background-size: 400% 100%; border-radius: 6px;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.sk-line { height: 11px; }
.sk-media { height: 190px; border-radius: 12px; }
.w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; }
.w50 { width: 50%; } .w60 { width: 60%; } .w80 { width: 80%; }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ---------------- 加载失败 ---------------- */
.load-err {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 44px 24px; text-align: center; color: var(--text-2);
  animation: fadeUp 0.3s var(--ease);
}
.load-err svg { color: var(--rose); }
.load-err .le-msg { font-size: 14px; max-width: 320px; line-height: 1.6; }

/* ---------------- 问卷分享（链接 + 二维码） ---------------- */
.share-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.share-title { font-weight: 700; font-size: 15px; text-align: center; line-height: 1.5; }
.share-qr {
  background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); line-height: 0;
  animation: qrPop 0.34s var(--ease);
}
.share-qr svg { display: block; border-radius: 6px; }
@keyframes qrPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}
.share-hint { color: var(--text-3); font-size: 12.5px; }
.share-link {
  display: flex; align-items: center; gap: 8px; width: 100%; cursor: pointer;
  background: #f4f6f9; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 13px; font-size: 12.5px; color: var(--text-2);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.share-link:hover { background: #eceff4; border-color: var(--border-strong); }
.share-link span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; }
.share-link svg { flex: none; color: var(--text-3); }
.share-btns { display: flex; gap: 8px; width: 100%; }
.share-btns button { flex: 1; }
.share-note {
  display: flex; align-items: flex-start; gap: 6px; color: var(--text-3); font-size: 12px;
  line-height: 1.6; margin-top: 2px;
}
.share-note svg { flex: none; margin-top: 2px; }

/* 未登录时打开分享链接的问卷预览 */
#share-preview { display: none; }
#share-preview.on { display: block; margin-bottom: 18px; animation: fadeUp 0.34s var(--ease); }
.sp-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #f4f6f9; border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.sp-card img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; flex: none; }
.sp-ph {
  width: 48px; height: 48px; border-radius: 9px; flex: none; display: flex;
  align-items: center; justify-content: center; background: #e5e8ee; color: var(--text-3);
}
.sp-t { font-weight: 650; font-size: 14px; line-height: 1.4; }
.sp-s { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.sp-tip { color: var(--accent); font-size: 12.5px; margin-top: 8px; text-align: center; }

/* ---------------- 问卷历史作答 ---------------- */
.hist-item {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px 15px; margin-bottom: 12px; background: #fbfcfd;
}
.hist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; }
.hist-q { margin-bottom: 8px; font-size: 13.5px; line-height: 1.6; }
.hist-q b { display: block; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.hist-q > div { color: var(--text); word-break: break-word; }

/* ---------------- 站内公告 ---------------- */
.ann-modal { padding: 20px 22px 22px; }
.ann-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ann-head .icon-btn { margin-left: auto; }
.ann-badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: #eef2ff; color: #4338ca;
}
.ann-warn .ann-badge { background: #fff7ed; color: #b25e09; }
.ann-urgent .ann-badge { background: var(--rose-soft); color: var(--rose); }
.ann-time { color: var(--text-3); font-size: 12px; }
.ann-title {
  font-size: 18px; font-weight: 750; letter-spacing: -0.01em;
  line-height: 1.4; margin-bottom: 10px; word-break: break-word;
}
.ann-body {
  color: var(--text); line-height: 1.8; word-break: break-word;
  max-height: 46dvh; overflow-y: auto;
}
.ann-skip {
  display: flex; align-items: center; gap: 6px; margin-top: 14px;
  background: #f4f6f9; border-radius: 10px; padding: 9px 12px;
  color: var(--text-2); font-size: 12.5px; line-height: 1.6;
}
.ann-skip svg { flex: none; }
.ann-ok { width: 100%; margin-top: 18px; }
/* 重要公告：顶部加一条醒目色带 */
.ann-urgent { border-top: 3px solid var(--rose); }
.ann-warn { border-top: 3px solid var(--amber); }

/* 历史公告列表 */
.ann-item {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px 15px; margin-bottom: 10px; background: #fbfcfd;
}
.ann-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-item-head b { font-size: 14.5px; }
.ann-item-head .ann-time { margin-left: auto; }
.ann-item-body { margin-top: 8px; color: var(--text-2); line-height: 1.75; font-size: 13.5px; }
.ann-item.ann-urgent { border-left: 3px solid var(--rose); }
.ann-item.ann-warn { border-left: 3px solid var(--amber); }

/* ---------------- 通用动效 ---------------- */
.fade-up { animation: fadeUp 0.34s var(--ease) both; }
.fade-in { animation: fadeIn 0.3s var(--ease); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* 按钮进行中：文字变淡 + 右侧转圈，且不可重复点击 */
.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.is-busy > * { opacity: 0; }
.is-busy::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px;
  margin: -7.5px 0 0 -7.5px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: #fff; animation: spin 0.65s linear infinite;
}
.btn-light.is-busy::after, .btn-text-blue.is-busy::after { color: var(--text-2); }

/* 视图切换与列表项的入场 */
.view:not(.hidden) { animation: fadeIn 0.24s var(--ease); }
.auth-err.shake { animation: shake 0.32s var(--ease); }

/* 尊重系统「减弱动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #top-progress.on { width: 90%; }
}
