/* 鲸鱼屋 · QQ 式单流聊天 */
:root {
  --bg: #f2f3f7;
  --panel: #ffffff;
  --line: #e6e8ee;
  --text: #111418;
  --muted: #8a90a0;
  --me: #0099ff;
  --me2: #2fb4ff;
  --role: #5aa9e6;
  --shadow: 0 1px 2px rgba(17, 20, 24, .06);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
}

/* 手机弹出键盘时：安卓 Chrome 只缩「视觉视口」，布局视口不变，
   于是聊天框被顶上去、消息区却没跟着缩，最新几条被键盘压住。
   两件事一起做 —— viewport 的 interactive-widget=resizes-content（index.html）
   加上下面这条 visualViewport 兜底（app.js 里实时写 --vh）。 */
body {
  display: flex;
  flex-direction: column;
  height: var(--vh, 100%);
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ── 顶部 ───────────────────────────────────────────── */
#bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 10px) 14px 10px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

#bar .icon {
  width: 34px;
  height: 34px;
  font-size: 17px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
#bar .icon:active { background: #eef0f5; }
#bar a.icon { display: grid; place-items: center; text-decoration: none; }

.who { flex: 1; min-width: 0; }
.title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .2px;
}
.sub {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c8ccd6;
  flex: none;
}
.dot.on { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .14); }
.dot.off { background: #ff453a; }

.avatars { display: flex; }
.avatars .a {
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: #dfe3ec;
  box-shadow: var(--shadow);
}

/* ── 消息流 ─────────────────────────────────────────── */
.stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 8px;
  -webkit-overflow-scrolling: touch;
  /* 以前这里是 smooth：切窗口时 renderAll 清空 → scrollTop=0 → 再设到底，
     smooth 把它演成「从最上头一路滑到最下头」。瞬移才对。 */
  scroll-behavior: auto;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }

.msg .ava {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: #e7ebf3;
  box-shadow: var(--shadow);
  user-select: none;
}

.msg .col { max-width: min(74%, 560px); min-width: 0; }

.msg .name {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 3px 2px;
}

.bubble {
  position: relative;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  word-break: break-word;
  white-space: pre-wrap;
}
.bubble:empty { display: none; }

/* 她：左侧气泡 + 小尾巴 */
.msg.her .bubble { border-top-left-radius: 5px; }
.msg.her .bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 9px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
  z-index: -1;
}

/* 我：右侧蓝色气泡 */
.msg.me { flex-direction: row-reverse; }
.msg.me .col { display: flex; flex-direction: column; align-items: flex-end; }
.msg.me .bubble {
  background: linear-gradient(180deg, var(--me2), var(--me));
  color: #fff;
  border-top-right-radius: 5px;
}
.msg.me .bubble::before {
  content: "";
  position: absolute;
  right: -5px;
  top: 9px;
  width: 10px;
  height: 10px;
  background: var(--me);
  transform: rotate(45deg);
  border-radius: 2px;
  z-index: -1;
}

/* 气泡里的图 */
.bubble img {
  display: block;
  max-width: 220px;
  max-height: 260px;
  border-radius: 10px;
  margin: 2px 0;
  cursor: zoom-in;
  object-fit: cover;
}
.bubble img:first-child { margin-top: 0; }
.bubble img:last-child { margin-bottom: 0; }

.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--muted);
}
.msg.me .meta { justify-content: flex-end; }
.meta button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 0 2px;
  cursor: pointer;
  opacity: .75;
}
.meta button:active { opacity: 1; }

/* 时间分割 */
.day {
  margin: 6px auto 14px;
  text-align: center;
}
.day span {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(17, 20, 24, .06);
  color: var(--muted);
  font-size: 11px;
}

/* 正在输入 */
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9bfcc;
  animation: bl 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes bl { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.stage { font-size: 11px; color: var(--muted); margin-top: 2px; margin-left: 2px; }

.sys {
  margin: 8px auto 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

/* ── 回到底部 ───────────────────────────────────────── */
.jump {
  position: fixed;
  right: 16px;
  bottom: calc(var(--safe-b) + 96px);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  box-shadow: 0 3px 12px rgba(17, 20, 24, .14);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  z-index: 15;
}
.jump.on { opacity: 1; pointer-events: auto; }

/* ── 底部输入 ───────────────────────────────────────── */
#compose {
  flex: none;
  padding: 8px 12px calc(var(--safe-b) + 10px);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 20;
}

#compose .row { display: flex; align-items: flex-end; gap: 8px; }

#compose .icon {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f0f2f7;
  color: #444a58;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
#compose .icon.rec { background: #ffe8e6; color: #ff453a; animation: bl .9s infinite; }

#input {
  flex: 1;
  min-height: 36px;
  max-height: 140px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #f0f2f7;
  color: var(--text);
  font: inherit;
  line-height: 20px;
  resize: none;
  outline: none;
}

