:root {
  --bg-deep: #0a2a26;
  --bg-mid: #12443c;
  --bg-soft: #f5f7f6;
  --surface: #ffffff;
  --ink: #14201e;
  --ink-muted: #5a6e69;
  --accent: #1a7a68;
  --accent-deep: #0e5a4c;
  --accent-soft: #e8f4f0;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --bubble-me: #95ec69;
  --bubble-other: #ffffff;
  --shadow: 0 12px 40px rgba(10, 42, 38, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --p1: #1a7a68; --p2: #2f6fed; --p3: #c45c26; --p4: #7a4dbf;
  --p5: #b42318; --p6: #0e7490; --p7: #a16207; --p8: #be185d;
  --p9: #365314; --p10: #1e3a5f; --p11: #9a3412; --p12: #4c1d95;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-tap-highlight-color: transparent;
}

body { overscroll-behavior: none; }

#app {
  min-height: 100%;
  min-height: 100dvh;
  height: 100dvh;
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  min-height: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

#screen-chat {
  min-height: 0;
  position: relative;
  flex-direction: row;
}
.rooms-rail {
  width: 260px;
  flex-shrink: 0;
  background: #fafbfb;
  border-right: 1px solid rgba(20, 32, 30, 0.06);
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rooms-rail[hidden],
#screen-chat.no-rooms-rail .rooms-rail {
  display: none !important;
}
.rooms-rail-head {
  flex-shrink: 0;
  padding: 0.7rem 0.85rem 0.55rem;
  border-bottom: 1px solid rgba(20, 32, 30, 0.06);
  text-align: center;
  background: #f3f7f5;
  position: relative;
}
.rooms-rail-head h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.rooms-rail-head .rail-title-main {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.rooms-rail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-content: flex-start;
  padding: 0.55rem 0.45rem;
  box-sizing: border-box;
}
.rail-owner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0;
}
.rail-owner-actions[hidden] {
  display: none !important;
}
.rail-owner-actions .rail-create-btn {
  flex: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.sidebar-rooms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  flex: 0 0 auto;
}
.rail-log-btn {
  appearance: none;
  border: 1px solid rgba(20, 32, 30, 0.08);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  padding: 0.28rem 0.45rem;
  margin: 0.25rem 0.45rem 0.45rem;
  width: calc(100% - 0.9rem);
  text-align: left;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  box-sizing: border-box;
  min-height: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.rail-log-btn:hover {
  background: #e8f6f1;
  border-color: rgba(26, 122, 104, 0.35);
  box-shadow: 0 2px 8px rgba(10, 42, 38, 0.08);
}
.rail-log-btn:active {
  background: #d8f0e8;
}
.rail-create-btn {
  appearance: none;
  border: 1.5px dashed rgba(26, 122, 104, 0.4);
  background: rgba(26, 122, 104, 0.06);
  color: var(--accent-deep);
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  margin: 0;
  width: 100%;
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    color 0.15s ease, transform 0.12s ease;
}
.rail-create-btn:hover {
  background: rgba(26, 122, 104, 0.14);
  border-color: rgba(26, 122, 104, 0.72);
  border-style: solid;
  color: #0f5c4e;
  box-shadow: 0 2px 8px rgba(26, 122, 104, 0.16);
}
.rail-create-btn:active {
  background: rgba(26, 122, 104, 0.2);
  transform: scale(0.98);
  box-shadow: none;
}
.rail-create-btn[hidden] {
  display: none !important;
}
.rail-log-btn[hidden] {
  display: none !important;
}
.rail-log-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-deep, #1a7a68);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1.2;
}
.rail-log-latest {
  font-size: 0.72rem;
  color: var(--ink-muted);
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-log-latest.is-reenter {
  color: #2f6fed;
  font-weight: 500;
}
.rail-log-latest.is-leave {
  color: #e03434;
  font-weight: 500;
}
.logs-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.logs-list li {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(20, 32, 30, 0.04);
  line-height: 1.45;
}
.logs-list .log-text {
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-word;
}
.logs-list li.is-reenter .log-text {
  color: #2f6fed;
  font-weight: 500;
}
.logs-list li.is-leave .log-text {
  color: #e03434;
  font-weight: 500;
}
.logs-list .log-time {
  margin-left: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.sidebar-rooms-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 58px;
  padding: 0.55rem 0.55rem;
  border-radius: 12px;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
  background: #fff;
  border: 1.5px solid rgba(20, 32, 30, 0.12);
  box-shadow: 0 1px 4px rgba(10, 42, 38, 0.04);
}
.sidebar-rooms-list li:hover,
.sidebar-rooms-list li:active {
  background: #e8f6f1;
  border-color: rgba(26, 122, 104, 0.42);
  box-shadow: 0 6px 16px rgba(10, 42, 38, 0.16);
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.03);
}
.sidebar-rooms-list li:active {
  transform: translateY(0) scale(0.99);
  filter: none;
  box-shadow: 0 2px 8px rgba(10, 42, 38, 0.1);
}
.sidebar-rooms-list li.active {
  background: #d8f0e8;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(26, 122, 104, 0.14);
  transform: none;
  filter: none;
}
.sidebar-rooms-list li.active:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 16px rgba(26, 122, 104, 0.2);
}
.sidebar-rooms-list .rail-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.sidebar-rooms-list .rail-avatar {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 0.95rem;
  border-radius: 10px;
}
.sidebar-rooms-list .rail-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-sizing: border-box;
  border: 2px solid #fff;
  z-index: 2;
}
.sidebar-rooms-list .rail-badge[hidden] {
  display: none !important;
}
.sidebar-rooms-list li.has-unread {
  border-color: #fa5151;
  background: #fff5f5;
  box-shadow: 0 0 0 1px rgba(250, 81, 81, 0.35), 0 4px 14px rgba(250, 81, 81, 0.22);
  animation: room-unread-pulse 1.1s ease-in-out infinite;
}
@keyframes room-unread-pulse {
  0%, 100% {
    background: #fff5f5;
    border-color: #fa5151;
    box-shadow: 0 0 0 1px rgba(250, 81, 81, 0.4), 0 4px 14px rgba(250, 81, 81, 0.25);
  }
  50% {
    background: #ffd6d6;
    border-color: #e03434;
    box-shadow: 0 0 0 3px rgba(250, 81, 81, 0.55), 0 6px 18px rgba(250, 81, 81, 0.4);
  }
}
.sidebar-rooms-list .rail-avatar-wrap[hidden] {
  display: none !important;
}
/* 无默认头像时仅保留未读角标占位 */
.sidebar-rooms-list .rail-avatar-wrap:has(.rail-avatar[hidden]):not([hidden]) {
  width: 1.1rem;
  height: 1.1rem;
  align-self: center;
}
.sidebar-rooms-list .rail-avatar[hidden] {
  display: none !important;
}
.sidebar-rooms-list .meta {
  flex: 1;
  min-width: 0;
}
.sidebar-rooms-list .name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-rooms-list .sub {
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-rooms-list .enter-tag {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
}
.sidebar-rooms-list li.active .enter-tag {
  background: var(--accent-deep);
  color: #fff;
}
.chat-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.members-rail {
  width: 248px;
  flex-shrink: 0;
  background: #f3f7f5;
  border-left: 1px solid rgba(20, 32, 30, 0.06);
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
@media (min-width: 980px) {
  .members-rail:not([hidden]) {
    display: flex;
  }
}
.members-rail[hidden],
#screen-chat.no-members-rail .members-rail {
  display: none !important;
}
.members-rail-head {
  flex-shrink: 0;
  padding: 0.7rem 0.85rem 0.55rem;
  border-bottom: 1px solid rgba(20, 32, 30, 0.06);
  text-align: center;
}
.members-rail-head h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.members-rail-head .rail-title-main {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.members-rail-head .rail-title-sep {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.members-rail-head .rail-title-online {
  font-size: 0.7rem;
  font-weight: 600;
  color: #16a34a;
}
.members-rail-head .rail-online-word {
  color: #14532d;
  font-weight: 700;
}
.members-rail-sub {
  display: none !important;
}
.members-rail-list {
  list-style: none;
  margin: 0;
  padding: 0.45rem 0.55rem 0.8rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.members-rail-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid rgba(20, 32, 30, 0.11);
  box-shadow: 0 1px 3px rgba(10, 42, 38, 0.04);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    filter 0.16s ease;
}
.members-rail-list li.is-clickable {
  cursor: pointer;
}
.members-rail-list li.is-clickable:hover,
.members-rail-list li:hover {
  background: #e8f6f1;
  border-color: rgba(26, 122, 104, 0.4);
  box-shadow: 0 6px 16px rgba(10, 42, 38, 0.16);
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.03);
}
.members-rail-list li.is-clickable:active,
.members-rail-list li:active {
  background: var(--accent-soft);
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 6px rgba(14, 90, 76, 0.1);
  filter: none;
}
.members-rail-list .avatar {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  font-size: 0.72rem;
}
.members-rail-list .meta {
  min-width: 0;
  flex: 1;
}
.members-rail-list .member-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.members-rail-list .member-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.members-rail-list .tag {
  font-size: 0.58rem;
  padding: 0.05rem 0.28rem;
  border-radius: 999px;
  background: rgba(26, 122, 104, 0.1);
  color: var(--accent-deep);
}
.members-rail-list .tag-online {
  background: rgba(22, 163, 74, 0.16);
  color: #14532d;
  font-size: 0.68rem;
  font-weight: 700;
}
.members-rail-list .tag-offline {
  background: rgba(90, 110, 105, 0.12);
  color: #6b7c77;
  font-size: 0.68rem;
  font-weight: 600;
}
.members-rail-list .tag-mute {
  background: rgba(180, 130, 0, 0.2);
  color: #a67c00;
  font-weight: 700;
}
.members-rail-list .member-net,
.members-rail-list .member-client,
.members-rail-list .member-remark {
  margin-top: 0.12rem;
  font-size: 0.58rem;
  color: var(--ink-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.members-rail-list .member-client {
  color: #3a5a9a;
}
.members-rail-list .member-remark-text {
  font-weight: 500;
}
.members-rail-empty {
  margin: 1.2rem 0.6rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* 成员设置：靠卡片弹出的小菜单（同「有人@了你」深色主题） */
.member-pop-menu {
  position: fixed;
  z-index: 520;
  min-width: 7.6rem;
  max-width: 11rem;
  padding: 0.32rem;
  background: #2f3437;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  -webkit-font-smoothing: antialiased;
}
.member-pop-menu[hidden] {
  display: none !important;
}
.member-pop-menu.is-in-rail {
  min-width: 0;
  width: auto;
  max-width: 232px;
  box-sizing: border-box;
}
.member-pop-menu.is-in-sheet {
  min-width: 0;
  max-width: min(220px, 72vw);
  box-sizing: border-box;
  z-index: 620;
}
.member-pop-title {
  padding: 0.32rem 0.58rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-pop-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.62rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  line-height: 1.3;
}
.member-pop-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.member-pop-item.is-remark-action {
  color: #7eb6ff;
}
.member-pop-item.is-remark-action:hover {
  background: rgba(126, 182, 255, 0.16);
  color: #a8ceff;
}
.member-pop-item.is-admin-on,
.member-pop-item.is-mute-on {
  color: #9fd6c4;
}
.member-pop-item.is-danger-action {
  color: #f07178;
}
.member-pop-item.is-ban-action,
.member-pop-item.is-ban-on {
  color: #e0a070;
}
.member-pop-item.is-danger-action:hover {
  background: rgba(240, 113, 120, 0.16);
  color: #ff8a90;
}
.member-pop-item.is-ban-action:hover,
.member-pop-item.is-ban-on:hover {
  background: rgba(224, 160, 112, 0.16);
  color: #f0b888;
}
.members-rail-list .avatar {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  font-size: 0.72rem;
}
.members-rail-list .meta {
  min-width: 0;
  flex: 1;
}
.members-rail-list .member-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.members-rail-list .member-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.members-rail-list .tag {
  font-size: 0.58rem;
  padding: 0.05rem 0.28rem;
  border-radius: 999px;
  background: rgba(26, 122, 104, 0.1);
  color: var(--accent-deep);
}
.members-rail-list .tag-online {
  background: rgba(22, 163, 74, 0.16);
  color: #14532d;
  font-size: 0.68rem;
  font-weight: 700;
}
.members-rail-list .tag-offline {
  background: rgba(90, 110, 105, 0.12);
  color: #6b7c77;
  font-size: 0.68rem;
  font-weight: 600;
}
.members-rail-list .tag-mute {
  background: rgba(180, 130, 0, 0.2);
  color: #a67c00;
  font-weight: 700;
}
.members-rail-list .member-net,
.members-rail-list .member-client,
.members-rail-list .member-times,
.members-rail-list .member-remark {
  margin-top: 0.12rem;
  font-size: 0.58rem;
  color: var(--ink-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.members-rail-list .member-client {
  color: #3a5a9a;
}
.members-rail-list .member-remark-text {
  font-weight: 500;
}
.members-rail-empty {
  margin: 1.2rem 0.6rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.chat-header {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  #app { max-width: 100%; }
  .rooms-rail { width: 210px; }
  .rooms-rail-scroll { padding: 0.4rem 0.3rem; }
  .sidebar-rooms-list .name { font-size: 0.85rem; }
  .sidebar-rooms-list .sub { font-size: 0.68rem; }
}
@media (max-width: 560px) {
  .rooms-rail { width: 168px; }
  .sidebar-rooms-list li { padding: 0.45rem 0.4rem; gap: 0.45rem; min-height: 52px; }
  .sidebar-rooms-list .rail-avatar { width: 2.1rem; height: 2.1rem; }
  .sidebar-rooms-list .enter-tag { font-size: 0.7rem; }
  /* 手机端用底部抽屉切群，左侧栏隐藏，聊天区全宽 */
  #screen-chat.mobile-rooms-sheet .rooms-rail {
    display: none !important;
  }
  #screen-chat.mobile-rooms-sheet .chat-main {
    width: 100%;
    flex: 1;
    min-width: 0;
  }
  .chat-rooms-btn {
    position: relative;
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-deep);
    background: var(--accent-soft);
    border: 1px solid rgba(26, 122, 104, 0.22);
  }
  .chat-rooms-btn[hidden] {
    display: none !important;
  }
  .chat-rooms-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fa5151;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 2px solid #fff;
    pointer-events: none;
    z-index: 2;
  }
  .chat-rooms-badge[hidden] {
    display: none !important;
  }
}
.rooms-sheet-panel {
  max-height: min(78dvh, 640px);
  display: flex;
  flex-direction: column;
}
.rooms-sheet-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.35rem 0 0.5rem;
  max-height: 52dvh;
}
.rooms-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}
.rooms-sheet-actions .btn {
  width: 100%;
  margin: 0;
}

/* Avatars — 圆角方形 */
.avatar, .avatar-lg, .avatar-xl, .avatar-sm {
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-weight: 600;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.avatar-sm { width: 1.85rem; height: 1.85rem; font-size: 0.72rem; }
.avatar { width: 2.1rem; height: 2.1rem; font-size: 0.85rem; }
.avatar-lg { width: 2.6rem; height: 2.6rem; font-size: 1rem; }
.avatar-xl { width: 3.4rem; height: 3.4rem; font-size: 1.2rem; }
/* 聊天消息头像 */
.msg .avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.78rem;
  border-radius: 10px;
}

.preset-1 { background: var(--p1); color: #fff; }
.preset-2 { background: var(--p2); color: #fff; }
.preset-3 { background: var(--p3); color: #fff; }
.preset-4 { background: var(--p4); color: #fff; }
.preset-5 { background: var(--p5); color: #fff; }
.preset-6 { background: var(--p6); color: #fff; }
.preset-7 { background: var(--p7); color: #fff; }
.preset-8 { background: var(--p8); color: #fff; }
.preset-9 { background: var(--p9); color: #fff; }
.preset-10 { background: var(--p10); color: #fff; }
.preset-11 { background: var(--p11); color: #fff; }
.preset-12 { background: var(--p12); color: #fff; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.avatar-grid button {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  color: #fff;
}
.avatar-grid button.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

.profile-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0.55rem;
}

/* Welcome */
.welcome-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 10% 0%, rgba(26, 122, 104, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 20%, rgba(200, 235, 226, 0.35), transparent 50%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg-mid) 48%, #1a4f47 100%);
  z-index: 0;
}
.welcome-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(to top, var(--surface) 50%, transparent);
}
.welcome-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem calc(2rem + var(--safe-bottom));
  gap: 0.75rem;
}
.brand {
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1;
  color: #f2faf7;
  margin: 0 0 0.35rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 8px rgba(10, 42, 38, 0.35);
  animation: rise 0.7s ease both;
  max-width: 100%;
}
.brand.is-room-name {
  font-size: 2.35rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  word-break: break-word;
}
@media (max-width: 390px) {
  .welcome-inner {
    padding: 1.35rem 1.1rem calc(1.35rem + var(--safe-bottom));
    gap: 0.55rem;
  }
  .brand {
    font-size: 2.55rem;
  }
  .brand.is-room-name {
    font-size: 1.75rem;
  }
  .welcome-title {
    font-size: 1.35rem;
  }
  .welcome-invite-avatar {
    width: 4rem;
    height: 4rem;
    font-size: 1.45rem;
    margin-bottom: 0.55rem;
  }
}
.welcome-invite-avatar {
  width: 4.6rem;
  height: 4.6rem;
  font-size: 1.7rem;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(10, 42, 38, 0.28);
  margin: 0 auto 0.85rem;
  animation: rise 0.7s ease both;
}
.welcome-invite-avatar[hidden] {
  display: none !important;
}
.welcome-title.welcome-title-sm {
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 500;
  opacity: 0.92;
}
.announce-panel .announce-text {
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f0f7f4;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 40vh;
  overflow-y: auto;
}
.announce-panel .btn-primary {
  width: 100%;
}
.welcome-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  color: #f2faf7;
  margin: 0;
  text-shadow: 0 1px 6px rgba(10, 42, 38, 0.35);
  animation: rise 0.7s 0.08s ease both;
  max-width: 100%;
}
.welcome-sub {
  color: rgba(242, 250, 247, 0.92);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 1.25rem;
  max-width: 22rem;
  text-shadow: 0 1px 4px rgba(10, 42, 38, 0.3);
  animation: rise 0.7s 0.14s ease both;
}
#form-login { animation: rise 0.7s 0.2s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.stack { display: flex; flex-direction: column; gap: 0.85rem; }
.stack.compact { gap: 0.65rem; margin-bottom: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field[hidden] { display: none !important; }
.field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* 底部浅色区：表单放进白卡片，深色字保证可读 */
#screen-welcome #form-guest {
  background: #fff;
  border-radius: 16px;
  padding: 1.15rem 1.05rem 1.2rem;
  box-shadow: 0 10px 32px rgba(10, 42, 38, 0.18);
  animation: rise 0.7s 0.18s ease both;
  width: 100%;
  max-width: 22rem;
  text-align: left;
}
#screen-welcome .error-text,
#screen-welcome #login-error,
#screen-welcome .login-details {
  width: 100%;
  max-width: 22rem;
}
#screen-welcome #form-guest[hidden] {
  display: none !important;
}
/* 微信收藏缩略图：移出视口但仍加载，供抓取；不挡点击 */
.fav-cover-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0.6rem;
}
.fav-cover-preview {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #e8eeec;
}
.manage-hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.4;
}
.btn-tiny {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}
.wx-share-thumb {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 300px;
  height: 300px;
  max-width: none;
  pointer-events: none;
  opacity: 1;
}
.header-room-avatar {
  overflow: hidden;
  padding: 0 !important;
}
.header-room-avatar .room-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
/* 扫码入口全屏遮罩：域名纠偏 / 自动进群前不露昵称页 */
.entry-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #ffffff;
  color: #1a2e2a;
  text-align: center;
  padding: 2rem 1.5rem;
}
.entry-splash[hidden] {
  display: none !important;
}
.entry-splash-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.45;
  color: #1a5c52;
}
.entry-splash-sub {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: #7a8f8a;
  opacity: 1;
}
html.entry-gating {
  background: #fff;
}
html.entry-gating body {
  background: #fff;
}
html.entry-gating #app {
  visibility: hidden;
}
html.entry-gating #form-guest,
html.entry-gating #welcome-invite-avatar,
html.entry-gating #guest-room-hint,
html.entry-gating #login-details {
  display: none !important;
}
#screen-welcome #form-guest .field span {
  color: var(--ink);
  font-weight: 600;
}
#screen-welcome #form-guest .field input {
  background: #f0f3f2;
  border-color: rgba(20, 32, 30, 0.12);
}
.guest-nick-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.guest-nick-row input {
  flex: 1;
  min-width: 0;
  width: auto;
}
.guest-nick-shuffle {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.85rem;
  border: 1.5px solid rgba(26, 122, 104, 0.22);
  border-radius: 12px;
  background: rgba(26, 122, 104, 0.1);
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.guest-nick-shuffle:hover,
.guest-nick-shuffle:focus-visible {
  background: rgba(26, 122, 104, 0.18);
  outline: none;
}
.guest-nick-shuffle:active {
  transform: scale(0.98);
}

.field input,
.field textarea,
.composer input,
.composer textarea,
.sheet-panel input,
.sheet-panel textarea {
  width: 100%;
  border: 1.5px solid rgba(20, 32, 30, 0.14);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1rem;
  background: #f3f5f4;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: inset 0 1px 2px rgba(20, 32, 30, 0.03);
}
.field input::placeholder,
.field textarea::placeholder,
.composer input::placeholder,
.composer textarea::placeholder,
.sheet-panel input::placeholder,
.sheet-panel textarea::placeholder {
  color: #8a9a95;
  opacity: 1;
}
.sheet-panel textarea {
  resize: vertical;
  min-height: 4.5rem;
  line-height: 1.45;
}
.field input:hover,
.field textarea:hover,
.sheet-panel input:hover,
.sheet-panel textarea:hover {
  border-color: rgba(26, 122, 104, 0.35);
  background: #f7f9f8;
}
.field input:focus,
.field textarea:focus,
.composer input:focus,
.composer textarea:focus,
.sheet-panel input:focus,
.sheet-panel textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 122, 104, 0.16);
}

