/* =============================================================
   永远的蔚蓝星球 · 游戏主页
   结构：1 设计令牌  2 基础重置  3 视频背景  4 顶栏  5 主区
        6 公告区  7 群聊面板  8 弹窗  9 响应式  10 动效与可访问性
   ============================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --bg-deep:      #04101f;
  --bg-deep-2:    #071a30;

  --ink:          #e9f4ff;
  --ink-2:        rgba(224, 238, 255, .80);
  --ink-3:        rgba(196, 218, 244, .60);

  --line:         rgba(120, 190, 255, .20);
  --line-strong:  rgba(130, 200, 255, .40);
  /* 群聊面板没有底色，必须靠边框把范围画出来。
     亮色线在暗背景上看得见，外侧再压一条深色细线，亮背景上也看得见。 */
  --panel-edge:        rgba(162, 222, 255, .85);
  --panel-edge-outer:  rgba(4, 12, 26, .72);
  --panel-line:        rgba(150, 214, 255, .42);

  --azure:        #3fc6ff;
  --azure-2:      #2f6bff;
  --gold:         #ffd27a;
  --green:        #38e07a;

  /* 背景不再加任何遮罩，卡片自身需要足够不透明才能保证文字可读 */
  --glass:        rgba(6, 17, 34, .74);
  --glass-2:      rgba(5, 14, 30, .79);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-full: 999px;

  --shadow-1: 0 8px 22px rgba(0, 0, 0, .22);
  --shadow-2: 0 26px 70px rgba(0, 0, 0, .55);

  --dock-w: 384px;
  /* 群聊面板：吃掉功能区之外的剩余宽度，再按 --chat-inset 从右侧回收一点，
     不让它一路顶到页面右边 */
  --chat-w: clamp(360px, 38vw, 760px);
  --chat-inset: clamp(0px, 6.2vw, 170px);
  --side-w: clamp(168px, 26%, 380px);

  /* ---- 背景文字避让 ----
     背景视频以 object-fit: cover 铺满视口，视频尺寸 1920×1000（宽高比 1.92）。
     视口宽高比 < 1.92（常见桌面）时按高度缩放、左右各被裁掉一部分，
     左侧书法字（「剑指蔚蓝」「英雄集结」）的右边缘实测在视频 x ≈ 436 处。

     把裁切公式 crop = (1920 - 1000·W/H) / 2、scale = H/1000 代入
     viewport_x = (video_x - crop) · scale，得到该边缘在视口中的位置：

       视口比 ≥ 1.92（超宽屏）   →  450/1920 = 23.4vw
       视口比 < 1.92（常见桌面） →  50vw - 51vh
       竖屏移动端                →  负值，被 max() 夹到 0

     两式在宽高比 1.92 处连续，取 min() 即得真实位置，
     因此面板在任何屏幕比例下都紧贴文字右侧，不会忽远忽近。 */
  --page-pad: clamp(20px, 4vw, 56px);
  --bg-text-right: max(0px, min(23.4vw, calc(50vw - 51vh)));
  /* 在文字右侧留 18px 间距；.page 已有内边距，故减去免得叠加两次 */
  --dock-offset: max(0px, calc(var(--bg-text-right) + 18px - var(--page-pad)));

  /* 文字直接压在视频上，靠多层深色光晕保证可读 —— 不使用整屏遮罩 */
  --halo: 0 1px 2px rgba(2, 8, 18, .95), 0 0 7px rgba(2, 8, 18, .90),
          0 2px 18px rgba(2, 8, 18, .78);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--azure-2);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- 3. 视频背景 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 30%, #14508f 0%, #0a2340 45%, var(--bg-deep) 100%);
}

.bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 背景不做任何压暗 / 遮罩处理，视频原样呈现。
   文字可读性由卡片自身的不透明度与文字阴影保证。 */

/* 视频不可用时的兜底：仅保留渐变底 + 轻微流光 */
.bg::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 42% at 70% 34%, rgba(63, 198, 255, .22), transparent 70%),
    radial-gradient(30% 34% at 46% 66%, rgba(47, 107, 255, .18), transparent 70%);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
html.no-video .bg__video { display: none; }
html.no-video .bg::after { opacity: 1; }

/* ---------- 页面骨架 ---------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--page-pad);
}

/* ---------- 4. 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  /* 品牌与访问次数靠左排，不再两端对齐 */
  justify-content: flex-start;
  gap: clamp(14px, 2vw, 34px);
  padding: clamp(18px, 2.6vh, 30px) 0 0;
  /* text-shadow 可继承：顶栏、标题区、底栏的文字直接压在视频上，
     靠多层光晕保证可读，而不再用整屏遮罩压暗背景 */
  text-shadow: var(--halo);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--azure);
  background: rgba(63, 198, 255, .10);
  border: 1px solid rgba(99, 196, 255, .26);
  box-shadow: inset 0 0 18px rgba(63, 198, 255, .14);
}
.brand__mark svg { width: 26px; height: 26px; }

.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
}
.brand__text small {
  font-size: 10px;
  letter-spacing: .26em;
  color: rgba(226, 238, 255, .78);
}

/* ---------- 5. 主区：左侧功能 + 右侧群聊 ---------- */
.stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;          /* 左侧功能区纵向居中 */
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 44px);
  padding: clamp(14px, 2.6vh, 36px) 0 clamp(12px, 2vh, 26px) var(--dock-offset);
}

/* 群聊面板：吃掉左侧功能区之外的剩余宽度，高度撑满主区。
   完全透明、不加磨砂、不加阴影 —— 页面那层动态视频原样透出来。 */
.chat {
  flex: 1 1 var(--chat-w);
  align-self: stretch;
  width: var(--chat-w);
  min-width: 320px;
  min-height: 460px;
  margin-right: var(--chat-inset);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  /* 面板透明，边界只能靠描边体现：
     2px 亮蓝内边 + 1px 深色外描边，深浅背景上都够清楚 */
  border: 2px solid var(--panel-edge);
  outline: 1px solid var(--panel-edge-outer);
  /* 整块面板铺上和卡片同款的淡蓝底：
     视频仍然透得出来（66% 透光），但文字终于有了底衬 */
  background: rgba(16, 48, 88, .34);
  overflow: hidden;
  /* 没有底色也没有磨砂，文字全靠贴身光晕撑可读性 */
  text-shadow: 0 1px 2px rgba(2, 8, 18, .98), 0 0 5px rgba(2, 8, 18, .95),
               0 0 10px rgba(2, 8, 18, .80), 0 1px 16px rgba(2, 8, 18, .55);
}

.dock {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.9vh, 20px);
  width: min(100%, var(--dock-w));
}

.dock__intro {
  text-shadow: var(--halo);
}

.dock__eyebrow {
  font-size: 12.5px;
  letter-spacing: .18em;
  color: #8fe2ff;
}

.dock__title {
  margin: 8px 0 0;
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(2, 8, 18, .95), 0 3px 20px rgba(2, 8, 18, .85);
}
.dock__title em {
  display: block;
  font-style: normal;
  /* 提亮渐变：背景是动态视频，深色端在暗部画面里会糊掉 */
  background: linear-gradient(100deg, #cdf6ff 0%, #8ce4ff 45%, #a9bcff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 注意：这里不能用 text-shadow —— 在 background-clip:text 的元素上
     text-shadow 会盖在渐变填充之上，把亮色渐变糊成暗色。
     改用 drop-shadow，它跟随裁剪后的字形轮廓，只在外围形成光晕。 */
  text-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(2, 8, 18, .95))
          drop-shadow(0 3px 14px rgba(2, 8, 18, .75));
}

