/* ============================================================
   Hima Talk Web — 深色主题
   ============================================================ */

:root {
  --bg:        #000000;
  --bg-2:      #0a0a0a;
  --card:      #111111;
  --card-2:    #1a1a1a;
  --line:      #1f1f1f;
  --line-2:    #2a2a2a;
  --text:      #ffffff;
  --text-2:    #d0d0d0;
  --muted:     #8a8a8a;
  --accent:    #2ec4a6;
  --accent-2:  #3dd4b6;
  --accent-d:  #25b096;
  --blue:      #2b8bf6;
  --danger:    #ff3b30;
  --warn:      #ffa726;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.view { display: none; height: 100%; flex-direction: column; }
.view.active { display: flex; }

/* ─────────────────────────────────────────────
   登录界面
   ───────────────────────────────────────────── */

#view-login {
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(46, 196, 166, .10), transparent 65%),
    radial-gradient(700px 400px at 50% 110%, rgba(43, 139, 246, .05), transparent 60%),
    #f2f3f5;
  overflow-y: auto;
  overflow-x: hidden;
}

.login-wrap {
  width: calc(100vw - 40px);
  max-width: 380px;
  min-width: 0;
  animation: rise .38s cubic-bezier(.2, .8, .3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 品牌区 */
.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.logo {
  display: inline-flex;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 18px rgba(16, 185, 129, .32));
}

.login-brand h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}

.login-brand .tagline {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .2px;
}

/* 卡片 */
.login-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px 18px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 34px -16px rgba(17, 20, 24, .16);
}

/* 字段 */
.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: .3px;
}

input[type=text],
input[type=number],
input[type=file],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color .16s, background .16s, box-shadow .16s;
}

input::placeholder,
textarea::placeholder {
  color: #59636f;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(46, 196, 166, .14);
}

/* 按钮 */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  text-align: left;
  transition: transform .12s, background .16s, border-color .16s, box-shadow .16s;
}

.btn:active { transform: scale(.985); }

.btn-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
}

.btn-sub {
  font-size: 12px;
  opacity: .72;
  font-weight: 400;
}

.btn-primary {
  margin-top: 4px;
  background: linear-gradient(180deg, #3dd4b6, #2ec4a6);
  color: #ffffff;
  box-shadow: 0 8px 22px -10px rgba(46, 196, 166, .7);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #4ade80, var(--accent-2));
}

.btn-primary .btn-title { color: #ffffff; }
.btn-primary .btn-sub   { color: rgba(255,255,255,.85); }

.btn-ghost {
  margin-top: 10px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: #232a34;
  border-color: #3d4655;
}

.btn-ghost .btn-title { color: var(--text); }
.btn-ghost .btn-sub   { color: var(--muted); }

/* 分隔线 */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .6px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 账号状态行 */
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.acct-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-all;
}

.btn-mini {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 12px;
  transition: .16s;
}

.btn-mini:hover {
  background: #262e39;
  color: var(--text);
}

/* 底部说明 */
.footnote {
  margin: 20px 0 0;
  text-align: center;
  font-size: 11px;
  color: #4d5765;
  letter-spacing: .2px;
}

/* 消息 */
.msg {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  min-height: 17px;
  line-height: 1.5;
  word-break: break-word;
}

.msg.err { color: var(--danger); }
.msg.ok  { color: var(--accent-2); }

/* 分段控件 */
.seg {
  display: flex;
  gap: 5px;
  background: #f0f2f5;
  border: 1px solid transparent;
  padding: 4px;
  border-radius: 11px;
}

.seg button {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
  transition: .16s;
}

.seg button:hover { color: var(--text-2); }

.seg button.on {
  background: var(--accent);
  color: #04140d;
  font-weight: 650;
  box-shadow: 0 2px 8px -2px rgba(16, 185, 129, .6);
}

/* ─────────────────────────────────────────────
   主界面
   ───────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar #me-name {
  font-weight: 650;
  font-size: 15.5px;
  flex: 1;
}

.me-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card-2);
  border: 1px solid var(--line-2);
}

.link {
  color: var(--text-2);
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 7px;
  transition: .16s;
}

.link:hover {
  color: var(--accent-2);
  background: rgba(16, 185, 129, .1);
}

/* 签名状态条 */
.sig-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.dot.ok   { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot.warn { background: var(--warn); }
.dot.bad  { background: var(--danger); }

.sig-hint {
  padding: 9px 16px;
  background: rgba(245, 158, 11, .1);
  border-bottom: 1px solid rgba(245, 158, 11, .25);
  font-size: 12px;
  color: var(--warn);
}

#sig-text { flex: 1; }

/* Tab 内容 */
#tabs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 84px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Tab 栏 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 20;
}

.tabbar button {
  flex: 1;
  padding: 9px 0;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  transition: color .16s;
  position: relative;
}

.tabbar button.active {
  color: var(--accent-2);
}

.tabbar button.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* 列表 */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: border-color .16s, background .16s;
}