/* 大厅白卡片上的输入框：与卡片底色区分开 */
#screen-lobby .field input,
#screen-lobby .field textarea {
  background: #eef2f0;
  border-color: rgba(20, 32, 30, 0.16);
}
#screen-lobby .field input:focus,
#screen-lobby .field textarea:focus {
  background: #fff;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease,
    box-shadow 0.15s ease, color 0.15s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-deep); }
.btn-secondary:hover:not(:disabled) {
  background: #cfe9e0;
  color: #0f5c4e;
  box-shadow: 0 2px 8px rgba(26, 122, 104, 0.14);
}
.btn-ghost { background: transparent; color: var(--ink-muted); width: 100%; }
.btn-ghost:hover:not(:disabled) {
  background: rgba(20, 32, 30, 0.06);
  color: var(--ink);
}
.btn-danger { background: var(--danger-soft); color: var(--danger); width: 100%; margin-bottom: 0.5rem; }
.btn-danger:hover:not(:disabled) {
  background: #f8d0cb;
  color: #b42318;
  box-shadow: 0 2px 8px rgba(180, 35, 24, 0.12);
}
.btn-send { background: var(--accent); color: #fff; padding-inline: 1.1rem; flex-shrink: 0; }
.btn-send:hover:not(:disabled) { background: var(--accent-deep); }
.file-btn { display: block; text-align: center; margin-bottom: 0.75rem; }

.error-text { color: #ffb4a8; font-size: 0.85rem; margin: 0.25rem 0 0; }
#screen-welcome .error-text,
#screen-welcome #login-error {
  color: #8b1a12;
  background: #fde8e6;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
}
#screen-welcome #login-error[hidden] {
  display: none !important;
}
#screen-welcome #form-login .btn-primary {
  width: 100%;
}
#screen-lobby .error-text, #screen-chat .error-text, .sheet .error-text { color: var(--danger); }
.status-line { margin: 0.75rem 0 0; font-size: 0.8rem; color: rgba(232, 245, 241, 0.55); }
.status-line.ok { color: #9ee0d0; }
.status-line[hidden] { display: none !important; }
.admin-link-wrap { margin: 0.5rem 0 0; }
.admin-link { color: rgba(232, 245, 241, 0.65); font-size: 0.82rem; }

.login-details {
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: 0.88rem;
  background: #fff;
  border-radius: 16px;
  padding: 0.85rem 1rem 1rem;
  box-shadow: 0 8px 24px rgba(10, 42, 38, 0.14);
}
.login-details[hidden] { display: none !important; }
.login-details summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 600;
}
.login-details summary::-webkit-details-marker { display: none; }
.guest-room-hint {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #e8f2ef;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

/* Lobby */
.topbar {
  padding: 1.1rem 1.2rem 0.75rem;
  background: linear-gradient(180deg, #d5ebe4 0%, var(--surface) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.topbar-user { display: flex; align-items: center; gap: 0.55rem; min-width: 0; flex: 1; }
.topbar-actions { display: flex; gap: 0.4rem; flex-shrink: 0; align-items: center; }
.lobby-back-btn {
  appearance: none;
  border: none;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  line-height: 1.25;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(10, 42, 38, 0.14);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.lobby-back-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 3px 10px rgba(10, 42, 38, 0.2);
}
.lobby-back-btn:active {
  background: var(--accent-deep);
  transform: scale(0.97);
}
.topbar-avatar-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  border-radius: 10px;
}
.topbar-avatar-btn:active {
  opacity: 0.88;
  transform: scale(0.96);
}
.topbar-avatar-btn .avatar-lg {
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.05rem;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(10, 42, 38, 0.16);
}
.topbar-user-info {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.15rem 0.2rem;
  margin: 0;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  color: inherit;
  font: inherit;
}
.topbar-user-info:active {
  background: rgba(14, 61, 54, 0.06);
}
.brand-sm {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0;
  color: var(--bg-deep);
  letter-spacing: 0.04em;
}
.topbar-sub { margin: 0.1rem 0 0; color: var(--ink-muted); font-size: 0.88rem; }
.sheet-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
}
.sheet-title-row h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.sheet-back-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.05rem;
}
.profile-btn {
  appearance: none;
  border: 2px solid #fff;
  padding: 0;
  margin: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  box-shadow: 0 2px 10px rgba(10, 42, 38, 0.16);
  flex-shrink: 0;
}
.profile-btn:active {
  opacity: 0.88;
  transform: scale(0.96);
}
.profile-btn .avatar-sm {
  width: 100%;
  height: 100%;
  font-size: 0.95rem;
}
.lobby-body {
  flex: 1;
  padding: 0.5rem 1.1rem calc(1.5rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.lobby-panel {
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid rgba(20, 32, 30, 0.06);
  box-shadow: 0 6px 20px rgba(10, 42, 38, 0.06);
}
.my-rooms-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.my-rooms-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid rgba(20, 32, 30, 0.12);
  box-shadow: 0 1px 4px rgba(10, 42, 38, 0.04);
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}
.my-rooms-list li:hover {
  background: #e8f6f1;
  border-color: rgba(26, 122, 104, 0.42);
  box-shadow: 0 6px 16px rgba(10, 42, 38, 0.16);
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.03);
}
.my-rooms-list li:active {
  background: #e8f6f1;
  border-color: rgba(26, 122, 104, 0.4);
  box-shadow: 0 2px 8px rgba(26, 122, 104, 0.12);
  transform: translateY(0) scale(0.99);
  filter: none;
}
.my-rooms-list li.active {
  background: #d8f0e8;
  border-color: var(--accent);
  transform: none;
  filter: none;
}
.my-rooms-list li.active:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 16px rgba(26, 122, 104, 0.2);
}
.my-rooms-list li.is-empty {
  cursor: default;
  box-shadow: none;
  border-style: dashed;
  background: transparent;
  color: var(--ink-muted);
  justify-content: center;
}
.my-rooms-list li.is-empty:hover,
.my-rooms-list li.is-empty:active {
  background: transparent;
  border-color: rgba(26, 122, 104, 0.16);
  box-shadow: none;
}
.my-rooms-list .meta { flex: 1; min-width: 0; }
.my-rooms-list .name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-rooms-list .sub {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}
.my-rooms-list .enter-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
}
.my-rooms-list .enter-tag.is-unread {
  background: #fa5151;
  min-width: 1.35rem;
  padding: 0.22rem 0.45rem;
  text-align: center;
}
.my-rooms-list li.has-unread {
  border-color: #fa5151;
  background: #fff5f5;
  animation: room-unread-pulse 1.1s ease-in-out infinite;
}
.my-rooms-list li.active .enter-tag {
  background: var(--accent-deep);
}
#btn-rooms-create {
  width: 100%;
  margin: 0.15rem 0 0.35rem;
}
.lobby-panel h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0;
}
.lobby-panel-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.25rem;
}
.lobby-panel-title-row h2 {
  min-width: 0;
}
.default-room-avatar-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.default-room-avatar-btn:hover .default-room-avatar-preview,
.default-room-avatar-btn:focus-visible .default-room-avatar-preview {
  box-shadow: 0 0 0 2px rgba(26, 122, 104, 0.35);
}
.default-room-avatar-preview {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(20, 32, 30, 0.1);
  background: #eef4f2;
  display: block;
}
.default-room-avatar-reset {
  width: auto !important;
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  color: var(--accent-deep);
}
.default-room-avatar-reset:disabled {
  opacity: 0.45;
  cursor: default;
}
.lobby-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.lobby-panel-head-text {
  min-width: 0;
  flex: 1;
}
.lobby-panel-head .hint {
  margin-bottom: 0;
}
.lobby-panel-head .btn-tiny {
  flex-shrink: 0;
  margin-top: 0.15rem;
  white-space: nowrap;
}
.hint { margin: 0 0 0.85rem; color: var(--ink-muted); font-size: 0.88rem; }
.hint.center { text-align: center; }
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(20, 32, 30, 0.1);
}
.panel-disabled { opacity: 0.55; pointer-events: none; }