.dock__sub {
  margin-top: 10px;
  font-size: 13.5px;
  color: rgba(233, 244, 255, .88);
  letter-spacing: .04em;
}

/* --- 按钮 --- */
.actions { display: flex; flex-direction: column; gap: 11px; }

.action {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), box-shadow .2s var(--ease);
}

/* 「最新兑换码」是弹窗触发按钮而非跳转，用 <button> 实现；
   这里清掉按钮的浏览器默认外观，使其与 <a> 版本完全一致 */
button.action {
  width: 100%;
  margin: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.action::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--azure), var(--azure-2));
  opacity: 0;
  transition: opacity .2s var(--ease);
}

.action__icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--azure);
  background: rgba(63, 198, 255, .12);
  border: 1px solid rgba(99, 196, 255, .22);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.action__icon svg { width: 22px; height: 22px; }

.action__label {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .03em;
}

.action__hint {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.action__arrow {
  grid-column: 3;
  grid-row: 1 / span 2;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-3);
  transition: transform .2s var(--ease), color .2s var(--ease);
}

.action:hover,
.action:focus-visible {
  transform: translateX(5px);
  border-color: var(--line-strong);
  background: rgba(12, 32, 60, .68);
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(63, 198, 255, .10);
}
.action:hover::before,
.action:focus-visible::before { opacity: 1; }
.action:hover .action__arrow,
.action:focus-visible .action__arrow { transform: translateX(4px); color: var(--azure); }

.action--primary {
  border-color: rgba(90, 200, 255, .42);
  background:
    linear-gradient(100deg, rgba(47, 107, 255, .34), rgba(63, 198, 255, .18)),
    var(--glass);
  box-shadow: 0 10px 34px rgba(31, 110, 220, .28);
}
.action--primary .action__icon {
  color: #eaf9ff;
  background: linear-gradient(135deg, var(--azure-2), var(--azure));
  border-color: transparent;
}

/* ---------- 6. 公告区 ---------- */
.notice {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  overflow: hidden;
}

.notice__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(63, 198, 255, .05);
}

.notice__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
}

.notice__live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(56, 224, 122, .55);
  animation: live-pulse 2.4s var(--ease) infinite;
}

.notice__more {
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
  letter-spacing: .04em;
  transition: color .18s var(--ease);
}
.notice__more:hover { color: var(--azure); }

/* 公告为空时的占位：撑满列表并居中 */
.notice__empty {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 16px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: .06em;
}

.notice__list {
  display: flex;
  flex-direction: column;
  max-height: clamp(140px, 21vh, 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 190, 255, .30) transparent;
}
.notice__list::-webkit-scrollbar { width: 6px; }
.notice__list::-webkit-scrollbar-track { background: transparent; }
.notice__list::-webkit-scrollbar-thumb {
  background: rgba(120, 190, 255, .26);
  border-radius: 3px;
}
.notice__list::-webkit-scrollbar-thumb:hover { background: rgba(120, 190, 255, .45); }

.notice__link {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  text-decoration: none;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}

/* 会开弹窗的公告用 <button> 实现，这里清掉按钮默认外观 */
button.notice__link {
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* 多一列放右侧箭头，暗示这条可以点开 */
.notice__link--more { grid-template-columns: auto auto 1fr auto; }

.notice__arrow {
  font-size: 16px;
  line-height: 1;
  color: var(--ink-3);
  transition: transform .16s var(--ease), color .16s var(--ease);
}
.notice__link--more:hover .notice__arrow,
.notice__link--more:focus-visible .notice__arrow {
  transform: translateX(3px);
  color: var(--azure);
}

.notice__link:hover,
.notice__link:focus-visible {
  background: rgba(63, 198, 255, .10);
  color: var(--ink);
  transform: translateX(2px);
}

.notice__date {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.notice__tag {
  flex: none;
  padding: 1px 7px;
  border-radius: var(--r-full);
  border: 1px solid currentColor;
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .04em;
  opacity: .95;
}
.notice__tag[data-tag="活动"] { color: #ffc978; }
.notice__tag[data-tag="公告"] { color: #7fb7ff; }
.notice__tag[data-tag="爆料"] { color: #c79bff; }
.notice__tag[data-tag="礼包"] { color: #66e6b0; }
.notice__tag[data-tag="更新"] { color: #57d8ff; }
.notice__tag[data-tag="福利"] { color: #ff9ec4; }

.notice__text {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 7. 群聊面板 ---------- */

/* 头像：消息、成员列表共用 */
.av {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  user-select: none;
}
.av--lg { width: 36px; height: 36px; font-size: 14.5px; }
.av--off { opacity: .45; filter: saturate(.55); }

/* ---- 顶栏：群名 + 功能图标 ----
   做成和「群公告」一致的卡片：淡蓝底 + 亮边 + 圆角，
   这样上下三块（顶栏 / 公告 / 输入区）风格统一、边界清楚。 */
.chat__head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 8px 0;
  padding: 8px 10px 8px 13px;
  border: 2px solid rgba(162, 222, 255, .72);
  border-radius: 10px;
  background: rgba(16, 48, 88, .34);
  box-shadow: 0 0 0 1px rgba(4, 12, 26, .55);
}

.chat__title {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat__count { color: rgba(222, 238, 255, .9); font-weight: 500; font-size: 12.5px; }

.chat__tools { display: flex; align-items: center; gap: 3px; flex: none; }

/* 图标按钮做成有底有边的「小方块」，否则透明面板上根本看不到 */
.ctool {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(150, 214, 255, .30);
  border-radius: 7px;
  background: rgba(6, 18, 36, .40);
  color: rgba(232, 244, 255, .95);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease);
}
.ctool svg { width: 17px; height: 17px; }
.ctool:not(:disabled):hover {
  background: rgba(63, 198, 255, .28);
  border-color: var(--panel-edge);
  color: #fff;
}
.ctool:disabled { cursor: not-allowed; opacity: .78; }
/* 作者样式里的 display 会盖掉 UA 的 [hidden]{display:none}，
   而「设置」图标正是靠 hidden 属性控制显隐的，必须显式写一条。
   少了这条，未登录 / 普通成员也会看到设置图标。 */
.ctool[hidden] { display: none; }

/* 在线小绿点 */
.chat__live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 2.4s var(--ease) infinite;
}

/* ---- 主体：左消息 + 右侧栏 ---- */
.chat__main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

/* 注意 min-height: 0 —— flex 子项默认 min-height:auto 不会收缩，
   少了它消息列表会撑到内容高度，面板比视口还高，列表就不滚动了 */
.chat__col {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat__listwrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.chat__list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 12px 12px 14px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 190, 255, .30) transparent;
}
.chat__list::-webkit-scrollbar { width: 6px; }
.chat__list::-webkit-scrollbar-track { background: transparent; }
.chat__list::-webkit-scrollbar-thumb { background: rgba(120, 190, 255, .26); border-radius: 3px; }

/* 「有新消息」浮标：往上翻之后出现，点一下回到最新 */
.chat__newmsg {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: rgba(10, 26, 48, .94);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.chat__newmsg svg { width: 14px; height: 14px; color: var(--azure); }
.chat__newmsg:hover { background: rgba(14, 34, 62, .96); transform: translateX(-50%) translateY(-1px); }

/* 作者样式里的 display 会盖掉 UA 的 [hidden]{display:none}，
   所以凡是靠 hidden 属性开关的元素都要显式写一条。 */
.chat__newmsg[hidden],
.lightbox__img[hidden],
.lightbox__video[hidden] { display: none; }

/* ---- 消息 ---- */
.msg { display: flex; align-items: flex-start; gap: 9px; }
.msg--me { flex-direction: row-reverse; }

.msg__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  /* 面板变宽后限制一下正文宽度，行太长不好读 */
  max-width: min(82%, 480px);
}
.msg--me .msg__body { align-items: flex-end; }

.msg__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-3);
}
.msg--me .msg__meta { flex-direction: row-reverse; }

.msg__name { font-size: 12px; color: #9fd8ff; }
.msg--me .msg__name { color: #cfe9ff; }
.msg__alias { font-size: 11px; color: var(--ink-3); }

.msg__role {
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid currentColor;
  color: var(--gold);
  font-size: 9.5px;
  line-height: 1.5;
}

.msg__time { font-variant-numeric: tabular-nums; }

/* 他人消息不加气泡（与参考布局一致）；自己的消息用气泡区分 */
.msg__text {
  font-size: 13.5px;
  line-height: 1.66;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--me .msg__text {
  padding: 8px 12px;
  border-radius: 12px 4px 12px 12px;
  border: 1px solid rgba(99, 196, 255, .38);
  background: linear-gradient(135deg, rgba(47, 107, 255, .55), rgba(63, 198, 255, .38));
}

/* 居中系统提示与日期分隔 */
.msg--system { justify-content: center; }
.msg__sys {
  padding: 3px 11px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .055);
  font-size: 11.5px;
  color: var(--ink-3);
}

.msg--time { justify-content: center; }
.msg--time time {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

/* 向上翻历史的提示行（「↑ 向上滚动查看更早的消息」/「已经是最早的消息了」） */
.msg--hint { margin: 2px 0; }
.msg--hint time {
  font-size: 11px;
  color: rgba(190, 216, 244, .72);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(140, 195, 250, .28);
  background: rgba(6, 20, 40, .5);
}

/* ---- 图片 / 视频消息 ---- */
.media {
  display: block;
  position: relative;
  width: min(320px, 100%);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #061020;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.media:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.media img, .media video { display: block; width: 100%; height: auto; }

.media__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 20, .26);
  color: #eaf4ff;
  transition: background .18s var(--ease);
}
.media:hover .media__play { background: rgba(4, 10, 20, .14); }
.media__play svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .55));
}

.media__dur {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(2, 8, 18, .74);
  font-size: 11px;
  color: #eaf4ff;
  font-variant-numeric: tabular-nums;
}

/* ---- 底部输入区（同样做成卡片） ---- */
.editor {
  position: relative;
  flex: 0 0 auto;
  margin: 0 8px 7px;
  border: 2px solid rgba(162, 222, 255, .72);
  border-radius: 10px;
  background: rgba(16, 48, 88, .34);
  box-shadow: 0 0 0 1px rgba(4, 12, 26, .55);
}

.editor__tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
}
/* 工具栏与输入框之间的分隔线（卡片内部，保留双线） */
.editor__tools::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(180deg,
    rgba(198, 238, 255, .80) 0 1px,
    rgba(4, 12, 26, .70) 1px 2px);
  pointer-events: none;
}

/* 表情 / 截图 / 图片等图标：做成带底带边的小方块才看得见 */
.etool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(150, 214, 255, .34);
  border-radius: 8px;
  background: rgba(6, 18, 36, .44);
  color: rgba(232, 244, 255, .95);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease);
}
.etool svg { width: 18px; height: 18px; }
.etool:not(:disabled):hover {
  background: rgba(63, 198, 255, .28);
  border-color: var(--panel-edge);
  color: #fff;
}
.etool:disabled { cursor: not-allowed; opacity: .78; }