.send {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--me);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.send:disabled { background: #c3d9ee; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 56px; height: 56px; }
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  opacity: 1;
}
.thumb.uploading img { opacity: .45; }
.thumb button {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #111418;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ── 工具箱 ─────────────────────────────────────────── */
.drawer {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(20px);
  z-index: 40;
  transform: translateY(100%);
  transition: transform .24s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateY(0); }

.drawer-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-head b { font-size: 16px; }
.drawer-head button {
  border: 0;
  background: #f0f2f7;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px calc(var(--safe-b) + 24px);
}
.drawer-body section { margin-bottom: 22px; }
.drawer-body h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .6px;
}

.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow button {
  flex: 1;
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.btnrow button:active { background: #f4f6fa; }

.cmdrow { display: flex; gap: 8px; margin-top: 10px; }
.cmdrow input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.cmdrow button {
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: #eef1f7;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.out {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: #0f1218;
  color: #d7e3f4;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow: auto;
}
.out:empty { display: none; }

.shot-box img {
  display: block;
  width: 100%;
  border-radius: 11px;
  margin-top: 10px;
}
.shot-box .stage { text-align: center; padding: 14px 0; }

.memlist { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.memlist .m {
  padding: 9px 12px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
}
.memlist .m small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }

/* ── 口令页 ─────────────────────────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 90;
}
.gate-box {
  width: min(300px, 84vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gate-emoji { font-size: 42px; }
.gate-title { font-size: 18px; font-weight: 600; }
.gate-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  text-align: center;
  letter-spacing: 3px;
  outline: none;
}
.gate-box button {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--me);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ── toast ──────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 92px);
  transform: translate(-50%, 12px);
  max-width: 82vw;
  padding: 9px 16px;
  border-radius: 11px;
  background: rgba(17, 20, 24, .86);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 60;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── 桌面：窄栏居中，像手机版 QQ ───────────────────── */
@media (min-width: 760px) {
  body {
    background: linear-gradient(180deg, #e9edf5, #dfe4ef);
    align-items: center;
  }
  #bar, .stream, #compose, .jump, .drawer-head, .drawer-body, .drawer { max-width: 720px; width: 100%; }
  #bar, .stream, #compose { margin: 0 auto; }
  body { padding: 0; }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #eaeef6, #dde3ef);
    z-index: -1;
  }
  #bar { border-radius: 0 0 0 0; }
  .stream { padding: 16px 18px; }
}

/* 桌面把整列包成一张卡片 */
@media (min-width: 760px) {
  #bar { border-top-left-radius: 16px; border-top-right-radius: 16px; margin-top: 18px; border: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .stream { background: #f7f8fb; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  #compose { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; border: 1px solid var(--line); border-top: 1px solid var(--line); margin-bottom: 18px; }
}

/* ── 三会话切换（2026-11-13）──────────────────────────────
   群聊 / 小鲸鱼 / 小沫 三个窗口横排，点哪个切哪个。
   宽度靠 flex:1 平分，窄屏（360px）每个约 100px，够放 emoji + 两个字。 */
#tabs {
  flex: 1;
  display: flex;
  gap: 4px;
  min-width: 0;
}

.tab {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  overflow: hidden;
  transition: background .14s, color .14s;
}
.tab .tava { font-size: 15px; line-height: 1; flex: none; }
.tab .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.on { background: #e8f3ff; color: var(--me); font-weight: 600; }
.tab:active { background: #eef0f5; }

.badge {
  position: absolute;
  top: 2px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
}

/* 手机上会话名只留 emoji，避免挤成一条 */
@media (max-width: 400px) {
  .tab .tname { font-size: 12.5px; }
  #bar { gap: 6px; padding-left: 8px; padding-right: 8px; }
}

/* ── 自定义背景（2026-11-13）──────────────────────────────
   #bg 固定铺满最底层，上面压一层浅色蒙版保证气泡可读。
   图存在电脑上（/api/bg），桌面和手机读同一份。 */
html { background: var(--bg); }
body { background: transparent; }

#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: center / cover no-repeat;
}
#bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(248, 249, 252, var(--bg-veil, .78));
}

.hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* 她自己开口时的时间旁小标 */
.auto-mark {
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 6px;
  background: #eef4fb;
  color: #7d95ad;
  font-size: 10.5px;
  line-height: 15px;
}

/* 系统行：他这会儿在刷什么。不抢对话的视觉重心，就是居中一行淡色小字。 */
.sys {
  align-self: center;
  max-width: 88%;
  margin: 2px auto 6px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(120, 140, 170, .07);
  color: #8b93a3;
  font-size: 12px;
  line-height: 17px;
  text-align: center;
  word-break: break-all;
  cursor: default;
}

/* ── 内置浏览器 ─────────────────────────────────────── */
#bar #btn-web { flex: none; }

.web {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}

.web-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}
.web-bar .icon {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #f0f2f7;
  color: #444a58;
  font-size: 15px;
  cursor: pointer;
}
#web-url {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #f0f2f7;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
#web-go {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--me);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.web-tabs {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.web-tabs button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.web-tabs button.on { background: #e8f2fb; color: var(--me); }
.web-tabs #web-reload { margin-left: auto; background: #f0f2f7; color: #444a58; width: 30px; height: 28px; padding: 0; }