/* Chat */
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.75rem;
  padding-left: 1rem;
  padding-top: max(0.42rem, env(safe-area-inset-top));
  padding-bottom: 0.42rem;
  background: rgba(247, 251, 249, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid rgba(26, 122, 104, 0.32);
  position: sticky;
  top: 0;
  z-index: 5;
}
.chat-conn-banner {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  color: #7a4a00;
  background: #fff6e5;
  border-bottom: 1px solid rgba(200, 140, 40, 0.35);
}
.chat-conn-banner[hidden] {
  display: none !important;
}
.icon-btn {
  width: 2.3rem;
  height: 2.3rem;
  border: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 600;
}
.icon-btn[hidden] {
  display: none !important;
}
.icon-btn.ghost { background: rgba(20, 32, 30, 0.06); color: var(--ink-muted); }
.icon-btn.muted { opacity: 0.45; }
/* 所有人：返回位展示群头像（含默认字头像） */
.header-room-avatar,
.avatar.group-avatar.header-room-avatar,
#chat-header-room-avatar {
  width: 2.7rem !important;
  height: 2.7rem !important;
  font-size: 1rem;
  flex-shrink: 0;
  border: 1.5px solid rgba(26, 122, 104, 0.28);
  box-shadow: none;
  pointer-events: none;
  border-radius: 10px;
  overflow: hidden;
  padding: 0 !important;
}
/* 必须盖过 #chat-header-room-avatar 的 pointer-events:none，否则点不了群管理 */
.header-room-avatar.is-action,
.avatar.group-avatar.header-room-avatar.is-action,
#chat-header-room-avatar.is-action {
  pointer-events: auto !important;
  cursor: pointer;
}
.header-room-avatar.is-action:active,
#chat-header-room-avatar.is-action:active {
  opacity: 0.85;
}
.header-room-avatar[hidden] {
  display: none !important;
}
.chat-back-btn {
  flex-shrink: 0;
  margin-right: 0.15rem;
}
.chat-header-main {
  min-width: 0;
  flex: 1;
  text-align: left;
  padding: 0;
}
.chat-header-main.is-action {
  cursor: pointer;
}
.chat-header-main h2 {
  margin: 0 0 0.06rem;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.06em;
  line-height: 1.25;
}
.chat-header-main .chat-meta {
  display: flex;
  justify-content: flex-start;
}
#chat-room-name.is-action {
  cursor: pointer;
}
#chat-room-name.is-action:active {
  opacity: 0.85;
}
.group-avatar-btn {
  appearance: none;
  border: none;
  padding: 0;
  margin: 0 0.55rem 0 0.1rem;
  background: transparent;
  cursor: default;
  flex-shrink: 0;
  border-radius: 10px;
  line-height: 0;
  pointer-events: none;
}
.group-avatar-btn.is-action {
  cursor: pointer;
  pointer-events: auto;
}
.group-avatar-btn.is-action:active { opacity: 0.85; }
.group-avatar-btn[hidden] {
  display: none !important;
}
.group-avatar {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.05rem;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(10, 42, 38, 0.16);
}