.list li:hover {
  background: #fafbfc;
  border-color: var(--line-2);
}

.list li .meta {
  flex: 1;
  min-width: 0;
}

.list li .t {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list li .s {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 42px;
  background: linear-gradient(135deg, var(--accent-d), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.muted {
  color: var(--muted);
  text-align: center;
  padding: 26px 14px;
  font-size: 13.5px;
}

/* 聊天 / 评论 */
.messages {
  list-style: none;
  margin: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.messages li {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 15px;
  background: #f0f2f5;
  border: none;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  color: var(--text);
}

.messages li.mine {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #04140d;
  border-color: transparent;
  font-weight: 500;
}

.compose {
  display: flex;
  gap: 9px;
  padding: 11px 14px max(11px, env(safe-area-inset-bottom));
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}

.compose input {
  flex: 1;
  margin: 0;
}

/* 主按钮（紧凑） */
.primary {
  background: var(--accent);
  color: #04140d;
  font-weight: 650;
  border-radius: 10px;
  padding: 11px 18px;
  transition: .16s;
}

.primary:hover { background: var(--accent-2); }
.primary.sm   { padding: 8px 15px; font-size: 13.5px; }
.primary.wide { width: 100%; margin-bottom: 11px; }

/* 编辑面板（已有） */
.edit-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px 16px;
  margin: 10px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.edit-panel[hidden] { display: none; }

.edit-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.edit-row label {
  width: 82px;
  flex: 0 0 82px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}

.edit-row input,
.edit-row select,
.edit-row textarea {
  flex: 1;
  padding: 9px 11px;
  font-size: 14px;
  background: #ffffff;
  resize: vertical;
}

.edit-actions {
  display: flex;
  gap: 11px;
  align-items: center;
}

.edit-actions .primary {
  width: auto;
  padding: 8px 22px;
}

/* 日志 */
.log {
  position: fixed;
  bottom: 62px;
  left: 10px;
  right: 10px;
  max-height: 96px;
  overflow-y: auto;
  padding: 8px 11px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
  display: none;
  box-shadow: 0 4px 16px -6px rgba(0,0,0,.12);
}

.log.show { display: block; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d6dae0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #c2c8d0; }

/* 移动端适配 */
@media (max-width: 420px) {
  .login-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px 18px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 34px -16px rgba(17, 20, 24, .16);
}
  .login-brand h1 { font-size: 24px; }
  #tabs { padding: 12px 12px 80px; }
}

/* ============================================================
   聊天页 —— 对齐 App（浅色 + 白色背景）
   ============================================================ */

#view-room {
  background: #ffffff;
  color: #111418;
}

/* 顶部栏 */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f7f8fa;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-back,
.chat-more {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #2ec4a6;
  background: transparent;
  transition: background .15s;
}

.chat-back:hover,
.chat-more:hover {
  background: rgba(46, 196, 166, .1);
}

.chat-more {
  font-size: 20px;
  line-height: 1;
  color: #9aa3ad;
}

.chat-peer {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9ecef;
  flex: 0 0 34px;
}

.chat-peer-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#room-title {
  font-size: 15px;
  font-weight: 600;
  color: #111418;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sub {
  font-size: 11.5px;
  color: #9aa3ad;
}

/* 消息区 */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #ffffff;
}

/* 时间分隔 */
.chat-time {
  align-self: center;
  margin: 12px 0 8px;
  font-size: 11px;
  color: #9aa3ad;
  padding: 2px 10px;
}

/* 消息行 */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 2px;
  max-width: 100%;
}

.chat-row.mine {
  flex-direction: row-reverse;
}

.chat-row .bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: 0 0 30px;
  object-fit: cover;
  background: #e9ecef;
}

.chat-row .bubble-avatar.blank {
  background: transparent;
}

/* 气泡 */
.bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 17px;
  font-size: 14.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  background: #f0f2f5;
  color: #111418;
  border-bottom-left-radius: 5px;
}

.chat-row.mine .bubble {
  background: #2ec4a6;
  color: #ffffff;
  border-bottom-left-radius: 17px;
  border-bottom-right-radius: 5px;
}

/* 消息尾部时间 */
.bubble-time {
  font-size: 10.5px;
  color: #b0b7c0;
  margin: 1px 4px 6px;
}