.web-pane { flex: 1; min-height: 0; position: relative; }
#web-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
}
#web-read {
  overflow-y: auto;
  padding: 14px 16px 40px;
  -webkit-overflow-scrolling: touch;
}
#web-read .wr-title { font-size: 17px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
#web-read .wr-host { font-size: 12px; color: var(--muted); margin-bottom: 14px; word-break: break-all; }
#web-read .wr-line {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef4fb;
  color: #3f5a73;
  font-size: 13px;
  line-height: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}
#web-read .wr-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 23px;
  color: #2a2f38;
}
.web-note {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(30, 34, 42, .82);
  color: #fff;
  font-size: 12.5px;
  line-height: 18px;
  pointer-events: none;
}

/* ── 她发过来的文件 ─────────────────────────────────────────── */
.bubble.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-width: 170px;
  max-width: 260px;
  padding: 9px 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border: 1px solid rgba(127, 127, 127, .2);
  background: rgba(127, 127, 127, .07);
  white-space: normal;
}
.bubble.file-card:hover {
  border-color: rgba(127, 127, 127, .36);
  background: rgba(127, 127, 127, .12);
}
.bubble.file-card .fc-ico {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
}
.bubble.file-card .fc-main { min-width: 0; }
.bubble.file-card .fc-name {
  font-size: 13.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bubble.file-card .fc-sub {
  margin-top: 2px;
  font-size: 11.5px;
  opacity: .55;
}
.bubble.file-card.bad {
  border-style: dashed;
  background: transparent;
  opacity: .68;
  font-size: 13px;
  cursor: default;
}

/* ── 小屋记录（📖）：他那边的声音 / 天气 / 留言板 / 时间线 ────── */
.house {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}
.house-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}
.house-bar b { flex: 1; }
.house-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 40px;
}
.house-body section {
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}
.house-body h3 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cnt {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: #ff3b30;
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  line-height: 16px;
  text-align: center;
}

/* 声音 + 天气 */
.amb { padding: 10px 12px !important; }
.amb-row {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}
.amb-row + .amb-row { margin-top: 6px; color: #3d4350; }

/* 留言板 */
.board-list { max-height: 42vh; overflow: auto; margin: 0 -2px 8px; }
.board-row {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(127, 127, 127, .05);
  margin-bottom: 6px;
}
.board-row.mine { background: rgba(0, 153, 255, .08); }
.board-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.board-head b { font-size: 12px; font-weight: 600; }
.board-head span { margin-left: auto; opacity: .8; }
.board-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
  flex: none;
}
.board-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 时间线 */
.tl-list { max-height: 46vh; overflow: auto; }
.tl-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 2px;
  font-size: 12.5px;
  line-height: 1.5;
  border-bottom: 1px dashed rgba(127, 127, 127, .14);
}
.tl-row:last-child { border-bottom: 0; }
.tl-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; width: 40px; }
.tl-ic { flex: none; width: 15px; text-align: center; opacity: .9; }
.tl-text { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
.tl-text b { font-weight: 600; }
.tl-sys .tl-text, .tl-sys .tl-ic { color: var(--muted); opacity: .75; }
.tl-note { background: rgba(255, 196, 0, .07); border-radius: 6px; }

/* 气泡里那句「记在留言板上了」 */
.bubble.note-card {
  background: rgba(255, 196, 0, .1);
  border: 1px solid rgba(255, 196, 0, .28);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  cursor: pointer;
}

/* 顶栏 📖 上的小点：面板关着、她有话写进来的时候亮 */
#btn-house { position: relative; }
#btn-house.has-new::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b30;
}