/* 群滚动字幕 */
.room-marquee {
  flex-shrink: 0;
  overflow: hidden;
  height: 2rem;
  line-height: 2rem;
  border-bottom: 1px solid rgba(20, 32, 30, 0.06);
}
.room-marquee.is-action {
  cursor: pointer;
}
.room-marquee.is-action:hover {
  filter: brightness(1.06);
}
.room-marquee.is-action:active {
  filter: brightness(0.96);
}
.room-marquee[hidden] {
  display: none !important;
}
.room-marquee-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-scroll 18s linear infinite;
}
.room-marquee-text {
  display: inline-block;
  padding: 0 2.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* 群主管理：方形双列按键 */
.manage-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.55rem;
}
.manage-sheet-title {
  margin: 0 !important;
  text-align: left !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
}
.manage-header-qr {
  appearance: none;
  flex-shrink: 0;
  margin: 0;
  /* 2.5 倍后再 ÷1.2 ÷1.3 */
  padding: 0.45rem 0.99rem;
  border: 1px solid rgba(26, 122, 104, 0.4);
  border-radius: 999px;
  background: #e8f4f0;
  color: var(--accent);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}
.manage-header-qr:hover {
  background: #d8eee8;
  box-shadow: 0 4px 12px rgba(26, 122, 104, 0.2);
  transform: translateY(-1px);
}
.manage-header-qr:active {
  transform: translateY(0);
  background: #c8e6de;
}
.manage-pill {
  appearance: none;
  flex-shrink: 0;
  margin: 0;
  padding: 0.34rem 0.7rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    filter 0.16s ease;
}
.manage-pill:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(10, 42, 38, 0.18);
  filter: brightness(1.06);
}
.manage-pill:active {
  transform: translateY(0) scale(0.98);
  background: var(--accent-deep);
  box-shadow: 0 2px 6px rgba(10, 42, 38, 0.12);
  filter: none;
}
.manage-pill:focus-visible {
  outline: 2px solid rgba(26, 122, 104, 0.35);
  outline-offset: 1px;
}
.manage-pill-sm {
  padding: 0.48rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 8px;
  min-width: 3.2rem;
}
.manage-pill-block {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.45rem;
  border-radius: 8px;
  font-size: 0.78rem;
  text-align: center;
}
/* 第二排：全体禁言 / 显示设置 —— 与上方同色青绿 */
.manage-pill-alt {
  background: #3d6b8c;
  color: #fff;
}
.manage-pill-alt:hover {
  background: #4a7fa3;
  box-shadow: 0 6px 16px rgba(45, 90, 120, 0.28);
}
.manage-pill-alt:active {
  background: #2f5570;
}
.manage-pill-blue {
  background: #2f6fed;
  color: #fff;
}
.manage-pill-blue:hover {
  background: #4580f5;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.32);
}
.manage-pill-blue:active {
  background: #1f58c8;
}
.manage-pill-soft {
  background: #f3e6c8;
  color: #7a5c28;
  border: 1.5px solid rgba(180, 140, 60, 0.35);
}
.manage-pill-soft:hover {
  background: #f8efd4;
  box-shadow: 0 6px 16px rgba(160, 120, 40, 0.22);
  color: #6a4e20;
}
.manage-pill-soft:active {
  background: #ead8b0;
  color: #6a4e20;
}
.manage-pill-danger {
  background: var(--danger);
  color: #fff;
}
.manage-pill-danger:hover {
  background: #c42b22;
  box-shadow: 0 6px 16px rgba(180, 35, 24, 0.28);
}
.manage-pill-danger:active {
  background: #8f1c14;
}
.manage-pill-ghost {
  background: #eef1f0;
  color: var(--ink-muted);
  border: 1px solid rgba(20, 32, 30, 0.08);
}
.manage-pill-ghost:hover {
  background: #e4e9e7;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(20, 32, 30, 0.1);
}
.manage-pill-ghost:active {
  background: #dce2e0;
  color: var(--ink);
}
#btn-all-mute.is-all-muted {
  background: #d4a017;
  color: #fff;
}
#btn-all-mute.is-all-muted:hover {
  background: #e0ae28;
  box-shadow: 0 6px 16px rgba(180, 140, 20, 0.28);
}
#btn-all-mute.is-all-muted:active {
  background: #b8890c;
}
.manage-avatar-preview-btn {
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.manage-avatar-preview-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 14px rgba(10, 42, 38, 0.16);
}
.manage-avatar-preview-btn:active {
  transform: scale(0.97);
}
#manage-sheet .manage-panel {
  padding-bottom: calc(0.65rem + var(--safe-bottom));
  background: #f4f6f5;
}
#manage-sheet .sheet-handle {
  margin-bottom: 0.28rem;
}
.manage-card {
  background: #fff;
  border: 1px solid rgba(20, 32, 30, 0.06);
  border-radius: 10px;
  padding: 0.7rem 0.7rem;
  margin: 0 0 0.55rem;
}
.manage-card-identity {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.65rem;
}
.manage-identity-avatar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
}
.manage-avatar-preview {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1.5px solid rgba(26, 122, 104, 0.28);
  background: #eef4f2;
}
.manage-avatar-hint {
  margin: 0;
  font-size: 0.6rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.manage-rename-form {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.manage-rename-label {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--ink-muted);
}
.manage-rename-inline {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}
.manage-rename-inline input {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.88rem;
  border: 1px solid rgba(20, 32, 30, 0.1);
  border-radius: 8px;
  background: #f6f8f7;
  color: var(--ink);
  outline: none;
}
.manage-rename-inline input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 122, 104, 0.12);
}
.manage-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
}
.manage-close-full {
  width: 100%;
  margin: 0;
}
.manage-close-btn {
  display: none !important;
}
.manage-actions,
.manage-tile-grid,
.manage-danger-actions,
.manage-sheet-sub,
.manage-sheet-heading,
.manage-card-title,
.manage-avatar-block,
.manage-avatar-badge,
.manage-danger-row,
.manage-card-list,
.manage-card-danger,
.manage-qr-link {
  display: none !important;
}