.editor__box { padding: 7px 10px 10px; }

.editor__input {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 132px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  resize: none;
  overflow-y: auto;
  scrollbar-width: thin;
}
.editor__input::placeholder { color: var(--ink-3); }
.editor__input:focus { outline: none; }

.editor__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
}

.editor__hint { font-size: 11px; color: var(--ink-3); }

.editor__send {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 7px 8px 7px 16px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--azure-2), var(--azure));
  color: #eaf9ff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .18s var(--ease), transform .18s var(--ease);
}
.editor__send:hover { filter: brightness(1.1); }
.editor__send:active { transform: translateY(1px); }

.editor__caret {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, .38);
  font-size: 10px;
  opacity: .9;
}

/* ---- 右侧栏：群公告 + 群成员 ---- */
.chat__side {
  position: relative;
  display: none;              /* 窄屏收起，用顶栏的「成员」按钮看全部成员 */
  /* 占面板宽度的三分之一左右，够宽才放得下昵称 + 身份标签 */
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  min-height: 0;
  flex-direction: column;
}
/* 消息区与右栏之间的竖分割线：左暗右亮的双线 */
.chat__side::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(90deg,
    rgba(4, 12, 26, .85) 0 1px,
    rgba(198, 238, 255, .95) 1px 2px);
  pointer-events: none;
}

.sidecard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* 两张卡片之间的横分割线 */
.sidecard--grow::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 2px;
  background: linear-gradient(180deg,
    rgba(198, 238, 255, .95) 0 1px,
    rgba(4, 12, 26, .85) 1px 2px);
  pointer-events: none;
}
.sidecard--grow { flex: 1 1 auto; }

.sidecard__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
}

/* 「群公告」要明显突出：做成一张独立的描边卡片 ——
   四周 2px 亮边 + 左侧 4px 强调色 + 一层很淡的蓝色底，
   淡底只覆盖这一小块，不会把主背景挡住。 */
.sidecard--notice {
  /* 不能被压缩：它没有滚动能力，一挤就会把文字溢到成员列表上。
     高度不够时让下面的成员列表（自带滚动）去让位。 */
  flex: 0 0 auto;
  margin: 9px 9px 4px;
  border: 2px solid rgba(162, 222, 255, .72);
  border-left: 4px solid var(--azure);
  border-radius: 10px;
  background: rgba(16, 48, 88, .34);
  box-shadow: 0 0 0 1px rgba(4, 12, 26, .55);
}
.sidecard--notice .sidecard__head {
  gap: 9px;
  padding: 12px 13px 8px 13px;
}
.sidecard--notice .sidecard__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
}
.sidecard--notice .sidecard__icon { color: #8fe0ff; }
.sidecard--notice .sidecard__icon svg { width: 18px; height: 18px; }
.sidecard--notice .sidecard__body {
  padding: 0 12px 11px 12px;
  font-size: 12.5px;
  line-height: 1.7;
}
.sidecard--notice .sidecard__arrow { font-size: 17px; color: rgba(226, 240, 255, .9); }

.sidecard__title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .04em;
}
.sidecard__num { color: rgba(214, 231, 250, .85); font-weight: 500; }
.sidecard__arrow { color: rgba(214, 231, 250, .85); font-size: 15px; line-height: 1; }

.sidecard__online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(214, 231, 250, .85);
}