/* 图片消息 */
.bubble.image {
  padding: 4px;
  background: #f0f2f5;
}

.chat-row.mine .bubble.image {
  background: #2ec4a6;
}

.bubble.image img {
  display: block;
  max-width: 200px;
  border-radius: 13px;
}

/* 输入区 */
.chat-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px max(9px, env(safe-area-inset-bottom));
  background: #f7f8fa;
  border-top: 1px solid #e5e7eb;
}

.composer-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9ecef;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-composer input {
  flex: 1;
  margin: 0;
  padding: 9px 15px;
  border-radius: 19px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111418;
  font-size: 14.5px;
}

.chat-composer input:focus {
  border-color: #2ec4a6;
  box-shadow: 0 0 0 3px rgba(46, 196, 166, .12);
  background: #ffffff;
}

.composer-send {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2ec4a6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
}

.composer-send:hover { background: #25b096; }
.composer-send:active { transform: scale(.94); }
/* ── 筛选区（找人）───────────────────────────── */
.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range input {
  width: 64px;
  flex: 0 0 64px;
  padding: 9px 10px;
  text-align: center;
  font-size: 14px;
  border-radius: 9px;
}

.range span {
  color: var(--muted);
  font-size: 13px;
  flex: 0 0 auto;
}

.range button {
  margin-left: auto;
  flex: 0 0 auto;
}

/* 顶部模式标签 */
#btn-mode {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(46, 196, 166, .12);
  color: var(--accent);
}
/* ============================================================
   聊天列表（トーク）—— 对齐 App 深色
   ============================================================ */

#list-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #1a1a1a;
  cursor: pointer;
  transition: background .12s;
}

.room-item:hover {
  background: #0d0d0d;
}

.room-item:active {
  background: #141414;
}

/* 头像：圆形 + 青绿描边 */
.room-avatar {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #1e2a2a;
  color: #2ec4a6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px #2ec4a6;
}

.room-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 中间内容 */
.room-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.room-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.room-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-time {
  flex: 0 0 auto;
  font-size: 12px;
  color: #7a7a7a;
}

.room-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-last {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: #8a8a8a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 「我：」标记：最后一条是自己发的 */
.room-me {
  color: #35d0a5;
  font-weight: 600;
  margin-right: 1px;
}

/* 聊天列表顶部的会话计数条 */
.rooms-head {
  padding: 2px 16px 8px;
  font-size: 11.5px;
  color: #6d6d6d;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}

.room-unread {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 未读条数未知时（服务端不下发确切条数）：改成「空心红」——实心=精确条数，空心=至少 1 条 */
.room-unread.approx {
  background: transparent;
  color: #ff6b62;
  border: 1px solid rgba(255, 59, 48, .8);
  line-height: 16px;
  font-weight: 600;
}
/* ============================================================
   App 风格顶栏 / TabBar（深色）
   ============================================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 10px;
  background: #000;
  position: sticky;
  top: 0;
  z-index: 12;
}

.hdr-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #2ec4a6;
  letter-spacing: .5px;
}

.hdr-pill {
  padding: 7px 16px;
  border-radius: 18px;
  background: #1c1c1e;
  color: #d0d0d0;
  font-size: 13.5px;
  font-weight: 500;
}

.hdr-pill:hover { background: #2a2a2c; }

.hdr-round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1c1c1e;
  color: #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdr-round:hover { background: #2a2a2c; }

/* 我的信息条 */
.me-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 10px;
  background: #000;
  font-size: 12px;
  color: var(--muted);
}

.me-strip #me-name {
  flex: 1;
  font-size: 13px;
  color: #d0d0d0;
  font-weight: 500;
}

/* 底部 TabBar：深色圆角浮起 */
.app-tabbar {
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  background: #141414;
  border: 1px solid #222;
  border-radius: 26px;
  padding: 8px 6px;
  z-index: 20;
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, .9);
  backdrop-filter: blur(20px);
}

.app-tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  border-radius: 18px;
  color: #7a7a7a;
  position: relative;
  transition: color .15s, background .15s;
}

.app-tabbar button.active {
  color: #2ec4a6;
  background: rgba(46, 196, 166, .10);
}

.tab-ico {
  font-size: 19px;
  line-height: 1;
  filter: grayscale(1) brightness(1.6);
  opacity: .75;
}

.app-tabbar button.active .tab-ico {
  filter: none;
  opacity: 1;
}

.tab-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .2px;
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(16px);
  background: #ff3b30;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 7px;
  line-height: 1.4;
  display: none;
}

.tab-badge.show { display: block; }