.color-row {
  display: flex;
  gap: 0.75rem;
}
.color-field {
  flex: 1;
  min-width: 0;
}
.color-field input[type="color"] {
  width: 100%;
  height: 2.4rem;
  padding: 0.2rem;
  border: 1.5px solid rgba(20, 32, 30, 0.1);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
#form-marquee input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.speed-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
}
#marquee-speed-label {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-deep);
  margin-left: 0.35rem;
}
.chat-meta {
  margin: 0.04rem 0 0;
  font-size: 0.72rem;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.linkish {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
}
.linkish::after {
  content: " ›";
  opacity: 0.7;
  font-weight: 600;
}
.linkish.code { font-weight: 600; letter-spacing: 0.08em; }
.linkish.code::after { content: none; }

.messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.messages-top-tip {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: rgba(47, 52, 55, 0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}
.messages-top-tip.is-show {
  animation: messages-top-tip-pop 1.15s ease;
}
.messages-top-tip[hidden] {
  display: none !important;
}
@keyframes messages-top-tip-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(2px) scale(1.04);
  }
  32% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  75% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.98);
  }
}
.messages-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 1.5rem;
}
.messages-empty[hidden] {
  display: none !important;
}
.messages-empty-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.messages-empty-sub {
  margin: 0.2rem 0 0;
  font-size: 0.7rem;
  color: rgba(20, 32, 30, 0.38);
}
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overflow-anchor: none;
  overscroll-behavior-y: auto;
  padding: 0.85rem 0.9rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
  max-width: 720px;
  width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
  will-change: transform;
}
/* 切群贴底未稳前隐藏，避免浏览器里看到来回抖 */
.messages.is-settling {
  opacity: 0;
  pointer-events: none;
  will-change: auto;
}

.unread-fab {
  position: absolute;
  right: 28px;
  /* 完全在输入栏上方，避免被挡住 */
  bottom: calc(6rem + var(--safe-bottom, 0px));
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(10, 42, 38, 0.18);
  color: var(--accent-deep);
  font-size: 20px;
  cursor: pointer;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 0;
}
.unread-fab.is-show,
.unread-fab:not([hidden]) {
  display: grid !important;
}
.unread-fab[hidden] {
  display: none !important;
}
.unread-arrow {
  line-height: 1;
  font-weight: 700;
  transform: translateY(-1px);
}
.unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
#screen-chat:has(.emoji-panel:not([hidden])) .unread-fab,
#screen-chat:has(.media-panel:not([hidden])) .unread-fab,
#screen-chat:has(.mention-panel:not([hidden])) .unread-fab {
  bottom: calc(13.8rem + var(--safe-bottom, 0px));
}

.mention {
  color: inherit;
  font-weight: inherit;
}
/* 被@的人：蓝字高亮，无内框 */
.mention.mention-me {
  color: #2f6fed;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.msg.me .mention.mention-me {
  background: transparent;
  color: #2f6fed;
  border: none;
}
/* 自己气泡若被套上高亮，保持可读 */
.msg.me.mention-keep .msg-bubble:not(.media) {
  color: #1a2b28;
}
.msg.me.mention-keep .mention.mention-me {
  color: #2f6fed;
  background: transparent;
  border: none;
}
.msg.mention-flash .msg-bubble:not(.media) {
  animation: mention-pulse 0.55s ease 3;
}
.msg.mention-keep .msg-bubble:not(.media) {
  background: #f5f8ff;
  border: 1px solid #2f6fed;
  box-shadow: none;
}
@keyframes mention-pulse {
  0%, 100% {
    background: #f5f8ff;
    border-color: #2f6fed;
    box-shadow: 0 0 0 1px rgba(47, 111, 237, 0.15);
  }
  50% {
    background: #eaf0ff;
    border-color: #2f6fed;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.22);
  }
}
.msg.unread-flash .msg-bubble:not(.media) {
  animation: unread-pulse 0.5s ease 3;
}
@keyframes unread-pulse {
  0%, 100% {
    background: #fff8e8;
    border: 1px solid #e6a23c;
    box-shadow: 0 0 0 1px rgba(230, 162, 60, 0.18);
  }
  50% {
    background: #ffefcc;
    border: 1px solid #d48806;
    box-shadow: 0 0 0 3px rgba(212, 136, 6, 0.28);
  }
}