/* ── 屋里那盏灯 ──────────────────────────────────────────
   三档只表示一件事：他还在不在电脑前。
   亮 = 在座 · 微光 = 电脑开着但人久没动 · 暗 = 不在 / 看不出 */
#lamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
#lamp i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8b8f98;
  opacity: .38;
  transition: background .6s, box-shadow .6s, opacity .6s;
}
#lamp.on i {
  background: #ffc247;
  opacity: 1;
  box-shadow: 0 0 6px rgba(255, 194, 71, .85), 0 0 16px rgba(255, 194, 71, .45);
  animation: lampBreath 3.6s ease-in-out infinite;
}
#lamp.dim i {
  background: #c9a25a;
  opacity: .62;
  box-shadow: 0 0 5px rgba(201, 162, 90, .5);
}
#lamp.off i { background: #6f737c; opacity: .3; }
/* 夜里灯更显眼一点：白天它是装饰，夜里它是消息 */
#lamp.on.night i {
  box-shadow: 0 0 9px rgba(255, 200, 90, .95), 0 0 26px rgba(255, 190, 70, .55);
}
@keyframes lampBreath {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 194, 71, .8), 0 0 15px rgba(255, 194, 71, .38); }
  50% { box-shadow: 0 0 10px rgba(255, 200, 90, 1), 0 0 26px rgba(255, 194, 71, .6); }
}

/* ── 一起听：顶栏下面那一细条 ──────────────────────────── */
#nowbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 14px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(127, 134, 151, .95);
  background: rgba(127, 127, 127, .06);
  border-bottom: 1px solid rgba(127, 127, 127, .1);
  white-space: nowrap;
  overflow: hidden;
}
#nowbar.hidden { display: none; }
#nowbar .nb-ic { flex: 0 0 auto; opacity: .8; }
#nowbar .nb-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nowbar.paused { opacity: .6; }
#nowbar.fresh { animation: nowIn 4.2s ease-out both; }
@keyframes nowIn {
  0% { background: rgba(255, 194, 71, .22); color: #b9832a; }
  70% { background: rgba(255, 194, 71, .08); }
  100% { background: rgba(127, 127, 127, .06); color: rgba(127, 134, 151, .95); }
}

/* ── 一句话日记：按天叠 ────────────────────────────────── */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  margin: 8px 0 10px;
}
.d-day {
  border-left: 2px solid rgba(127, 127, 127, .16);
  padding: 2px 0 2px 10px;
}
.d-day.today { border-left-color: rgba(255, 194, 71, .6); }
.d-day-h {
  font-size: 11.5px;
  letter-spacing: .3px;
  color: rgba(127, 134, 151, .85);
  margin-bottom: 4px;
}
.d-day.today .d-day-h { color: #b9832a; font-weight: 600; }
.d-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  line-height: 1.55;
  padding: 1px 0;
}
.d-name { flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
.d-text { min-width: 0; word-break: break-word; }
.d-wx {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 10.5px;
  color: rgba(127, 134, 151, .7);
  white-space: nowrap;
}
#diary-streak { font-weight: 400; font-size: 11px; }

/* nowbar 是 flex column 里的一项：不加 flex:none 会被 .stream 挤压 */
#nowbar { flex: none; }

/* ── 雾：她心里有多少想，就漫开多少（小沫要的，不要数字要颜色）───────
   一层固定的、压在内容下面的雾；每个角色一朵，浓度 = mood × 0.42。
   慢到几乎看不出在动，但一晚上看得出来变浓变淡。 */
#fog {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.fog-blob {
  position: absolute;
  width: 120vmax;
  height: 120vmax;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0;
  transition: opacity 6s ease, background 4s ease;
  mix-blend-mode: normal;
}
.fog-blob.on { animation: fogDrift 46s ease-in-out infinite alternate; }
@keyframes fogDrift {
  from { transform: translate3d(-12%, -8%, 0) scale(1); }
  to   { transform: translate3d(6%, 10%, 0) scale(1.18); }
}