/* 内容区底部留白（给浮起的 tabbar） */
#tabs {
  padding-bottom: 96px !important;
}

/* 深色输入框 */
input[type=text],
input[type=number],
textarea,
select {
  background: #1c1c1e;
  border-color: #2a2a2c;
  color: #ffffff;
}

input::placeholder,
textarea::placeholder {
  color: #5a5a5a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2ec4a6;
  background: #1c1c1e;
  box-shadow: 0 0 0 3px rgba(46, 196, 166, .16);
}

/* 分段控件深色 */
.seg {
  background: #1c1c1e;
  border-color: #2a2a2c;
}

.seg button { color: #8a8a8a; }

.seg button.on {
  background: #2ec4a6;
  color: #fff;
  box-shadow: none;
}

/* 卡片深色 */
.login-card,
.edit-panel,
.list li,
.room-item {
  background: #111;
  border-color: #1f1f1f;
}

.tabbar { display: none !important; }

/* 聊天详情页也深色 */
#view-room {
  background: #000;
  color: #fff;
}

.chat-header {
  background: #000;
  border-bottom-color: #1f1f1f;
}

.chat-back, .chat-more { color: #2ec4a6; }
#room-title { color: #fff; }
.chat-sub { color: #8a8a8a; }

.chat-body { background: #000; }

.chat-time { color: #6a6a6a; }

.bubble {
  background: #1c1c1e;
  color: #fff;
}

.chat-row.mine .bubble {
  background: #2ec4a6;
  color: #fff;
}

.bubble-time { color: #5a5a5a; }

.chat-composer {
  background: #0a0a0a;
  border-top-color: #1f1f1f;
}

.chat-composer input {
  background: #1c1c1e;
  border-color: #2a2a2c;
  color: #fff;
}

.composer-btn {
  background: #1c1c1e;
  color: #8a8a8a;
}

/* 消息列表（帖子评论）深色 */
.messages li {
  background: #1c1c1e;
  color: #fff;
}

/* 顶栏（旧 class 兼容） */
.topbar {
  background: #000;
  border-bottom-color: #1f1f1f;
}

/* 签名条 */
.sig-bar {
  background: #0a0a0a;
  border-bottom-color: #1f1f1f;
}

/* 列表空态 */
.muted { color: #6a6a6a; }
/* ============================================================
   用户详情页
   ============================================================ */

#view-user {
  background: #000;
  color: #fff;
}

.user-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 100px;
}

.user-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 0 24px;
}

.user-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #1a2a26;
  color: #2ec4a6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 0 0 2px #2ec4a6, 0 12px 32px -12px rgba(46,196,166,.4);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-hero h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.user-meta {
  margin: 0;
  font-size: 13.5px;
  color: #8a8a8a;
}

.user-section {
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  padding: 16px;
}

.user-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #2ec4a6;
  letter-spacing: .5px;
  margin-bottom: 10px;
}

.user-bio {
  font-size: 14.5px;
  line-height: 1.7;
  color: #d0d0d0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 底部操作 */
.user-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 12px;
  padding: 14px 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(0,0,0,0), #000 30%);
}

.act-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 650;
  transition: transform .1s, background .16s;
}

.act-btn:active { transform: scale(.97); }

.act-yoro {
  background: #1c1c1e;
  color: #ffd166;
  border: 1px solid #2a2a2c;
}