.mention-panel {
  max-height: 180px;
  overflow-y: auto;
  background: #fff;
  border-top: 1px solid rgba(20, 32, 30, 0.08);
  flex-shrink: 0;
}
.mention-panel[hidden] { display: none !important; }
.mention-title {
  margin: 0;
  padding: 0.55rem 0.85rem 0.25rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.mention-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.35rem;
}
.mention-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.92rem;
}
.mention-list li:active,
.mention-list li:hover {
  background: rgba(26, 122, 104, 0.08);
}
.mention-name {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  min-width: 0;
  flex: 1;
}
.mention-remark {
  font-weight: 500;
  font-size: 0.88em;
}
.mention-status {
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.92;
}
.mention-status.is-online {
  color: #15803d;
}
.mention-status.is-offline {
  color: #8a9399;
}
.mention-region {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #9aa3a8;
  white-space: nowrap;
  max-width: 9.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mention-region::before {
  content: "·";
  margin: 0 0.28em 0 0.08em;
  color: #c0c6cb;
}
.mention-all-tip {
  font-size: 0.82em;
  font-weight: 600;
  color: var(--ink-muted, #6b7280);
}

.mention-toast {
  position: absolute;
  top: auto;
  left: 50%;
  right: auto;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 90;
  margin: 0;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 34px;
  padding: 7px 16px;
  border: none !important;
  border-radius: 999px;
  background: #333639 !important;
  background-color: #333639 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate;
  forced-color-adjust: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}
.mention-toast-label {
  display: inline;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: transparent !important;
  background-color: transparent !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  font: inherit;
  font-weight: 400;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.mention-toast:hover,
.mention-toast:active,
.mention-toast:focus,
.mention-toast:focus-visible {
  background: #333639 !important;
  background-color: #333639 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  outline: none;
  opacity: 1 !important;
}
.mention-toast:not([hidden]) {
  display: inline-flex !important;
}
.mention-toast[hidden] {
  display: none !important;
}

.msg {
  display: flex;
  gap: 0.4rem;
  max-width: 88%;
  animation: msg-in 0.25s ease both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.other { align-self: flex-start; }
.msg.system { align-self: center; max-width: 90%; }
.msg-body { display: flex; flex-direction: column; min-width: 0; }
.msg.me .msg-body { align-items: flex-end; }
.msg.other .msg-body { align-items: flex-start; }
.msg-nick {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
  padding-inline: 0.25rem;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.28rem;
  max-width: 100%;
}
.msg-nick.is-self {
  cursor: pointer;
}
.msg-nick-name {
  font-size: inherit;
  line-height: 1.2;
}
.msg-nick-tag {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--accent-deep);
  opacity: 0.88;
  line-height: 1.2;
}
.msg.me .msg-nick-tag {
  color: var(--accent-deep);
}
.msg-nick.has-color {
  font-weight: 600;
}
.members-list .tag-role {
  color: var(--accent-deep);
  font-size: 0.68rem;
  opacity: 0.9;
}
.nick-color-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nick-color-row input[type="color"] {
  width: 2.6rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(20, 32, 30, 0.12);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.profile-colors-row {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
}
.profile-colors-row[hidden] {
  display: none !important;
}
.profile-color-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.profile-color-item[hidden] {
  display: none !important;
}
.profile-color-item > span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}
.btn-mini {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  width: auto;
}
.hint.tight {
  margin-top: 0.25rem;
  margin-bottom: 0;
}
.msg .avatar-sm {
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  touch-action: manipulation;
  flex-shrink: 0;
}
.msg .avatar-sm.is-self {
  cursor: pointer;
}
.msg .avatar-sm.is-remarkable {
  cursor: pointer;
}
.msg-file {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 10rem;
  max-width: min(240px, 68vw);
  padding: 0.35rem 0.2rem;
  text-decoration: none;
  color: inherit;
}
.msg-file-ico {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 32, 30, 0.06);
  font-size: 1.05rem;
}
.msg.me .msg-file-ico {
  background: rgba(0, 0, 0, 0.08);
}
.msg-file-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.msg-file-name {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-file-size {
  font-size: 0.72rem;
  color: var(--ink-muted);
}
.msg.me .msg-file-size {
  color: rgba(17, 17, 17, 0.55);
}
.msg .avatar-sm.is-self:active,
.msg-nick.is-self:active {
  opacity: 0.75;
}
.msg-bubble {
  padding: 0.38rem 0.62rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.38;
  word-break: break-word;
  white-space: pre-wrap;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.msg-bubble.emoji-only {
  font-size: 1.28rem;
  line-height: 1.15;
  padding: 0.2rem 0.32rem;
  letter-spacing: 0.02em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji",
    "EmojiOne Color", sans-serif;
}
.msg-bubble .inline-emoji {
  display: inline-block;
  font-size: 1.28em;
  line-height: 1.2;
  min-width: 1.15em;
  text-align: center;
  vertical-align: -0.12em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji",
    "EmojiOne Color", sans-serif;
  font-variant-emoji: emoji;
  transform: translateZ(0);
}
.msg-bubble .inline-emoji-img {
  width: 1.45em;
  height: 1.45em;
  vertical-align: -0.28em;
  display: inline-block;
  object-fit: contain;
  margin: 0 0.04em;
}
.msg-bubble.emoji-only .inline-emoji {
  font-size: 1em;
  min-width: 1em;
  margin-inline: 0.02em;
  vertical-align: baseline;
}
.msg-bubble.emoji-only .inline-emoji-img {
  width: 1.45rem;
  height: 1.45rem;
  vertical-align: -0.12em;
}
.msg-bubble .msg-link {
  color: #2f6fed;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  word-break: break-all;
}
.msg.me .msg-bubble .msg-link {
  color: #2f6fed;
}
.msg.me.mention-keep .msg-bubble .msg-link {
  color: #2f6fed;
}
.msg-bubble .msg-link:active {
  opacity: 0.75;
}
.msg-bubble.media {
  padding: 0.35rem;
  background: transparent !important;
  box-shadow: none !important;
}
.msg-bubble.media-caption {
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
}
.msg-image {
  display: block;
  max-width: min(220px, 62vw);
  max-height: 280px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
  background: rgba(20, 32, 30, 0.06);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.msg.me .msg-image { border-bottom-right-radius: 4px; }
.msg.other .msg-image { border-bottom-left-radius: 4px; }
.msg-video {
  display: block;
  max-width: min(240px, 68vw);
  max-height: 320px;
  border-radius: 10px;
  background: #000;
}
.msg-media-name {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
  padding-inline: 0.25rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg.other .msg-bubble {
  background: var(--bubble-other);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(10, 42, 38, 0.06);
}
.msg.me .msg-bubble {
  background: var(--bubble-me);
  color: #111111;
  border-bottom-right-radius: 4px;
}
/* 群主消息：细蓝边，不再套双层粗环 */
.msg.from-owner .msg-bubble:not(.media) {
  border: 1px solid rgba(47, 111, 237, 0.72);
  box-shadow: none;
}
.msg.other.from-owner .msg-bubble:not(.media) {
  background: #f5f8ff;
  color: var(--ink);
}
.msg.me.from-owner .msg-bubble:not(.media) {
  background: var(--bubble-me);
  color: #111111;
  border-color: rgba(47, 111, 237, 0.72);
  box-shadow: none;
}
.msg.from-owner.mention-keep .msg-bubble:not(.media) {
  background: #f5f8ff;
  color: #1a2b28;
  border: 1px solid rgba(47, 111, 237, 0.72);
  box-shadow: none;
}
.msg.system .msg-bubble {
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  text-align: center;
}
.msg-time {
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
  padding-inline: 0.25rem;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 0.32rem;
  padding: 0.48rem 0.55rem;
  background: var(--surface);
  border-top: 1px solid rgba(20, 32, 30, 0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 70;
}
.composer input[type="text"],
.composer textarea#input-message {
  flex: 1;
  min-width: 0;
  padding: 0.58rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 11px;
  border: 1.5px solid rgba(20, 32, 30, 0.14);
  background: #f3f5f4;
  line-height: 1.35;
  /* 微信 WebView：去掉内阴影，避免右侧像竖线影子 */
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.composer textarea#input-message {
  resize: none;
  /* 单行时 overflow:auto 会在微信里露出滚动条竖线 */
  overflow-x: hidden;
  overflow-y: hidden;
  max-height: 7.2rem;
  min-height: 2.3rem;
  height: 2.3rem;
}
.composer input[type="text"]:focus,
.composer textarea#input-message:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 122, 104, 0.16);
  outline: none;
}
.composer .btn-send {
  padding: 0.58rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 11px;
  line-height: 1.3;
  min-height: 0;
}
.composer-tool {
  width: 2.15rem;
  height: 2.15rem;
  border: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}
.composer-tool.active {
  background: var(--accent);
  color: #fff;
}
.chat-main > .composer {
  padding-bottom: calc(0.48rem + var(--safe-bottom));
}
.composer-quote {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0 0.55rem;
  padding: 0.45rem 0.55rem;
  background: #e8f2ef;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  flex-shrink: 0;
}
.composer-quote[hidden] {
  display: none !important;
}
.composer-quote-body {
  min-width: 0;
  flex: 1;
}
.composer-quote-nick {
  font-size: 0.78rem;
  color: var(--accent-deep);
  font-weight: 600;
  margin-bottom: 0.12rem;
}
.composer-quote-text {
  font-size: 0.82rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer-quote-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
}
.msg-quote {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.28rem;
  padding: 0.18rem 0.4rem 0.18rem 0.42rem;
  border-radius: 4px;
  background: rgba(20, 32, 30, 0.05);
  border: none;
  border-left: 1px solid rgba(26, 122, 104, 0.45);
  box-shadow: none;
  outline: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  line-height: 1.25;
}
.msg-quote:focus,
.msg-quote:focus-visible {
  outline: none;
}
.msg.me .msg-quote {
  background: rgba(0, 0, 0, 0.06);
  border-left-color: rgba(0, 0, 0, 0.28);
}
.msg-quote-nick {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 0.04rem;
  line-height: 1.2;
}
.msg.me .msg-quote-nick {
  color: rgba(17, 17, 17, 0.72);
}
.msg-quote-text {
  font-size: 0.64rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.msg.me .msg-quote-text {
  color: rgba(17, 17, 17, 0.55);
}
.chat-main:has(.emoji-panel:not([hidden])) > .composer,
.chat-main:has(.media-panel:not([hidden])) > .composer {
  padding-bottom: 0.48rem;
}

.emoji-panel {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.15rem;
  padding: 0.4rem 0.45rem calc(0.4rem + var(--safe-bottom));
  height: 148px;
  max-height: 148px;
  overflow-y: auto;
  background: #eef6f3;
  border-top: 1px solid rgba(20, 32, 30, 0.06);
  box-sizing: border-box;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  align-content: start;
}
@media (max-width: 360px) {
  .emoji-panel {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
.emoji-panel[hidden],
.media-panel[hidden] {
  display: none !important;
}
.emoji-panel button {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  height: 2rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji",
    "EmojiOne Color", sans-serif;
  font-variant-emoji: emoji;
  overflow: hidden;
  box-sizing: border-box;
}
.emoji-panel button:active {
  background: rgba(26, 122, 104, 0.15);
}
.emoji-panel .emoji-panel-img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.media-panel {
  display: flex;
  justify-content: flex-start;
  gap: 1.1rem;
  padding: 0.65rem 1rem calc(0.65rem + var(--safe-bottom));
  background: #eef6f3;
  border-top: 1px solid rgba(20, 32, 30, 0.06);
  box-sizing: border-box;
  flex-shrink: 0;
}
.media-action {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 0;
  width: 4.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink-muted);
  cursor: pointer;
}
.media-action .media-ico {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(10, 42, 38, 0.08);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  width: 100%;
  max-width: none;
  margin: 0;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  box-sizing: border-box;
  touch-action: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.lightbox[hidden] { display: none !important; }
.lightbox:not([hidden]) { display: flex !important; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
  touch-action: none;
}
.lightbox-close {
  position: absolute;
  top: calc(0.65rem + env(safe-area-inset-top, 0px));
  right: calc(0.65rem + env(safe-area-inset-right, 0px));
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  text-align: center;
  color: rgba(255,255,255,0.72);
  font-size: 0.78rem;
  pointer-events: none;
}
body.lightbox-open {
  overflow: hidden !important;
  touch-action: none;
}

.upload-mask {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10, 42, 38, 0.45);
  display: grid;
  place-items: center;
  max-width: 480px;
  margin: 0 auto;
  color: #fff;
  font-size: 0.95rem;
}

/* 电脑端拖拽发图提示 */
#screen-chat.is-drop-target {
  position: relative;
}
#screen-chat.is-drop-target::after {
  content: "松开鼠标发送图片/视频";
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(26, 122, 104, 0.18);
  border: 2px dashed rgba(26, 122, 104, 0.55);
  color: #145c52;
  font-size: 1.05rem;
  font-weight: 600;
  pointer-events: none;
}

/* 群主/管理悬停：在线绿 / 离线灰 */
.presence-tip {
  position: fixed;
  z-index: 520;
  display: flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  font-size: 0.78rem;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}
.presence-tip[hidden] {
  display: none !important;
}
.presence-tip-status.is-online {
  color: #1a7a68;
  font-weight: 600;
}
.presence-tip-status.is-offline {
  color: #8a9490;
  font-weight: 600;
}
.presence-tip-status.is-unknown {
  color: #8a9490;
  font-weight: 600;
}
.presence-tip-hint {
  color: #8a9490;
  font-weight: 400;
}

/* 电脑端消息右键菜单（黑底） */
.msg-ctx-menu {
  position: fixed;
  z-index: 500;
  display: grid;
  grid-template-columns: repeat(2, minmax(4.4rem, 1fr));
  gap: 0.08rem;
  min-width: 10rem;
  padding: 0.32rem;
  background: #2a2a2a;
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.msg-ctx-menu[hidden] {
  display: none !important;
}
.msg-ctx-item {
  display: block;
  width: 100%;
  appearance: none;
  border: none;
  background: transparent;
  text-align: center;
  padding: 0.58rem 0.75rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  line-height: 1.35;
}
.msg-ctx-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.msg-ctx-item.is-danger {
  color: #f07178;
  font-weight: 500;
  background: transparent;
}
.msg-ctx-item.is-danger:hover {
  background: rgba(240, 113, 120, 0.14);
  color: #ff8a90;
}
.msg-ctx-sep {
  grid-column: 1 / -1;
  height: 1px;
  margin: 0.18rem 0.35rem;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

/* Sheets */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  max-width: 480px;
  margin: 0 auto;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 42, 38, 0.45);
  animation: fade 0.2s ease;
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 0.45rem 0.95rem calc(0.85rem + var(--safe-bottom));
  animation: sheet-up 0.28s ease;
  max-height: 82vh;
  overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.rail-ui-panel {
  max-height: 88vh;
  background: linear-gradient(180deg, #f3f7f5 0%, #ffffff 28%);
}
.rail-ui-hero {
  text-align: center;
  padding: 0.35rem 0.4rem 0.85rem;
  border-bottom: 1px solid rgba(20, 32, 30, 0.06);
  margin-bottom: 0.85rem;
}
.rail-ui-hero h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
}
.rail-ui-sub {
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.rail-ui-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.rail-ui-card {
  background: #fff;
  border: 1px solid rgba(20, 32, 30, 0.08);
  border-radius: 14px;
  padding: 0.85rem 0.9rem 0.95rem;
  box-shadow: 0 2px 10px rgba(14, 90, 76, 0.04);
}
.rail-ui-card h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.rail-ui-hint {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink-muted);
}
.rail-ui-card .field {
  margin: 0;
}
.rail-ui-card select {
  width: 100%;
  margin-top: 0.35rem;
  appearance: none;
  border: 1px solid rgba(20, 32, 30, 0.12);
  background: #f7faf9;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 2.2rem;
  height: 3px;
  border-radius: 2px;
  background: rgba(20, 32, 30, 0.15);
  margin: 0 auto 0.55rem;
}
.sheet-panel h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
}
.qr-panel { text-align: center; }
/* 二维码用居中卡片，避免底部抽屉上方留出大片暗影 */
#qr-sheet .sheet-panel.qr-panel {
  left: 1.1rem;
  right: 1.1rem;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 18px;
  max-height: min(88vh, 560px);
  padding: 1.1rem 1.25rem 1rem;
  animation: qr-pop 0.22s ease;
  box-shadow: 0 16px 48px rgba(10, 42, 38, 0.28);
}
#qr-sheet .sheet-handle {
  display: none;
}
@keyframes qr-pop {
  from { opacity: 0; transform: translateY(calc(-50% + 12px)) scale(0.97); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}
.qr-image {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0.5rem auto 0.75rem;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-sizing: border-box;
  object-fit: contain;
}
.invite-code {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0 0 0.85rem;
}
.invite-code strong {
  color: var(--accent-deep);
  letter-spacing: 0.12em;
  margin-left: 0.25rem;
}

.members-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.members-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  font-size: 0.88rem;
  background: #fff;
  border: 1.5px solid rgba(20, 32, 30, 0.11);
  box-shadow: 0 1px 3px rgba(10, 42, 38, 0.04);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    filter 0.16s ease;
}
.members-list li.is-clickable {
  cursor: pointer;
  margin: 0;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}
.members-list li.is-clickable:hover,
.members-list li:hover {
  background: #e8f6f1;
  border-color: rgba(26, 122, 104, 0.4);
  box-shadow: 0 6px 16px rgba(10, 42, 38, 0.16);
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.03);
}
.members-list li.is-clickable:active,
.members-list li:active {
  background: rgba(26, 122, 104, 0.12);
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 6px rgba(14, 90, 76, 0.1);
  filter: none;
}
.members-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
}
.members-sheet-head h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.02rem;
  line-height: 1.35;
}
.all-mute-btn {
  margin: 0;
  flex-shrink: 0;
}
.all-mute-btn.is-all-muted,
.members-list .settings-btn.is-all-muted {
  background: #fff3cd;
  color: #8a6d00;
}
.members-list .meta { flex: 1; min-width: 0; }
.members-list .tag {
  font-size: 0.68rem;
  color: var(--accent);
  margin-left: 0.25rem;
}
.members-list .tag-online {
  color: #14532d;
  background: rgba(22, 163, 74, 0.16);
  border-radius: 999px;
  padding: 0.04rem 0.32rem;
  margin-left: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.members-list .tag-offline {
  color: #7a8480;
  background: rgba(20, 32, 30, 0.06);
  border-radius: 999px;
  padding: 0.04rem 0.32rem;
  margin-left: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.members-list .tag-mute {
  color: #a67c00;
  background: rgba(180, 130, 0, 0.2);
  border-radius: 999px;
  padding: 0.04rem 0.32rem;
  margin-left: 0.25rem;
  font-size: 0.64rem;
  font-weight: 700;
}
.members-list .member-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  min-width: 0;
}
.members-list .member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.members-list .member-net {
  margin-top: 0.12rem;
  font-size: 0.62rem;
  color: var(--ink-muted);
  line-height: 1.3;
  word-break: break-all;
}
.members-list .member-client {
  margin-top: 0.1rem;
  font-size: 0.6rem;
  color: #3a5a9a;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.members-list .member-times {
  margin-top: 0.1rem;
  font-size: 0.6rem;
  color: var(--ink-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.members-list .member-remark {
  margin-top: 0.08rem;
  font-size: 0.66rem;
  color: var(--ink-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}
.members-list .member-remark-label {
  color: inherit;
}
.members-list .member-remark-text {
  color: #3a5a9a;
  font-weight: 500;
}
.members-list .settings-btn {
  appearance: none;
  border: none;
  background: #e8eefc;
  color: #3a5a9a;
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
  margin-right: 0.2rem;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    transform 0.12s ease;
}
.members-list .settings-btn:hover {
  background: #d4dff8;
  color: #27457a;
  box-shadow: 0 1px 4px rgba(58, 90, 154, 0.18);
}
.members-list .settings-btn:active {
  transform: scale(0.97);
}
.members-list .settings-btn.has-status {
  background: #f0f4f3;
  color: var(--ink-muted);
}
.members-list .settings-btn.has-status:hover {
  background: #e2eae8;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 32, 30, 0.1);
}
.members-list .settings-btn.is-banned-btn {
  background: #efe2e2;
  color: #a33;
}
.members-list .settings-btn.is-banned-btn:hover {
  background: #e5cbcb;
  color: #8a2222;
  box-shadow: 0 1px 4px rgba(170, 51, 51, 0.16);
}
.members-list .mute-btn {
  appearance: none;
  border: none;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
  margin-right: 0.2rem;
}
.members-list .mute-btn.on {
  background: #fff3cd;
  color: #8a6d00;
}
.members-list .kick-btn {
  appearance: none;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
}
.members-list .ban-btn {
  appearance: none;
  border: none;
  background: #f5ebe0;
  color: #8a4b12;
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
}
.members-list .admin-btn {
  appearance: none;
  border: none;
  background: #e8eefc;
  color: #3a5a9a;
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
  margin-right: 0.2rem;
}
.members-list .admin-btn.on {
  background: #ece8f5;
  color: #6a4a9a;
}
.members-list .ban-btn.on {
  background: #efe2e2;
  color: #a33;
}
.members-list li.is-banned {
  opacity: 0.92;
}
.members-list .transfer-btn {
  display: none;
}
.member-actions-panel h3 {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
}
.member-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.member-actions-stack .member-action-item {
  width: 100%;
  margin: 0;
}
.member-actions-stack .member-action-item:hover:not(:disabled) {
  filter: brightness(0.96);
  box-shadow: 0 2px 8px rgba(20, 32, 30, 0.08);
}
.member-actions-stack .is-admin-on {
  background: #ece8f5;
  color: #6a4a9a;
  border-color: transparent;
}
.member-actions-stack .is-admin-on:hover:not(:disabled) {
  background: #e0d8f0;
  color: #553a80;
}
.member-actions-stack .is-mute-on {
  background: #fff3cd;
  color: #8a6d00;
  border-color: transparent;
}
.member-actions-stack .is-mute-on:hover:not(:disabled) {
  background: #ffe8a3;
  color: #6b5400;
}
.member-actions-stack .is-danger-action {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.member-actions-stack .is-danger-action:hover:not(:disabled) {
  background: #f8d0cb;
  color: #b42318;
}
.member-actions-stack .is-ban-action,
.member-actions-stack .is-ban-on {
  background: #f5ebe0;
  color: #8a4b12;
  border-color: transparent;
}
.member-actions-stack .is-ban-action:hover:not(:disabled),
.member-actions-stack .is-ban-on:hover:not(:disabled) {
  background: #eadccb;
  color: #6e3c0e;
}
.member-actions-stack .is-ban-on {
  background: #efe2e2;
  color: #a33;
}
.member-actions-stack .is-ban-on:hover:not(:disabled) {
  background: #e5cbcb;
  color: #8a2222;
}
.member-actions-stack .is-remark-action {
  background: #eef3f8;
  color: #3a5a9a;
  border-color: transparent;
}
.member-actions-stack .is-remark-action:hover:not(:disabled) {
  background: #dde7f2;
  color: #27457a;
}

/* 微信风格确认弹窗 */
.wx-confirm {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* 浮窗内打开链接：二次点击真实 <a> / Intent */
.wx-float-open {
  position: fixed;
  inset: 0;
  z-index: 560;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  box-sizing: border-box;
}
.wx-float-open-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.wx-float-open-card {
  position: relative;
  z-index: 1;
  width: min(320px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.1rem 1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  text-align: center;
}
.wx-float-open-title {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
  font-weight: 650;
  color: #111;
}
.wx-float-open-desc {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #666;
}
.wx-float-open-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.55rem;
  padding: 0.78rem 1rem;
  border-radius: 10px;
  background: #07c160;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 650;
  font-size: 1rem;
}
.wx-float-open-btn.is-secondary {
  background: #f2f2f2;
  color: #1a1a1a !important;
  font-weight: 600;
}
.wx-float-open-btn:active {
  opacity: 0.88;
}
.wx-float-open-cancel {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem;
  font-size: 0.95rem;
  color: #888;
  font-family: inherit;
  cursor: pointer;
}
.wx-confirm.is-dock-side {
  place-items: stretch;
  display: block;
  padding: 0;
}
.wx-confirm.is-dock-side .wx-confirm-card {
  z-index: 2;
  animation: none;
}
.wx-confirm[hidden] {
  display: none !important;
}
.wx-confirm-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.wx-confirm-card {
  position: relative;
  width: min(78vw, 300px);
  background: #ededed;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  animation: wx-confirm-in 0.18s ease-out;
}
.wx-confirm.has-input .wx-confirm-card {
  width: min(86vw, 340px);
}
@keyframes wx-confirm-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.wx-confirm-body {
  padding: 1.35rem 1.1rem 1.15rem;
  text-align: center;
}
.wx-confirm.has-input .wx-confirm-body {
  padding: 1.2rem 1.1rem 1rem;
}
.wx-confirm-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #191919;
  line-height: 1.35;
}
.wx-confirm-title[hidden] {
  display: none !important;
}
.wx-confirm-text {
  margin: 0;
  font-size: 0.95rem;
  color: #191919;
  line-height: 1.5;
  word-break: break-word;
}
.wx-confirm-text[hidden] {
  display: none !important;
}
.wx-confirm-input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}
.wx-confirm-input-row[hidden] {
  display: none !important;
}
.wx-confirm-input {
  display: block;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #191919;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.wx-confirm-input:focus {
  box-shadow: inset 0 0 0 1.5px rgba(87, 107, 149, 0.55);
}
.wx-confirm-input[hidden] {
  display: none !important;
}
.wx-confirm-input::placeholder {
  color: #a8a8a8;
}
.wx-confirm-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  flex-shrink: 0;
  max-width: 5.2rem;
  justify-content: flex-end;
}
.wx-confirm-colors[hidden] {
  display: none !important;
}
.wx-confirm-color {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}
.wx-confirm-color.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px currentColor;
}
.wx-confirm-color.is-none {
  background: #f3f3f3;
  position: relative;
}
.wx-confirm-color.is-none::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10%;
  width: 1.5px;
  height: 80%;
  background: #c45c26;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 1px;
}
.msg-nick-remark {
  font-weight: 500;
}
.msg-nick.is-remarkable {
  cursor: pointer;
}
.wx-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.wx-confirm.single-action .wx-confirm-actions {
  grid-template-columns: 1fr;
}
.wx-confirm.single-action #wx-confirm-ok {
  text-align: center;
  width: 100%;
}
.wx-confirm-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.85rem 0.5rem;
  font-size: 1.02rem;
  font-weight: 500;
  color: #000;
  cursor: pointer;
  font-family: inherit;
}
.wx-confirm-btn + .wx-confirm-btn {
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}
.wx-confirm.single-action .wx-confirm-btn + .wx-confirm-btn {
  border-left: none;
}
.wx-confirm-btn.primary {
  color: #576b95;
  font-weight: 600;
}
.wx-confirm-btn.danger {
  color: #fa5151;
  font-weight: 600;
}
.wx-confirm-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