.sidecard__body {
  padding: 0 12px 11px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.75;
  /* 面板没有底色，这里不用半透明灰，直接给接近纯白的实色；
     字重也加半档，靠更粗的笔画补一点对比度 */
  color: rgba(244, 250, 255, .98);
}
.sidecard__body p {
  display: flex;
  gap: 6px;
  margin: 0 0 4px;
}
.sidecard__body p:last-child { margin-bottom: 0; }
.emo { flex: none; }

/* ---- 成员列表（侧栏与弹窗共用） ---- */
.mlist {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  padding: 0 6px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 190, 255, .30) transparent;
}
.mlist::-webkit-scrollbar { width: 6px; }
.mlist::-webkit-scrollbar-track { background: transparent; }
.mlist::-webkit-scrollbar-thumb { background: rgba(120, 190, 255, .26); border-radius: 3px; }

.mlist--modal {
  max-height: min(54vh, 440px);
  padding: 0;
}

.mlist__item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 6px 7px;
  border-radius: var(--r-sm);
}
.mlist--modal .mlist__item { grid-template-columns: 36px 1fr auto; padding: 7px 9px; }
.mlist__item:hover { background: rgba(63, 198, 255, .08); }

.mlist__name {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(244, 250, 255, .98);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mlist__alias { color: rgba(220, 236, 252, .88); font-size: 11.5px; }

.mlist__role {
  flex: none;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.6;
  background: rgba(63, 198, 255, .18);
  color: #9fd8ff;
}
.mlist__role--owner {
  background: rgba(255, 168, 90, .20);
  color: #ffbe7a;
}

/* 图片 / 视频查看器的样式在第 8 节弹窗之后定义 —— 见「媒体查看器」一节。
   原因：它会覆盖 .modal__dialog / .modal__close 的同权重规则，
   必须在它们之后出现才生效。 */

/* ---------- 8. 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, .74);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade-in .18s var(--ease);
}

.modal__dialog {
  position: relative;
  width: min(100%, 468px);
  max-height: min(86vh, 660px);
  overflow-y: auto;
  padding: 26px 24px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(11, 27, 50, .97), rgba(6, 16, 32, .98));
  box-shadow: var(--shadow-2);
  animation: modal-in .2s var(--ease);
}

/* 对话框本身只是焦点落点，弹窗已在视觉上足够醒目；
   内部可交互元素的焦点环不受影响 */
.modal__dialog:focus,
.modal__dialog:focus-visible { outline: none; }

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }

.modal__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  padding-right: 36px;
}

.modal__lead {
  margin: 8px 0 16px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-3);
}

.modal__note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* 兑换码列表：自适应网格，宽屏两列、窄屏一列；
   数量增加时弹窗内部滚动，无需调整样式 */
.codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 9px;
  max-height: min(48vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 190, 255, .30) transparent;
}
.codes::-webkit-scrollbar { width: 6px; }
.codes::-webkit-scrollbar-track { background: transparent; }
.codes::-webkit-scrollbar-thumb {
  background: rgba(120, 190, 255, .26);
  border-radius: 3px;
}

.codes__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(63, 198, 255, .05);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .16s var(--ease), background .16s var(--ease),
              color .16s var(--ease), transform .16s var(--ease);
}
.codes__item:hover {
  border-color: var(--line-strong);
  background: rgba(63, 198, 255, .13);
  transform: translateY(-1px);
}
.codes__item:active { transform: translateY(0); }

.codes__code { pointer-events: none; }

.codes__copy {
  display: grid;
  place-items: center;
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  transition: color .16s var(--ease);
}
.codes__copy svg { width: 16px; height: 16px; }
.codes__icon-done { display: none; }

/* 复制成功反馈 */
.codes__item.is-copied {
  border-color: rgba(56, 224, 122, .55);
  background: rgba(56, 224, 122, .14);
  color: #b8ffd9;
}
.codes__item.is-copied .codes__icon-copy { display: none; }
.codes__item.is-copied .codes__icon-done { display: block; }
.codes__item.is-copied .codes__copy { color: #6ef0ab; }

.codes__status {
  min-height: 18px;
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--green);
  letter-spacing: .02em;
}

/* 内容较长的公告详情弹窗用加宽版 */
.modal__dialog--wide { width: min(100%, 620px); }

/* ---------- 手动复制弹窗（非 https 页面自动复制失败时的兜底） ---------- */
.codes__manual {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(197, 224, 250, .78);
  font: inherit;
  font-size: 12px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .15s var(--ease);
}
.codes__manual:hover,
.codes__manual:focus-visible { color: #eaf4ff; }

.modal__dialog--copy { width: min(100%, 440px); }

.copybox {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 16, 32, .94);
  color: #eaf4ff;
  font: inherit;
  font-size: clamp(17px, 5vw, 22px);
  font-weight: 600;
  letter-spacing: .14em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.copybox:focus,
.copybox:focus-visible {
  outline: 2px solid rgba(63, 198, 255, .62);
  outline-offset: 2px;
}

.copybox__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.copybox__actions .abtn { flex: 1 1 auto; }

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .07);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: #eaf4ff;
}

/* 内容较长的公告详情弹窗用加宽版（上方为手动复制弹窗样式） */

.cdk { display: flex; flex-direction: column; gap: 11px; }

.cdk__group {
  padding: 12px 14px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(63, 198, 255, .04);
}

.cdk__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}

/* 兑换码按钮复用 .codes__item 的外观与「已复制」反馈，只是不再占满整行 */
.cdk__code-btn {
  width: auto;
  min-width: 136px;
  padding: 8px 12px;
  font-size: 14px;
}

.cdk__name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
}

.cdk__rewards {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  line-height: 1.72;
  color: var(--ink-2);
}
.cdk__rewards li {
  position: relative;
  padding-left: 13px;
}
.cdk__rewards li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--azure);
  opacity: .6;
}

/* ---------- 媒体查看器 ----------
   放在第 8 节弹窗之后：它覆盖 .modal__dialog / .modal__close 的同权重规则，
   必须后定义才生效（放前面会被覆盖，弹窗会退回到 468px 的小尺寸）。 */