.act-yoro:hover { background: #252527; }

.act-yoro.done {
  background: #1a2a26;
  color: #2ec4a6;
  border-color: #2ec4a6;
}

.act-talk {
  background: linear-gradient(180deg, #3dd4b6, #2ec4a6);
  color: #05261f;
  box-shadow: 0 8px 24px -10px rgba(46,196,166,.8);
}

.act-talk:hover { background: linear-gradient(180deg, #4ee0c2, #3dd4b6); }

.act-ico {
  font-size: 18px;
  line-height: 1;
}

/* 搜索结果项可点 */
.list li.clickable { cursor: pointer; }
/* 未读数：TabBar 角标 & 会话角标统一口径 */
.tab-badge { min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.tab-badge[hidden], .tab-badge.zero { display: none !important; }

/* 用户列表「加载更多」 */
.more-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 12px auto 96px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #eee;
  font-size: 14px;
}
.more-btn[hidden] { display: none; }

/* 构建标记（右下角小字） */
.build-stamp {
  position: fixed;
  right: 8px;
  bottom: 82px;
  font-size: 10.5px;
  color: #5f5f5f;
  letter-spacing: .4px;
  opacity: .85;
  pointer-events: none;
  z-index: 9999;
  font-variant-numeric: tabular-nums;
}

/* 气泡里的图片缩略图 */
.bubble-photo{display:block;max-width:190px;max-height:190px;border-radius:12px;}
.bubble-link{color:#7fe3c4;text-decoration:underline;word-break:break-all;}

/* 打招呼冷却态 */
.act-btn.cooling{opacity:.45;filter:grayscale(1);pointer-events:auto;cursor:not-allowed;}
.act-btn.cooling .act-label{font-variant-numeric:tabular-nums;}

/* ============================================================
   App 风格 toast（替代原生 alert）
   ============================================================ */
#toast-layer {
  position: fixed;
  left: 0; right: 0;
  bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 99999;
  pointer-events: none;
}
.app-toast {
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(28, 30, 34, .96);
  color: #e8f5ef;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.08);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  white-space: pre-wrap;
  word-break: break-word;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast.ok   { border-color: rgba(16,185,129,.55); }
.app-toast.ok::before   { content: '✓ '; color: #10b981; font-weight: 700; }
.app-toast.err  { border-color: rgba(239,68,68,.55); }
.app-toast.err::before  { content: '✗ '; color: #ef4444; font-weight: 700; }
.app-toast .toast-sub { display:block; margin-top:6px; font-size:11.5px; color:#9aa5a0; }

/* 没有头像时的首字母占位（退会したユーザー 等） */
.bubble-avatar.avatar-fallback{display:flex;align-items:center;justify-content:center;background:#2a2f33;color:#8b959c;font-size:13px;font-weight:700;border-radius:50%;width:32px;height:32px;flex:0 0 auto;}

/* 退会用户房间的禁发提示条 */
.room-gone-tip{padding:10px 14px;margin:0 12px 8px;border-radius:12px;background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.35);color:#ff8a8a;font-size:12.5px;text-align:center;}
.chat-composer input:disabled{opacity:.55;}
.chat-composer button:disabled{opacity:.35;}

/* ── 会话列表分组（未返信 / 返信済）─────────────── */
.room-filter {
  display: flex;
  gap: 6px;
  margin: 8px 12px 10px;
}
.room-filter button {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: rgba(255,255,255,.05);
  color: #bbb;
  font-size: 12.5px;
}
.room-filter button.on {
  background: rgba(255,59,48,.16);
  border-color: rgba(255,59,48,.55);
  color: #ff8a80;
  font-weight: 600;
}
.room-section {
  margin: 14px 12px 6px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #8b8b8b;
  background: transparent;
  border: none;
}
.room-section::after {
  content: "";
  display: inline-block;
  width: calc(100% - 84px);
  height: 1px;
  margin-left: 8px;
  vertical-align: middle;
  background: rgba(255,255,255,.08);
}

/* 「只看有文字」开关 */
.only-text {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 12px 10px;
  font-size: 12.5px;
  color: #8b8b8b;
  user-select: none;
}
.only-text input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ff3b30;
}

/* ============================================================
   登录门 / 后台管理 / 翻译
   ============================================================ */
#auth-gate { display: flex; align-items: center; justify-content: center; padding: 24px; }
#auth-gate[hidden] { display: none !important; }
.auth-box { width: 100%; max-width: 340px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 24px 20px; }
.auth-title { margin: 0 0 4px; font-size: 22px; color: #10b981; text-align: center; }
.auth-sub { margin: 0 0 18px; font-size: 13px; color: #9aa5a0; text-align: center; }
.auth-hint { margin: 14px 0 0; font-size: 11.5px; color: #78837e; text-align: center; line-height: 1.5; }
.auth-box .edit-row { margin-bottom: 12px; }
.auth-box input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: #14171a; color: #e8f5ef; font-size: 14px; }
.auth-box button.primary { width: 100%; margin-top: 6px; }

.admin-panel { margin-top: 12px; }
.admin-user { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); margin-bottom: 8px; }
.admin-user .u-name { font-weight: 600; color: #e8f5ef; }
.admin-user .u-meta { font-size: 11px; color: #8b959c; flex: 1; word-break: break-all; }
.admin-user .u-del { background: none; border: 1px solid rgba(239,68,68,.5); color: #ff8a8a; border-radius: 8px; padding: 4px 10px; font-size: 12px; }

.bubble-tr { position: absolute; top: -8px; right: -6px; }
.bubble-trans-btn { border: none; background: rgba(16,185,129,.9); color: #06231b; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 2px 7px; cursor: pointer; }
.bubble-trans { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(255,255,255,.18); font-size: 12.5px; color: #b8c6bf; }
.bubble-wrap { position: relative; }