@media (min-width: 481px) {
  body {
    background:
      radial-gradient(ellipse at 20% 10%, rgba(26, 122, 104, 0.15), transparent 40%),
      linear-gradient(160deg, #c5ddd6, #e8f2ef 50%, #d0e4de);
  }
  #app {
    height: min(900px, 96dvh);
    min-height: min(900px, 96dvh);
    margin-top: 2vh;
    margin-bottom: 2vh;
    border-radius: 24px;
    overflow: hidden;
  }
}

/* 个人资料 / 成员列表：H5 紧凑布局 */
#profile-sheet .sheet-panel .field {
  gap: 0.22rem;
  margin-bottom: 0.5rem;
}
#profile-sheet .sheet-panel .field > span {
  font-size: 0.75rem;
}
#profile-sheet .sheet-panel input[type="text"] {
  padding: 0.48rem 0.7rem;
  font-size: 0.92rem;
  border-radius: 10px;
}
#profile-sheet .sheet-panel .hint,
#profile-sheet .sheet-panel .hint.tight {
  font-size: 0.72rem;
  margin: 0.08rem 0 0;
  line-height: 1.35;
}
#profile-sheet .sheet-panel .btn {
  margin-top: 0.2rem;
  padding: 0.52rem 0.85rem;
  font-size: 0.9rem;
}
#profile-sheet .nick-color-row input[type="color"] {
  width: 2.2rem;
  height: 1.7rem;
}
#members-sheet .members-list .avatar {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.72rem;
}