.modal__dialog--media {
  width: min(94vw, 1000px);
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lightbox__img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #000;
}
.lightbox__video {
  display: block;
  width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #000;
}
.lightbox__cap {
  margin: 0;
  font-size: 12.5px;
  color: rgba(233, 244, 255, .88);
  text-align: center;
}
.modal__close--float {
  top: -42px;
  right: 0;
  background: rgba(6, 16, 32, .85);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---------- 8b. 账号 / 群管理 / 访问统计 ---------- */

/* 顶栏里的访问次数小卡 */
.visits {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(162, 222, 255, .55);
  background: rgba(10, 30, 58, .46);
  box-shadow: 0 0 0 1px rgba(4, 12, 26, .55);
  line-height: 1.2;
}
.visits__row { display: flex; align-items: baseline; gap: 9px; }
.visits__label {
  font-size: 11px;
  letter-spacing: .1em;
  color: rgba(214, 231, 250, .92);
}
.visits__num {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.visits__row--sub .visits__num { font-size: 13.5px; font-weight: 600; color: #cfe8ff; }
.visits__row--sub .visits__label { font-size: 10.5px; }

/* 面板顶部的提示条（未登录 / 连不上后端 / 被禁言等） */
.chat__banner {
  margin: 8px 8px 0;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 176, 90, .55);
  background: rgba(70, 40, 8, .55);
  color: #ffd9a8;
  font-size: 12.5px;
  line-height: 1.6;
}
.chat__banner[hidden] { display: none; }
.chat__banner[data-tone="error"] {
  border-color: rgba(255, 120, 120, .6);
  background: rgba(70, 14, 20, .58);
  color: #ffc4c4;
}

/* 表情选择器 */
.emoji {
  position: absolute;
  left: 8px;
  bottom: calc(100% - 6px);
  z-index: 6;
  width: min(330px, calc(100% - 16px));
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(162, 222, 255, .72);
  background: rgba(9, 26, 50, .97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
}
.emoji[hidden] { display: none; }
.emoji__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 190px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.emoji__item {
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  padding: 6px 0;
  cursor: pointer;
  transition: background .14s var(--ease);
}
.emoji__item:hover { background: rgba(63, 198, 255, .24); }

/* 标签页 */
.tabs {
  display: flex;
  gap: 4px;
  margin: 12px 0 14px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 38, .5);
}
.tab {
  flex: 1 1 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.tab.is-active { background: rgba(63, 198, 255, .22); color: #fff; font-weight: 600; }

/* 登录 / 注册表单 */
.authform { display: flex; flex-direction: column; gap: 11px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field[hidden] { display: none; }
.field__label { font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }
.field__input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 38, .72);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field__input::placeholder { color: rgba(150, 175, 205, .75); }
.field__input:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 3px rgba(63, 198, 255, .15);
}
.authform__msg { min-height: 17px; margin: 0; font-size: 12.5px; color: #ff9c9c; }
.authform__msg.is-ok { color: var(--green); }
.authform__submit {
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--azure-2), var(--azure));
  color: #eaf9ff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .16s var(--ease);
}
.authform__submit:hover { filter: brightness(1.08); }
.authform__submit:disabled { opacity: .6; cursor: progress; }

/* 群管理面板 */
.adminpane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(52vh, 430px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.adminpane[hidden] { display: none; }
.adminpane__empty { padding: 20px 4px; text-align: center; font-size: 13px; color: var(--ink-3); }

.arow {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 38, .45);
}
.arow__name { font-size: 13.5px; color: var(--ink); }
.arow__sub { font-size: 11px; color: var(--ink-3); }
.arow__sub b { color: #ffbe7a; font-weight: 600; }
.arow__acts { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.abtn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(63, 198, 255, .10);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.abtn:hover:not(:disabled) {
  background: rgba(63, 198, 255, .24);
  border-color: var(--line-strong);
  color: #fff;
}
.abtn--danger { background: rgba(255, 92, 92, .14); border-color: rgba(255, 120, 120, .4); color: #ffb4b4; }
.abtn--danger:hover:not(:disabled) { background: rgba(255, 92, 92, .28); color: #fff; }
.abtn:disabled { opacity: .38; cursor: not-allowed; }

.msg { position: relative; }

/* ---------- 回复引用（v2.2）----------
   被回复的消息摘要直接挂在消息内容上方，点一下跳到原消息 */
.msg__quote {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 5px;
  padding: 5px 9px 6px 10px;
  border: 0;
  border-left: 2px solid rgba(120, 195, 255, .75);
  border-radius: 0 8px 8px 0;
  background: rgba(8, 24, 45, .62);
  color: rgba(214, 231, 250, .88);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background .15s var(--ease);
}
.msg--me .msg__quote { text-align: left; }
.msg__quote[data-goto]:hover,
.msg__quote[data-goto]:focus-visible { background: rgba(14, 40, 72, .82); }
.msg__quote:not([data-goto]) { cursor: default; }
.msg__quote-name { color: #9fd8ff; font-weight: 600; }
.msg__quote-kind { color: #ffd27a; }
.msg__quote-text {
  display: block;
  color: rgba(198, 220, 245, .72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 「跳过去」时红色闪三次，让用户知道是哪条 */
.msg--flash {
  animation: msg-target-cycle .55s ease-in-out 3;
  border-radius: 10px;
}
.msg--flash .msg__body {
  border-radius: 10px;
  animation: none;
}
@keyframes msg-target-cycle {
  0%, 100% { background-color: rgba(245, 69, 92, .08); }
  50% { background-color: rgba(245, 69, 92, .42); }
}
/* 多条置顶消息：只显示当前这一条，点击后依次查看上一条 */
.msg--alert-flash { animation: msg-alert-flash .55s ease-in-out 3; }
@keyframes msg-alert-flash {
  0%, 100% { background-color: rgba(245, 69, 92, .08); }
  50% { background-color: rgba(245, 69, 92, .42); }
}

/* ---------- 输入框上方的「正在回复」条 ---------- */
.editor__reply {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 6px;
  padding: 6px 8px 6px 0;
  border-radius: 8px;
  background: rgba(8, 24, 45, .72);
  border: 1px solid var(--line);
  overflow: hidden;
}
.editor__reply[hidden] { display: none; }
.editor__reply-bar {
  flex: none;
  width: 3px;
  align-self: stretch;
  border-radius: 0 3px 3px 0;
  background: rgba(120, 195, 255, .85);
}
.editor__reply-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: rgba(214, 231, 250, .82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor__reply-text em { font-style: normal; color: #9fd8ff; font-weight: 600; }
.editor__reply-preview {
  margin-left: 6px;
  color: rgba(190, 214, 240, .62);
}
.editor__reply-cancel {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(206, 228, 252, .75);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.editor__reply-cancel:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.editor__reply-cancel svg { width: 12px; height: 12px; }

/* ---------- 右键菜单（群主 / 管理员）---------- */
.ctxmenu {
  position: fixed;
  z-index: 260;                 /* 高于聊天面板，低于弹窗（弹窗是 300） */
  min-width: 168px;
  padding: 5px;
  border-radius: 12px;
  border: 2px solid var(--panel-edge-outer);
  box-shadow: 0 18px 40px rgba(2, 8, 18, .55), inset 0 0 0 1px var(--panel-edge);
  background: rgba(6, 20, 38, .96);
  font-size: 13px;
  animation: modal-in .12s var(--ease);
}
.ctxmenu[hidden] { display: none; }

.ctxmenu__head {
  margin: 2px 4px 5px;
  padding: 0 2px 5px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: rgba(190, 214, 240, .68);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctxmenu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(232, 243, 255, .94);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.ctxmenu__item:hover:not(:disabled),
.ctxmenu__item:focus-visible {
  background: rgba(63, 198, 255, .22);
  color: #fff;
  outline: none;
}
.ctxmenu__item:disabled { opacity: .42; cursor: not-allowed; }
.ctxmenu__item--danger { color: #ffbcbc; }
.ctxmenu__item--danger:hover:not(:disabled),
.ctxmenu__item--danger:focus-visible { background: rgba(255, 92, 92, .26); color: #fff; }
.ctxmenu__item[hidden] { display: none; }
.ctxmenu__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  opacity: .82;
}
.ctxmenu__icon svg { width: 16px; height: 16px; }

/* 已撤回的消息：居中一行浅色提示 */
.msg--recalled { justify-content: center; }.msg__recalled {
  padding: 3px 11px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .05);
  font-size: 11.5px;
  color: rgba(214, 231, 250, .75);
}
.msg__recalled em { font-style: normal; color: #9fd8ff; }

/* 会话标题：群聊 / 私聊切换 */
.chat__back {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 2px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(63, 198, 255, .16);
  color: #fff;
  cursor: pointer;
}
.chat__back[hidden] { display: none; }
.chat__back svg { width: 15px; height: 15px; }
.chat__back:hover { background: rgba(63, 198, 255, .32); }
.chat__title { display: flex; align-items: center; gap: 2px; }
.chat__conv { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 未读红点 / 计数 */
.chat__unread {
  flex: none;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: #f5455c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}
.chat__unread[hidden] { display: none; }

/* 成员行上的未读私聊小红点 */
.mlist__unread {
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: 5px;
  border-radius: 50%;
  background: #f5455c;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3);
}
.mlist__item--dm { cursor: pointer; }
.mlist__item--dm:hover { background: rgba(63, 198, 255, .16); }

/* @ 选择器 */
.mention {
  position: absolute;
  left: 8px;
  bottom: calc(100% - 6px);
  z-index: 7;
  width: min(280px, calc(100% - 16px));
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(162, 222, 255, .72);
  background: rgba(9, 26, 50, .97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
}
.mention[hidden] { display: none; }
.mention__hint {
  padding: 0 6px 6px;
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(214, 231, 250, .8);
}
.mention__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 190px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.mention__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.mention__item:hover { background: rgba(63, 198, 255, .22); }
.mention__empty { padding: 10px; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* 消息正文里被 @ 到的高亮 */
.mention-tag {
  color: #7fd8ff;
  font-weight: 600;
}
/* 自己被 @ 到的消息，整条加一层淡色描边 */
.msg--mentioned .msg__text,
.msg--mentioned .msg__emoji {
  border-left: 2px solid #f5455c;
  padding-left: 8px;
}

/* 表情消息：单独放大 */
.msg__emoji { font-size: 40px; line-height: 1.25; }

/* 输入区的登录状态 */
.editor__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(216, 233, 252, .92);
}
.editor__login {
  padding: 4px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--panel-edge);
  background: rgba(63, 198, 255, .22);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .16s var(--ease);
}
.editor__login:hover { background: rgba(63, 198, 255, .36); }
.editor__role {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid currentColor;
  font-size: 10.5px;
  line-height: 1.5;
}
.editor__role[data-role="owner"] { color: #ffbe7a; }
.editor__role[data-role="admin"] { color: #9fd8ff; }
.editor__role[data-role="member"] { color: rgba(214, 231, 250, .8); }
.editor__logout {
  border: 0;
  background: transparent;
  color: rgba(214, 231, 250, .78);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.editor__logout:hover { color: #fff; }

.editor__input:disabled { color: rgba(214, 231, 250, .6); cursor: not-allowed; }
.editor__send:disabled { opacity: .5; cursor: not-allowed; }

/* 成员列表里的状态标记 */
.mlist__flags { display: inline-flex; gap: 4px; margin-left: 6px; }
.mlist__flag {
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9.5px;
  line-height: 1.6;
  border: 1px solid currentColor;
}
.mlist__flag[data-flag="muted"] { color: #ffd08a; }
.mlist__flag[data-flag="banned"] { color: #ff9c9c; }

/* ---------- 9. 响应式 ---------- */

/* 够宽才展开群聊右侧栏（群公告 + 群成员）；
   窄屏收起，改由顶栏的「成员」按钮打开成员弹窗 */
@media (min-width: 1280px) {
  .chat__side { display: flex; }
  .ctool--members { display: none; }
}

/* 桌面端整屏不滚动：页面取视口高度，群聊消息区 / 公告列表内部滚动。
   这里**不能**再拿「高度 ≥ 820px」当门槛：窗口矮一点时 .page 就没有
   确定高度，群聊面板会被内容撑到比视口还高，消息列表反而不再滚动。 */
@media (min-width: 901px) {
  .page { height: 100vh; height: 100svh; }

  .stage { min-height: 0; }
  .chat { min-height: 0; }
  .dock { min-height: 0; }

  /* 公告面板吃掉左侧剩余空间（仅在 .dock 有确定高度时生效） */
  .notice {
    flex: 1 1 auto;
    min-height: 132px;
    display: flex;
    flex-direction: column;
  }
  .notice__head { flex: 0 0 auto; }
  .notice__list {
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (max-width: 900px) {
  /* 竖屏下视频被横向裁掉大半，左侧书法字根本不在画面内，无需偏移 */
  :root {
    --dock-w: 100%;
    --page-pad: clamp(16px, 5vw, 24px);
    --dock-offset: 0px;
  }

  .page { padding: 0 var(--page-pad); }

  /* 窄屏改为上下堆叠：功能区在上，群聊在下 */
  .stage {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 18px;
  }

  .chat {
    flex: none;                 /* 纵向堆叠时 flex-basis 会变成高度基准，必须复位 */
    width: 100%;
    max-width: 560px;
    min-width: 0;
    margin: 0 auto;
    /* 手机按屏幕高度取高度：固定 560px 在矮屏手机上会让页面长得离谱，
       也会把输入框顶到屏幕外面。svh 用「不含浏览器工具栏」的可视高度，
       不支持 svh 的老浏览器用上一行的 560px 兜底。 */
    height: 560px;
    height: clamp(420px, 72svh, 620px);
    min-height: 0;
    align-self: auto;
  }
  .dock { max-width: 560px; margin: 0 auto; }

  .notice__list { max-height: 210px; }

  /* 手机上把聊天面板的留白收紧，把空间还给消息区 */
  .chat__head { padding: 9px 10px; column-gap: 8px; }
  .chat__title { font-size: 14px; }
  .chat__list { padding: 10px 10px 6px; }
  .msg { gap: 7px; }
  .msg__text { font-size: 13.5px; padding: 7px 10px; }
  .msg__emoji { font-size: 32px; }
  .editor { padding: 8px 8px 9px; }
  .editor__foot { column-gap: 8px; }

  /* 手机上成员 / 设置的弹窗铺满宽度 */
  .modal__dialog { width: min(100%, 560px); }
  .modal__dialog--wide { width: min(100%, 560px); }
}

@media (max-width: 480px) {
  .chat { height: clamp(400px, 76svh, 640px); }
  .chat__title { font-size: 13.5px; }
  .msg__name { font-size: 11.5px; }
  .msg__text { font-size: 13px; }
  .editor__tools { column-gap: 4px; }
  .action { padding: 10px 12px; }
  .modal__dialog { padding: 18px 15px 16px; }
}

@media (max-width: 420px) {
  .dock__title { font-size: 27px; }
  .action { padding: 11px 13px; column-gap: 12px; grid-template-columns: 40px 1fr auto; }
  .action__icon { width: 40px; height: 40px; }
  .action__icon svg { width: 20px; height: 20px; }
  .action__label { font-size: 15.5px; }
  .notice__tag { display: none; }
  .notice__link { grid-template-columns: auto 1fr; }
  /* 带箭头的公告仍是三列，否则箭头会被挤到第二行 */
  .notice__link--more { grid-template-columns: auto 1fr auto; }
}

/* 横屏矮屏：主区改为顶对齐，别让功能区被垂直居中挤到视口外 */
@media (max-height: 620px) and (min-width: 901px) {
  .stage { align-items: flex-start; }
  .notice__list { max-height: 168px; }
}

/* ---------- 10. 动效与可访问性 ---------- */
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 224, 122, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(56, 224, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 224, 122, 0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .msg--flash, .msg--flash .msg__body { animation: none !important; }
  .msg--flash { background-color: rgba(245, 69, 92, .42); }
  .msg--flash .msg__body { background-color: transparent; }
  .action:hover, .action:focus-visible { transform: none; }
}

@media (prefers-contrast: more) {
  :root {
    --ink-2: #eaf4ff;
    --ink-3: #cfe2fb;
    --line: rgba(150, 205, 255, .45);
    /* 高对比需求下加重卡片底与文字阴影，而不是给背景加压暗层 */
    --glass: rgba(4, 12, 26, .92);
    --glass-2: rgba(4, 12, 26, .95);
  }
}

/* ---------- 11. 群聊：群资料 / 实时状态 / 文件 / 已读 / 编辑 ---------- */

.chat__gav {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: rgba(63, 198, 255, .18);
  color: #dff0ff;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}
.chat__gav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat__online {
  flex: none;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  border: 1px solid rgba(120, 195, 255, .32);
  background: rgba(56, 224, 122, .12);
  color: #a9ecc4;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.chat__conn {
  margin: 6px 0 0;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 190, 122, .4);
  background: rgba(70, 42, 8, .55);
  color: #ffd9a8;
  font-size: 12px;
  text-align: center;
}
.chat__conn[hidden] { display: none; }
.chat__conn[data-state="open"] { display: none; }

.msearch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 7px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(6, 20, 40, .55);
}
.msearch svg { width: 14px; height: 14px; flex: none; color: var(--ink-3); }
.msearch input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink-1);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}
.msearch input::placeholder { color: var(--ink-3); }

.chat__typing {
  margin: 0 0 4px;
  padding: 0 4px;
  height: 15px;
  font-size: 11.5px;
  color: rgba(190, 216, 244, .85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat__typing[hidden] { display: none; }

.filecard {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(300px, 100%);
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 24, 45, .8);
  color: var(--ink-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.filecard:hover, .filecard:focus-visible { background: rgba(16, 44, 78, .9); }
.filecard__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(63, 198, 255, .16);
  color: #9fd8ff;
}
.filecard__icon svg { width: 18px; height: 18px; }
.filecard__body { min-width: 0; }
.filecard__name {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filecard__meta { display: block; font-size: 11.5px; color: var(--ink-3); }

.msg__flag { margin-left: 6px; font-size: 11px; color: rgba(190, 216, 244, .62); }
.msg__reads { margin-top: 3px; font-size: 11px; color: rgba(160, 210, 255, .72); text-align: right; }

.msg--pending { opacity: .62; }
.msg--failed .msg__body { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 110, 110, .55); }
.msg__retry {
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 120, 120, .55);
  background: rgba(58, 12, 18, .85);
  color: #ffbcbc;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.msg__retry:hover { background: rgba(255, 92, 92, .3); color: #fff; }
.msg__sending { margin-top: 3px; font-size: 11px; color: rgba(190, 216, 244, .6); }

.profile { display: flex; gap: 16px; align-items: flex-start; margin: 6px 0 4px; }
.profile__avatar { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile__fields { flex: 1 1 auto; min-width: 0; }
.profile__meta { margin: 6px 2px 0; font-size: 12px; color: var(--ink-3); }
.av--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; }

.abtn--primary {
  background: rgba(63, 198, 255, .26);
  border-color: rgba(120, 200, 255, .5);
  color: #fff;
}
.abtn--primary:hover:not(:disabled) { background: rgba(63, 198, 255, .4); }

.field__input--area { min-height: 96px; resize: vertical; line-height: 1.6; }
#admin-group .field { margin-bottom: 10px; }
#admin-site-links .field { margin-bottom: 10px; }
.modal__site-links { position: absolute; top: 16px; right: 54px; }
.adminpane__hint { margin: 0 0 8px; font-size: 12px; color: var(--ink-3); }
.arow--off { opacity: .55; }
.arow__tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 190, 122, .4);
  background: rgba(70, 42, 8, .5);
  color: #ffd9a8;
  font-size: 10.5px;
}
.msg--editing .msg__body { box-shadow: 0 0 0 1px rgba(63, 198, 255, .55); border-radius: 10px; }

/* ---------- 12. 显眼度改造：@我 / 私聊未读 / 登录按钮 / 群聊主区 ---------- */

/* 有人 @ 我：整条提示带呼吸感，点一下跳过去 */
/* 置顶消息：放在聊天标题下面，始终醒目显示 */
.chat__pins {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 210, 104, .8);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(93, 61, 12, .94), rgba(117, 74, 13, .78));
  color: #fff0bd;
  font-size: 13px;
  font-weight: 600;
}
.chat__pins[hidden] { display: none; }
.chat__pins-label { flex: none; color: #ffd86b; }
.chat__pin {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.chat__pin:hover, .chat__pin:focus-visible { color: #fff; text-decoration: underline; outline: none; }
.chat__pins-count { flex: none; color: rgba(255, 240, 189, .8); font-size: 11px; font-weight: 500; }

.chat__mention {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 122, 122, .7);
  background: linear-gradient(90deg, rgba(120, 18, 24, .92), rgba(150, 34, 30, .78));
  color: #ffe3e3;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  animation: mention-pulse 1.6s ease-in-out infinite;
}
.chat__mention[hidden] { display: none; }
.chat__mention:hover { background: linear-gradient(90deg, rgba(150, 24, 30, .95), rgba(180, 44, 38, .85)); }
.chat__mention-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8080;
  box-shadow: 0 0 0 4px rgba(255, 110, 110, .25);
}
.chat__mention-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__mention-go {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: 11.5px;
}
@keyframes mention-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, .45); }
  50% { box-shadow: 0 0 0 6px rgba(255, 90, 90, 0); }
}

/* 被 @ 到的那条消息：加底色 + 左侧竖条，比原来只有一圈红边明显得多 */
.msg--mentioned {
  padding: 4px 8px 4px 6px;
  margin: 2px -8px 2px -6px;
  border-radius: 10px;
  background: rgba(140, 26, 26, .34);
  border-left: 3px solid #ff7a7a;
}

/* 私聊未读：从一个小圆点换成带数字的大红标 */
.mlist__unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, .3);
}
.mlist__unread[hidden] { display: none; }

/* 会话标题上的「@我」和「私聊未读」角标 */
.chat__badge {
  flex: none;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.chat__badge--mention { background: #ff4d4f; animation: mention-pulse 1.6s ease-in-out infinite; }
.chat__badge--dm { background: #ff9f1a; }
.chat__badge[hidden] { display: none; }

/* 登录 / 注册：从一行小字改成醒目按钮 */
.editor__login {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(140, 215, 255, .75);
  background: linear-gradient(135deg, #3ec6ff, #2f6bff);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47, 107, 255, .45);
}
.editor__login:hover { filter: brightness(1.08); }
.editor__hint--login { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }

/* 输入区左下角：登录后显示头像 + 昵称 + 改资料入口 */
.editor__me {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 45, .55);
  color: var(--ink-1);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.editor__me:hover { background: rgba(20, 52, 90, .8); border-color: var(--line-strong); }
.editor__me .av { width: 22px; height: 22px; border-radius: 8px; font-size: 11px; }
.editor__me-hint { color: var(--ink-3); font-size: 11px; }

/* 违禁词输入框 */
.field__input--words {
  min-height: 72px;
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: .02em;
}

/* 群聊面板更醒目：品牌色描边 + 外发光，不盖任何底色 */
.chat {
  border: 2px solid rgba(120, 200, 255, .55);
  box-shadow:
    0 0 0 1px rgba(4, 16, 32, .55),
    0 0 0 4px rgba(63, 198, 255, .10),
    0 22px 50px rgba(2, 10, 22, .5);
}

/* 私聊提示条：和 @我 一样的造型，换成橙色区分 */
.chat__mention--dm {
  border-color: rgba(255, 178, 90, .7);
  background: linear-gradient(90deg, rgba(122, 68, 12, .92), rgba(158, 96, 20, .78));
  color: #ffeccc;
  animation: dm-pulse 1.6s ease-in-out infinite;
}
.chat__mention--dm:hover { background: linear-gradient(90deg, rgba(150, 84, 14, .95), rgba(188, 116, 26, .85)); }
.chat__mention--dm .chat__mention-dot { background: #ffb45a; box-shadow: 0 0 0 4px rgba(255, 178, 90, .25); }
@keyframes dm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 165, 60, .45); }
  50% { box-shadow: 0 0 0 6px rgba(255, 165, 60, 0); }
}

/* 成员行可点：给个手型与悬停反馈 */
.mlist__item { cursor: pointer; }
.mlist__item:hover { background: rgba(63, 198, 255, .12); }

/* 头像里的图片 */
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ---------- 13. 第一批：群管理补全 ---------- */

/* 开关（全员禁言） */
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__box {
  flex: none;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 24, 45, .8);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.switch__box::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(214, 231, 250, .85);
  transition: transform .16s var(--ease), background .16s var(--ease);
}
.switch input:checked + .switch__box {
  background: rgba(63, 198, 255, .55);
  border-color: rgba(140, 215, 255, .85);
}
.switch input:checked + .switch__box::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch__box { outline: 2px solid rgba(63, 198, 255, .7); outline-offset: 2px; }
.switch__label { font-size: 13.5px; color: var(--ink-1); }
.switch__label em { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* 群设置里的分区标题 */
.adminpane__block { margin: 6px 0 14px; }
.adminpane__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

/* 禁言名单 */
.mutedlist { display: flex; flex-direction: column; gap: 8px; }
.mutedrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 45, .55);
}
.mutedrow .av { flex: none; width: 26px; height: 26px; border-radius: 9px; font-size: 12px; }
.mutedrow__body { flex: 1 1 auto; min-width: 0; }
.mutedrow__name { font-size: 13px; color: var(--ink-1); }
.mutedrow__time { font-size: 11.5px; color: #ffbe7a; }
.mutedrow__time--forever { color: #ff9c9c; }
.mutedlist__empty { font-size: 12.5px; color: var(--ink-3); padding: 4px 2px; }

/* 禁言时长选择（复用菜单容器） */
.ctxmenu__note {
  margin: 2px 4px 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* @所有人 在成员选择器里的样子 */
.mention__item--all .av--all {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff8a5c, #ff4d4f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mention__item--all .mention__tag {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 140, .5);
  background: rgba(120, 24, 24, .5);
  color: #ffc9c9;
  font-size: 10.5px;
  font-style: normal;
}

/* ---------- 14. 按你第二轮反馈的调整 ---------- */

/* 头像不再因为离线而变暗：原图什么颜色就是什么颜色 */
.av--off { opacity: 1; filter: none; }

/* 在线 / 离线：写在名字后面 */
.mlist__state {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(150, 170, 195, .38);
  background: rgba(120, 140, 165, .16);
  color: rgba(206, 222, 240, .78);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}
.mlist__state--on {
  border-color: rgba(90, 230, 150, .55);
  background: rgba(56, 224, 122, .16);
  color: #a9ecc4;
}

/* 未读私聊：红色数字（不是小圆点） */
.mlist__unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, .28);
}

/* 聊天区最上面那条横栏：加高、字加大、更抓眼 */
.chat__mention {
  padding: 13px 16px;
  margin-bottom: 9px;
  border-radius: 12px;
  border-width: 2px;
  font-size: 15px;
  letter-spacing: .01em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.chat__mention-dot { width: 10px; height: 10px; }
.chat__mention-go {
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 700;
}

/* 正在输入：从一行小字改成一条可见的提示条 */
.chat__typing {
  height: auto;
  min-height: 22px;
  margin: 0 0 8px;
  padding: 5px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 45, .62);
  font-size: 13px;
  line-height: 1.4;
}

/* 断线提示也一起放大 */
.chat__conn {
  padding: 9px 14px;
  margin: 8px 0 0;
  font-size: 13.5px;
  border-radius: 10px;
}

/* 成员行：名字这一列允许换行，避免加了状态标签后挤掉角色标签 */
.mlist__name { align-items: center; flex-wrap: wrap; row-gap: 2px; }

/* ---------- 15. 顶栏加大加显眼（#6） ---------- */
.chat__head {
  padding: 15px 18px;
  min-height: 62px;
  border-bottom-width: 2px;
  background: rgba(10, 30, 56, .82);
  box-shadow: inset 0 -1px 0 rgba(120, 200, 255, .22), 0 6px 18px rgba(2, 10, 22, .35);
}
.chat__head .chat__gav {
  width: 36px;
  height: 36px;
  margin-right: 10px;
  border-radius: 11px;
  border-width: 2px;
  font-size: 16px;
}
.chat__title { font-size: 19px; }
.chat__conv { font-weight: 700; letter-spacing: .01em; }
.chat__count { font-size: 14px; }
.chat__online {
  margin-left: 10px;
  padding: 4px 13px;
  font-size: 13.5px;
  font-weight: 700;
  border-width: 2px;
}
.chat__head .ctool { width: 32px; height: 32px; }
.chat__head .ctool svg { width: 19px; height: 19px; }
.chat__badge { min-width: 22px; height: 22px; line-height: 22px; font-size: 12.5px; }

/* 提示音开关：只显示当前状态的那个图标 */
.ctool svg[hidden] { display: none; }

.chat__pins { position: relative; }
.chat__pins-toggle {
  flex: none;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 240, 189, .55);
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: #fff0bd;
  cursor: pointer;
}
.chat__pins-toggle:hover, .chat__pins-toggle:focus-visible {
  background: rgba(255, 255, 255, .18);
  outline: none;
}
.chat__pins-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  width: min(420px, 100%);
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255, 210, 104, .8);
  border-radius: 10px;
  background: #3e2b0d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.chat__pins-menu[hidden] { display: none; }
.chat__pin-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff0bd;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chat__pin-option:hover, .chat__pin-option:focus-visible {
  background: rgba(255, 255, 255, .12);
  outline: none;
}
.chat__pin-option-count { flex: none; color: #ffd86b; font-size: 11px; }
.chat__pin-option-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 首页内容编辑 */
.site-code-row { display:flex; align-items:center; gap:8px; min-width:0; }
.site-code-row .codes__item { flex:1; min-width:0; }
.site-code-row .codes__code { overflow-wrap:anywhere; }
.site-content-form { display:grid; gap:10px; margin:16px 0; }
.site-content-form[hidden] { display:none; }
.site-content-form input, .site-content-form textarea, .site-content-form select { width:100%; min-width:0; box-sizing:border-box; padding:10px; border:1px solid #64748b; border-radius:8px; background:#172238; color:#fff; font:inherit; }
.site-content-actions { display:flex; flex-wrap:wrap; gap:8px; }
.site-announcement-body { white-space:pre-wrap; overflow-wrap:anywhere; }