/* ── 戳一戳：屏幕中间荡开一圈 ──────────────────────────────── */
.poke-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  display: none;
}
.poke-fx.on { display: block; }
.poke-fx i {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 2px solid rgba(240, 143, 176, .8);
  animation: pokeRing .9s ease-out forwards;
}
@keyframes pokeRing {
  from { transform: scale(.3); opacity: .95; }
  to   { transform: scale(3.2); opacity: 0; }
}
.poke-fx b {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 22, 30, .82);
  color: #fff;
  white-space: nowrap;
}

/* ── 灯：点一下自己拨 ──────────────────────────────────── */
#lamp { cursor: pointer; }
#lamp.ember i { background: #b9642e; box-shadow: 0 0 5px 1px rgba(185, 100, 46, .55); }
#lamp.ember { opacity: .8; }
.lamp-menu {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(24, 26, 34, .94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}
.lamp-menu.hidden { display: none; }
.lamp-menu button {
  border: 0;
  background: transparent;
  color: #eef1f6;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}
.lamp-menu button:hover { background: rgba(255, 255, 255, .09); }
.lamp-menu .lm-auto { color: rgba(238, 241, 246, .6); border-top: 1px solid rgba(255, 255, 255, .1); }

/* ── 三盏真灯 ─────────────────────────────────────────── */
.health-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.hk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(127, 127, 127, .07);
}
.hk i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #5ec98a; box-shadow: 0 0 6px rgba(94, 201, 138, .7);
  flex: none;
}
.hk.off i { background: #e2564d; box-shadow: 0 0 6px rgba(226, 86, 77, .7); }
.hk .hk-n { font-weight: 600; flex: none; }
.hk .hk-d { color: rgba(127, 134, 151, .85); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk .hk-go {
  margin-left: auto; flex: none;
  border: 0; border-radius: 7px; padding: 4px 9px; font-size: 11.5px;
  background: rgba(226, 86, 77, .14); color: #c9483f; cursor: pointer;
}

/* ── 昨天夜里留下的 ────────────────────────────────────── */
.trace-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.tr-item {
  font-size: 12.5px;
  line-height: 1.55;
  padding: 9px 11px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(120, 130, 170, .09), rgba(120, 130, 170, .04));
  border-left: 2px solid rgba(120, 130, 170, .4);
  color: #4a4f5e;
}
.tr-item .tr-day { display: block; font-size: 10.5px; color: rgba(127, 134, 151, .85); margin-bottom: 2px; }

/* ── 她们心里那点事 ─────────────────────────────────────── */
.feels-list { display: flex; flex-direction: column; gap: 7px; margin: 6px 0 8px; }
.fl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.fl-row .fl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fl-row .fl-name { flex: none; font-weight: 600; }
.fl-row .fl-word { color: rgba(127, 134, 151, .95); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-brake {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; flex: none; margin-left: auto;
  background: rgba(201, 130, 90, .16); color: #a5623a;
}
.fl-free { border: 0; background: rgba(127, 127, 127, .12); color: #5a6070; border-radius: 7px; font-size: 11px; padding: 3px 8px; margin-left: auto; cursor: pointer; }

/* ── 房间图 ───────────────────────────────────────────── */
.rooms-page, .mirror {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(246, 247, 250, .97);
  display: flex;
  flex-direction: column;
}
.rooms-page.hidden, .mirror.hidden { display: none; }
.rooms-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 20px; }
.rooms-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 620px) { .rooms-map { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.room-cell {
  border-radius: 12px;
  padding: 9px 10px;
  min-height: 74px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 40, .06);
  border: 1px solid rgba(20, 24, 40, .05);
}
.room-cell.busy { box-shadow: 0 2px 10px rgba(90, 169, 230, .16); border-color: rgba(90, 169, 230, .35); }
.room-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #3c4152; }
.room-h .room-ic { font-size: 15px; }
.room-h .room-hint { margin-left: auto; font-size: 10px; font-weight: 400; color: rgba(127, 134, 151, .8); }
.room-people { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.room-p {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; padding: 3px 8px; border-radius: 999px;
  background: rgba(127, 127, 127, .1);
}
.room-p .rp-doing { color: rgba(90, 96, 112, .9); font-size: 10.5px; }
.room-empty { font-size: 11px; color: rgba(127, 134, 151, .55); margin-top: 8px; }
.rooms-legend { margin-top: 12px; font-size: 11px; color: rgba(127, 134, 151, .9); line-height: 1.7; }

/* ── 反向窗：她现在 ─────────────────────────────────────── */
.mirror-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mi-card {
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 24, 40, .07);
  border-left: 3px solid var(--role, #8a90a0);
}
.mi-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.mi-h .mi-ava { font-size: 18px; }
.mi-sub { font-size: 12px; color: rgba(90, 96, 112, .9); margin-top: 6px; line-height: 1.6; }
.mi-fog { height: 6px; border-radius: 999px; margin-top: 9px; overflow: hidden; background: rgba(127, 127, 127, .12); }
.mi-fog i { display: block; height: 100%; border-radius: 999px; transition: width .8s ease; }
.mi-row { display: flex; gap: 8px; margin-top: 9px; }
.mi-row button {
  border: 0; border-radius: 9px; padding: 7px 11px; font-size: 12px; cursor: pointer;
  background: rgba(127, 127, 127, .12); color: #44495a;
}
.mi-row button.pri { background: rgba(90, 169, 230, .16); color: #2f6f9f; }
.mi-last { font-size: 11.5px; color: rgba(127, 134, 151, .95); margin-top: 8px; line-height: 1.6; }

/* ── 语音气泡 ─────────────────────────────────────────── */
.voice-bar {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 4px; padding: 6px 10px 6px 8px;
  border-radius: 999px; background: rgba(127, 127, 127, .1);
  font-size: 12px; cursor: pointer; border: 0;
}
.voice-bar .vb-ic { font-size: 13px; }
.voice-bar.playing { background: rgba(90, 169, 230, .18); }

/* ── 私密档：点开才显示 ────────────────────────────────── */
.lock-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(127, 127, 127, .08);
  font-size: 12.5px; cursor: pointer; color: #4a4f5e;
}
.lock-card .lk-ic { font-size: 15px; }
.lock-card .lk-tip { color: rgba(127, 134, 151, .9); font-size: 11px; }

/* 手机壳下载：屋里那个入口 */
.appdl {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  background: linear-gradient(180deg, #5b9df9, #3d7fe0);
  color: #fff; font-size: 13px; text-decoration: none;
  box-shadow: 0 2px 8px rgba(61, 127, 224, .28);
}
.appdl:active { transform: translateY(1px); filter: brightness(.96); }

/* ── 手机横屏 ──────────────────────────────────────────
   横过来以后宽度富裕、高度紧张：桌面那套 720 窄栏在横屏是浪费，
   整屏用满，顶栏/输入栏各压薄一点，把高度全留给消息区。 */
@media (orientation: landscape) and (max-height: 560px) {
  #bar, .stream, #compose, .jump,
  .drawer-head, .drawer-body {
    max-width: none;
    width: 100%;
  }

  #bar {
    padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
    gap: 8px;
    border-radius: 0;
    margin-top: 0;
  }
  #bar .icon { width: 32px; height: 32px; font-size: 16px; }
  .title { font-size: 15px; }
  .sub { display: none; }
  .avatars { display: none; }
  .tab { height: 30px; font-size: 13px; }

  .stream {
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .msg { margin-bottom: 10px; }
  .msg .ava { width: 30px; height: 30px; font-size: 15px; }
  .msg .col { max-width: min(72%, 620px); }
  .bubble { padding: 7px 11px; }

  #compose {
    padding: 6px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
    border-radius: 0;
    margin-bottom: 0;
  }
  #compose .icon { width: 32px; height: 32px; }
  #input { min-height: 34px; max-height: 96px; }

  /* 整屏的抽屉 / 房间里 / 反向窗：横屏改成留边的卡片，别把高度吃光 */
  .drawer {
    inset: 6px max(6px, env(safe-area-inset-right, 0px)) 6px max(6px, env(safe-area-inset-left, 0px));
    width: auto;
    max-width: none;
    border-radius: 14px;
  }
  .drawer-head { padding: 8px 14px; }
  .drawer-body { padding: 10px 14px 14px; }

  .rooms-page, .mirror {
    inset: 6px max(6px, env(safe-area-inset-right, 0px)) 6px max(6px, env(safe-area-inset-left, 0px));
    border-radius: 14px;
  }
  .rooms-body { padding: 8px 12px 12px; }
  .rooms-map { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .room-cell { min-height: 62px; padding: 7px 9px; }
  .mirror-body { padding: 8px 12px; }
}