.muted-count {
  font-size: 0.85em;
  font-weight: 500;
  color: var(--ink-muted);
}
.owner-manage-panel .hint.tight {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
}
.owner-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.owner-toolbar .btn {
  width: auto;
  margin: 0;
}
.owner-toolbar-refresh {
  margin-left: auto;
  font-size: 0.82rem;
  padding: 0.32rem 0.85rem;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.owner-page-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.owner-mgmt-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  padding: 0 0.1rem;
}
.owner-mgmt-tab {
  appearance: none;
  border: 1px solid rgba(20, 32, 30, 0.12);
  background: #fff;
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.owner-mgmt-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.owner-ban-hint {
  flex: 1;
  margin: 0;
  min-width: 0;
}
.owner-guests-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.owner-table-wrap {
  flex: 1;
  min-height: 12rem;
  overflow: auto;
  margin: 0 0 0.55rem;
  border: 1px solid rgba(20, 32, 30, 0.08);
  border-radius: 12px;
  background: #fff;
}
.owner-guest-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
  min-width: 780px;
}
.owner-guest-table .og-col-check { width: 2.2rem; }
.owner-guest-table .og-col-user { width: 14%; }
.owner-guest-table .og-col-status { width: 7%; }
.owner-guest-table .og-col-ip { width: 16%; }
.owner-guest-table .og-col-remark { width: 11%; }
.owner-guest-table .og-col-rooms { width: 10%; }
.owner-guest-table .og-col-time { width: 10%; }
.owner-guest-table .og-col-ops { width: 12%; }
.owner-guest-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f1;
  color: var(--ink-muted);
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid rgba(20, 32, 30, 0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.owner-guest-table tbody td {
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid rgba(20, 32, 30, 0.06);
  vertical-align: middle;
  color: var(--ink);
  overflow: hidden;
}
.owner-guest-table .col-perm {
  white-space: nowrap;
  text-align: left;
}
.owner-guest-table tbody tr {
  transition: background 0.15s ease;
}
.owner-guest-table tbody tr:hover {
  background: rgba(26, 122, 104, 0.06);
}
.owner-guest-table .col-check {
  width: 2rem;
  text-align: center;
}
.owner-guest-table input[type="checkbox"] {
  width: auto !important;
  height: auto;
  margin: 0;
  accent-color: var(--accent);
  box-shadow: none;
  padding: 0;
  border: none;
  background: transparent;
}
.owner-guest-table .guest-name {
  font-weight: 600;
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-guest-table .guest-sub {
  margin-top: 0.12rem;
  font-size: 0.68rem;
  color: var(--ink-muted);
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-guest-table .col-ip {
  max-width: 9rem;
  word-break: break-all;
  font-size: 0.72rem;
  color: var(--ink-muted);
}
.owner-guest-table .col-time {
  white-space: nowrap;
  color: var(--ink-muted);
  font-size: 0.72rem;
}
.owner-guest-table .status {
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.owner-guest-table .status.on {
  color: #1a7a68;
  font-weight: 600;
}
.owner-guest-table .status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}
.owner-guest-table .status.is-admin {
  color: #0b6e99;
  font-weight: 600;
}
.owner-guest-table .status.is-muted {
  color: #b45309;
  font-weight: 600;
}
.owner-guest-table .status.is-banned {
  color: #c0392b;
  font-weight: 600;
}
.owner-guest-table .status.is-action {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: currentColor;
  opacity: 0.92;
  transition: opacity 0.12s ease, filter 0.12s ease;
}
.owner-guest-table .status.is-action:hover {
  opacity: 1;
  filter: brightness(0.88);
}
.owner-guest-table .status.is-action:active {
  opacity: 0.75;
}
.owner-guest-table .remark-edit {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  max-width: 6rem;
  text-align: left;
  color: var(--ink);
  font-size: 0.75rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-guest-table .remark-edit.empty {
  color: var(--ink-muted);
}
.owner-guest-table .col-ops .row-actions {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;
  margin: 0;
}
.owner-guest-table .row-actions .btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
  padding: 0.22rem 0.45rem;
  font-size: 0.72rem;
}
.owner-guest-table .row-actions .btn-ban-ip {
  color: #e03434;
}
.owner-guest-table .row-actions .btn-banned {
  color: var(--ink-muted);
}
.owner-guests-list,
ul.owner-guests-list {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  flex: 1;
  min-height: 12rem;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
/* 勿把旧列表样式套到 table tbody 上 */
tbody.owner-guests-list,
#owner-guests-tbody.owner-guests-list,
#owner-guests-list:not(ul) {
  display: table-row-group;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: initial;
  min-height: 0;
  max-height: none;
  overflow: visible;
  gap: 0;
}
.owner-guests-list li {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(20, 32, 30, 0.04);
  border: 1px solid rgba(20, 32, 30, 0.06);
}
.owner-guests-list input[type="checkbox"] {
  width: auto !important;
  height: auto;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  box-shadow: none;
  padding: 0;
  border: none;
  background: transparent;
}
.owner-guests-list .row-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}
.owner-guests-list .guest-nick {
  flex: 0 1 auto;
  max-width: 5.5rem;
  min-width: 0;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-guests-list .meta-line {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.7rem;
  color: var(--ink-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-guests-list .status {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.owner-guests-list .status.on {
  color: #1a7a68;
  font-weight: 600;
}
.owner-guests-list .row-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  flex-shrink: 0;
}
.owner-guests-list .row-actions .btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
  padding: 0.22rem 0.45rem;
  font-size: 0.72rem;
}
.owner-guests-list .row-actions .btn-ban-ip {
  color: #e03434;
}
.owner-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.owner-pager .btn {
  width: auto;
  margin: 0;
}
.owner-pager .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.owner-ip-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.owner-ip-add input {
  flex: 1;
  min-width: 5.5rem;
  border: 1.5px solid rgba(20, 32, 30, 0.14);
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
  font: inherit;
  font-size: 0.88rem;
  background: #f3f5f4;
}
.owner-ip-add .btn {
  width: auto;
  margin: 0;
}
.owner-ip-list {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  max-height: min(48vh, 380px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.owner-ip-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(20, 32, 30, 0.04);
}
.owner-ip-list .ip-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.owner-ip-list .ip {
  font-weight: 600;
  font-size: 0.88rem;
}
.owner-ip-list .reason {
  font-size: 0.72rem;
  color: var(--ink-muted);
}
.owner-ip-list .btn {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}
.owner-sec-sub {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.owner-manage-panel .btn-danger.btn-mini {
  width: auto;
}
