/* ============ 全局重置 & 主题变量 ============ */
:root {
  --bg: #0f172a;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --bg-soft: #f8fafc;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .15);
  --transition: all .2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 兜底:HTML hidden 属性优先于任何 display 声明,防止 .app{display:flex} 等覆盖导致隐藏失效 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ============ 容器 ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  animation: fadeUp .4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ 头部 ============ */
.auth-header { text-align: center; margin-bottom: 24px; }

.logo {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}

.auth-title { font-size: 22px; font-weight: 700; }
.auth-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ============ Tab 切换 ============ */
.tabs {
  display: flex;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ============ 表单 ============ */
.form { display: none; }
.form.active { display: block; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card);
  transition: var(--transition);
  outline: none;
}
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.field input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.toggle-pwd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  opacity: .6;
  transition: var(--transition);
}
.toggle-pwd:hover { opacity: 1; }

/* 验证码输入框 + 获取按钮(行业标准:横排布局) */
.code-wrap { display: flex; gap: 8px; }
.code-wrap input { flex: 1; min-width: 0; }
.btn-code {
  flex-shrink: 0;
  padding: 0 16px;
  height: 44px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-code:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-code:disabled { opacity: .6; cursor: not-allowed; }

.error-msg {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  min-height: 16px;
}

/* ============ 密码强度 ============ */
.strength { margin-top: 8px; }
.strength-track {
  display: block;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.strength-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width .3s, background .3s;
}
.strength-label {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  color: var(--muted);
}

/* ============ 按钮 ============ */
.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary.danger { background: var(--danger); }
.btn-primary.danger:hover { background: #b91c1c; }

/* ============ 表单提示 ============ */
.form-tip {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.form-tip a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.form-tip a:hover { text-decoration: underline; }

/* ============ 已登录用户信息 ============ */
.user-info {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0 20px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--muted); }
.info-row code {
  font-family: "SF Mono", Consolas, monospace;
  color: var(--text);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 数字 ID 突出显示(QQ 式,个人资料页) */
.uid-code {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary);
}

/* 用户行内数字 ID 标签(社交列表/搜索结果) */
.user-uid {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  font-family: "SF Mono", Consolas, monospace;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: var(--transition);
  z-index: 1000;
  max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: #576b95; }

/* ============ 响应式 ============ */
@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
  .auth-title { font-size: 20px; }
}

/* ============ 登录后应用布局 ============ */
.app {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  background: var(--bg-soft);
  overflow-y: auto;
}
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.app-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text); }
.app-brand .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 15px; margin: 0; }
.app-user { display: flex; align-items: center; gap: 10px; }
.app-avatar {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: var(--transition); overflow: hidden;
}
.app-avatar:hover { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(79, 70, 229, .2); }
.app-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.app-username { font-size: 14px; font-weight: 500; color: var(--text); }
.btn-logout {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--danger); font-size: 13px; cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 二级导航 */
.app-nav {
  display: flex; gap: 2px; padding: 0 24px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.app-tab {
  padding: 12px 18px; border: none; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; transition: var(--transition);
}
.app-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.app-tab:hover { color: var(--text); }

/* 内容区 */
.app-content { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 1400px; margin: 16px auto; padding: 0 24px; }
.view { display: none; animation: fadeUp .3s ease; }
.view.active { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }

/* ============ 备案号页脚（工信部要求：首页底部标明备案号，并链接至工信部备案系统） ============ */
/* 未登录：固定在视口底部，浮在紫渐变背景上（z-index 低于 .app，登录后被应用界面盖住） */
.guest-beian {
  position: fixed; left: 0; right: 0; bottom: 14px; z-index: 0;
  text-align: center; font-size: 11px; line-height: 1.6;
  color: rgba(255, 255, 255, .72);
  pointer-events: none;
}
.guest-beian a { color: inherit; text-decoration: none; pointer-events: auto; }
.guest-beian a:hover { color: #fff; text-decoration: underline; }

/* 已登录：作为 .app 纵向 flex 的最后一个子项，常驻底部 */
.app-beian {
  flex: 0 0 auto;
  padding: 10px 24px 14px;
  text-align: center; font-size: 11px; line-height: 1.6;
  color: var(--muted);
}
.app-beian a { color: inherit; text-decoration: none; }
.app-beian a:hover { color: var(--primary); text-decoration: underline; }
#socialView.active { overflow: hidden; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.card-subtitle { font-size: 13px; color: var(--muted); margin: 4px 0 20px; }

/* ============ 我的文件 ============ */
.files-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; }
.files-head { display: flex; align-items: baseline; gap: 10px; }
.files-count {
  font-size: 13px; color: var(--muted); font-weight: 500;
  background: var(--bg-soft); padding: 3px 10px; border-radius: 20px;
}

.sub-tabs { display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--border); }
.sub-tab {
  padding: 8px 18px; border: none; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; transition: var(--transition);
}
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sub-tab:hover { color: var(--text); }

/* 我的文件子 Tab:与 Magika 14 大类对齐(数量多,横向滚动 + 右侧渐隐提示) */
.sub-tabs-scroll {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent);
  mask-image: linear-gradient(to right, #000 92%, transparent);
}
.sub-tabs-scroll::-webkit-scrollbar { height: 4px; }
.sub-tabs-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sub-tabs-scroll .sub-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; white-space: nowrap; }

/* 子 Tab 计数徽章 */
.sub-badge {
  min-width: 18px; padding: 1px 5px; border-radius: 9px;
  background: var(--bg-soft); color: var(--muted);
  font-size: 11px; font-style: normal; font-weight: 700; text-align: center;
  line-height: 14px;
}
.sub-tab.active .sub-badge { background: var(--primary); color: #fff; }
.sub-badge.zero { opacity: .45; }

/* 通用文件卡片(仅可下载类):纵向居中 —— 图标 / 名称 / 元信息 / 底部居中小号下载键
   「仅下载」降级角标与「下载」按钮合一,Magika 类型标签不展示 */
.gf-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 18px 14px; text-align: center;
}
.gf-icon {
  flex: none; width: 52px; height: 52px; margin-bottom: 5px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--border);
  font-size: 25px; line-height: 1; transition: var(--transition);
}
.gf-card:hover .gf-icon { transform: translateY(-2px) scale(1.04); }
.gf-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.gf-sub {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--muted);
}
/* 「仅下载」与「下载」合一后的唯一操作:底部居中小号胶囊键 */
.gf-dl {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.7;
  cursor: pointer; transition: var(--transition);
}
.gf-dl svg { flex: none; }
.gf-dl:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(79, 70, 229, .06);
}

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.files-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px; text-align: center;
}
.files-empty[hidden] { display: none; }
.empty-icon { color: var(--border); margin-bottom: 16px; }
.empty-text { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--muted); }

.file-card {
  position: relative; border-radius: 12px; overflow: hidden;
  background: var(--bg-soft); aspect-ratio: 1; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.file-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(15, 23, 42, .2); }
.file-card img, .file-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-del {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; z-index: 3;
}
.file-del:hover { background: var(--danger); }
.file-card:hover .file-del { opacity: 1; }
.file-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 11px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
  opacity: 0; transition: opacity .2s; z-index: 2;
}
.file-card:hover .file-meta { opacity: 1; }
.file-meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.file-meta .date { opacity: .85; flex-shrink: 0; }

/* 视频播放覆盖层(纯装饰,点击穿透到 video 元素) */
.play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.18); opacity: 0; transition: opacity .2s; z-index: 1;
  pointer-events: none;
}
.file-card:hover .play-overlay { opacity: 1; }
.play-overlay::before {
  content: '▶'; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--text); font-size: 18px;
  display: flex; align-items: center; justify-content: center; padding-left: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* 音频卡 */
.audio-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 12px; gap: 6px; aspect-ratio: 1;
  cursor: pointer; /* 整卡可点:唤起 Howler 底部播放条 */
}
.audio-icon { font-size: 44px; margin-bottom: 4px; }
.audio-name {
  font-size: 12px; color: var(--text); text-align: center; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 100%; line-height: 1.4;
}
.audio-size { font-size: 11px; color: var(--muted); }
.audio-card .file-del { top: 8px; right: 8px; opacity: 1; background: rgba(0,0,0,.08); color: var(--muted); }
.audio-card .file-del:hover { background: var(--danger); color: #fff; }

/* 音频卡片图标(Howler):音符 + 播放中跳动音波,点击整卡唤起底部播放条 */
.audio-icon {
  position: relative; width: 64px; height: 64px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; background: var(--bg-soft);
  color: var(--primary); font-size: 30px; cursor: pointer;
  transition: var(--transition);
}
.audio-icon:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(79,70,229,.18); }
.audio-icon .audio-note { transition: opacity .2s; }
.audio-icon .audio-eq {
  position: absolute; inset: 0; display: none;
  align-items: flex-end; justify-content: center; gap: 3px;
  padding-bottom: 14px;
}
.audio-icon .audio-eq i {
  width: 4px; border-radius: 2px; background: var(--primary);
  height: 8px; transform-origin: bottom;
  animation: ap-eq 1s ease-in-out infinite;
}
.audio-icon .audio-eq i:nth-child(1) { animation-delay: 0s; }
.audio-icon .audio-eq i:nth-child(2) { animation-delay: .18s; }
.audio-icon .audio-eq i:nth-child(3) { animation-delay: .36s; }
.audio-icon .audio-eq i:nth-child(4) { animation-delay: .54s; }
@keyframes ap-eq {
  0%, 100% { height: 8px; } 50% { height: 30px; }
}
.audio-card.is-playing { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
.audio-card.is-playing .audio-note { display: none; }
.audio-card.is-playing .audio-eq { display: flex; }
.audio-card.is-current:not(.is-playing) .audio-icon { background: var(--primary); color: #fff; }

/* ============ Howler.js 全局音频播放器(底部悬浮条) ============ */
.ap-bar {
  position: fixed; left: 50%; bottom: 18px; z-index: 90;
  width: min(860px, calc(100vw - 32px));
  transform: translate(-50%, 16px);
  opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.2,.8,.3,1), opacity .28s;
}
.ap-bar.ap-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.ap-main {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(28,25,57,.22);
}
/* 左侧:音波 + 标题 */
.ap-info { flex: 0 1 22%; min-width: 0; display: flex; align-items: center; gap: 10px; }
.ap-wave { flex: none; display: flex; align-items: flex-end; gap: 3px; height: 22px; padding: 0 2px; }
.ap-wave i { width: 3px; border-radius: 2px; background: var(--primary); height: 6px; }
.ap-bar.is-playing .ap-wave i { animation: ap-eq .9s ease-in-out infinite; }
.ap-bar.is-playing .ap-wave i:nth-child(2) { animation-delay: .15s; }
.ap-bar.is-playing .ap-wave i:nth-child(3) { animation-delay: .3s; }
.ap-bar.is-playing .ap-wave i:nth-child(4) { animation-delay: .45s; }
.ap-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ap-sub { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 中部:控制按钮 */
.ap-controls { flex: none; display: flex; align-items: center; gap: 6px; }
.ap-btn {
  border: none; background: transparent; color: var(--text);
  font-size: 15px; cursor: pointer; border-radius: 10px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.ap-btn:hover { background: var(--bg-soft); color: var(--primary); }
.ap-btn.ap-sm { font-size: 14px; }
.ap-btn.ap-txt { width: auto; padding: 0 10px; font-size: 12px; font-weight: 700; }
.ap-btn.ap-play {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 17px;
  box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.ap-btn.ap-play:hover { background: var(--primary-dark, #4338ca); color: #fff; transform: scale(1.06); }
.ap-btn.ap-on { color: var(--primary); background: var(--bg-soft); }
/* 进度条 */
.ap-progress { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 120px; }
.ap-time { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ap-track {
  position: relative; flex: 1; height: 18px; cursor: pointer;
  display: flex; align-items: center;
}
.ap-track::before {
  content: ''; position: absolute; left: 0; right: 0; height: 4px;
  border-radius: 2px; background: var(--bg-soft);
}
.ap-played {
  position: relative; width: 0%; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light, #818cf8));
}
.ap-thumb {
  position: absolute; left: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 1px 6px rgba(79,70,229,.5);
  transform: translateX(-6px) scale(0); transition: transform .15s;
}
.ap-track:hover .ap-thumb, .ap-track:focus-visible .ap-thumb { transform: translateX(-6px) scale(1); }
.ap-track:focus-visible { outline: none; }
/* 右侧:倍速/循环/淡入淡出/音量/关闭 */
.ap-extras { flex: none; display: flex; align-items: center; gap: 2px; }
.ap-rate-wrap, .ap-vol-wrap { position: relative; display: flex; align-items: center; }
.ap-rate-menu {
  position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 95;
  display: flex; flex-direction: column; min-width: 74px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 32px rgba(28,25,57,.18); padding: 5px;
}
.ap-rate-menu button {
  border: none; background: transparent; color: var(--text);
  font-size: 12px; font-weight: 600; text-align: left;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
}
.ap-rate-menu button:hover { background: var(--bg-soft); }
.ap-rate-menu button.active { color: var(--primary); background: var(--bg-soft); }
.ap-vol-slider {
  width: 0; opacity: 0; height: 4px; cursor: pointer;
  accent-color: var(--primary); transition: width .2s, opacity .2s, margin .2s;
}
.ap-vol-wrap:hover .ap-vol-slider, .ap-vol-slider:focus-visible { width: 72px; opacity: 1; margin-right: 6px; }
.ap-bar.is-muted .ap-vol-slider { accent-color: var(--muted); }

/* 响应式: 中屏隐藏副标题/音量滑条 */
@media (max-width: 860px) {
  .ap-main { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .ap-info { flex: 1 1 100%; order: 0; }
  .ap-controls { order: 1; }
  .ap-progress { flex: 1 1 100%; order: 3; }
  .ap-extras { order: 2; margin-left: auto; }
  .ap-vol-wrap { display: none; } /* 移动端用物理音量键 */
  .ap-sub { display: none; }
}
/* 窄屏:精简按钮 */
@media (max-width: 480px) {
  .ap-bar { bottom: 10px; width: calc(100vw - 20px); }
  #apFade, #apRate { display: none; }
  .ap-main { gap: 8px; }
}

/* ============ Lightbox(图片 / 视频)============ */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .92); padding: 40px;
  animation: fadeUp .2s ease;
}
.lightbox[hidden] { display: none; }
.lb-media { max-width: 90vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-img { object-fit: contain; }
.lb-video { background: #000; }
.lb-close {
  position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer;
  transition: var(--transition);
}
.lb-close:hover { background: rgba(255,255,255,.28); }
.lb-info { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.85); font-size: 13px; }

@media (max-width: 600px) {
  .app-content { padding: 0 14px; margin-top: 16px; }
  .app-header, .app-nav { padding-left: 14px; padding-right: 14px; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  /* 150px 方形卡放不下常规尺寸,压缩仅下载卡内部件 */
  .gf-card { gap: 3px; padding: 12px 10px; }
  .gf-icon { width: 40px; height: 40px; margin-bottom: 3px; border-radius: 12px; font-size: 19px; }
  .gf-dl { margin-top: 5px; padding: 2px 10px; font-size: 10px; }
  .lightbox { padding: 20px; }
  .app-beian { padding: 8px 14px 10px; }
  .guest-beian { bottom: 10px; }
}

/* ============ 图片 AI 工具(CLIP 相似检索 + NudeNet 违规审核)============ */
/* 图片卡「AI 找相似」按钮 */
.file-ai {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(79, 70, 229, .88); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition); box-shadow: 0 2px 8px rgba(79, 70, 229, .4);
}
.file-card:hover .file-ai { opacity: 1; }
.file-ai:hover { background: var(--primary-dark); transform: scale(1.08); }

/* AI 工具行(图片子 Tab 下方) */
.img-ai-bar {
  display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap;
}
.img-ai-bar[hidden] { display: none; }
.img-ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(79, 70, 229, .35);
  background: rgba(79, 70, 229, .07); color: var(--primary);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.img-ai-chip svg { flex-shrink: 0; }
.img-ai-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }

/* AI 结果面板 */
.img-ai-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 18px; animation: fadeUp .25s ease;
}
.img-ai-panel[hidden] { display: none; }
.ia-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ia-back {
  width: 32px; height: 32px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--bg-soft); color: var(--text); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0;
}
.ia-back:hover { background: rgba(79, 70, 229, .12); color: var(--primary); }
.ia-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ia-title { font-size: 15px; font-weight: 700; color: var(--text); }
.ia-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-actions { display: flex; gap: 8px; align-items: center; }

/* 进度条 */
.ia-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ia-progress[hidden] { display: none; }
.ia-progress-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.ia-progress-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--primary), #7c3aed); transition: width .4s ease; }
.ia-progress-text { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 加载 / 空状态 */
.ia-loading { padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ia-loading p { font-size: 13px; color: var(--muted); text-align: center; }
.ia-spin {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(79, 70, 229, .18); border-top-color: var(--primary);
  animation: iaRotate .8s linear infinite;
}
@keyframes iaRotate { to { transform: rotate(360deg); } }
.ia-empty { padding: 42px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ia-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.ia-empty-sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.ia-empty .btn-primary { margin-top: 10px; }

/* 相似度徽章:按分数渐变(高=紫红,低=灰蓝) */
.ia-score-badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.ia-score-badge[data-score] { background: linear-gradient(135deg, #6366f1, #a855f7); }
.ia-score-badge.sm { padding: 1px 6px; font-size: 10px; }
.ia-score-badge.corner { position: absolute; top: 8px; left: 8px; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* ============ 查重视图 ============ */
.ia-dup-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ia-dup-stat { font-size: 13px; color: var(--muted); }
.ia-dup-stat b { color: var(--primary); font-size: 15px; margin: 0 2px; }
.ia-seg { display: inline-flex; background: var(--bg-soft); border-radius: 9px; padding: 2px; }
.ia-seg-item { cursor: pointer; }
.ia-seg-item span {
  display: inline-block; padding: 5px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted); transition: var(--transition);
}
.ia-seg-item.active span { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.ia-dup-list { display: flex; flex-direction: column; gap: 10px; }
.ia-dup-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.ia-dup-head { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; transition: background .15s; }
.ia-dup-head:hover { background: var(--bg-soft); }
.ia-dup-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--bg-soft); }
.ia-dup-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ia-dup-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-dup-meta { display: flex; align-items: center; gap: 8px; }
.ia-dup-count { font-size: 11.5px; color: var(--muted); }
.ia-dup-size { font-size: 11.5px; color: var(--muted); }
.ia-dup-clean {
  border: none; cursor: pointer; padding: 7px 12px; border-radius: 9px; flex-shrink: 0;
  background: rgba(220, 38, 38, .09); color: var(--danger); font-size: 12px; font-weight: 600; transition: var(--transition);
}
.ia-dup-clean:hover { background: var(--danger); color: #fff; }
.ia-dup-clean:disabled { opacity: .5; cursor: default; }
.ia-dup-members {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
  padding: 0 12px 12px; border-top: 1px dashed var(--border); padding-top: 12px;
}
.ia-dup-members[hidden] { display: none; }
.ia-dup-member { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-soft); aspect-ratio: 1; }
.ia-dup-member img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.ia-dup-member .ia-score-badge { position: absolute; top: 6px; left: 6px; }
.ia-dup-mname {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px;
  font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ia-member-del {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: 11px; transition: var(--transition);
}
.ia-member-del:hover { background: var(--danger); }
.ia-master-tag {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  font-size: 10px; font-weight: 700; color: #fff; padding: 2px 7px; border-radius: 8px;
  background: rgba(22, 163, 74, .92);
}

/* ============ 搜图视图 ============ */
.ia-query-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ia-query-label { font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.ia-query-row img {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--primary); box-shadow: 0 2px 10px rgba(79, 70, 229, .25);
}
.ia-text-row { font-size: 14px; font-weight: 600; color: var(--text); }
.ia-grid { margin-top: 4px; }
.ia-result-card { position: relative; }

/* 以图搜图:上传选择区 */
.ia-search-drop {
  border: 1.5px dashed rgba(79, 70, 229, .4); border-radius: 14px; cursor: pointer;
  padding: 42px 16px; text-align: center; transition: var(--transition); background: rgba(79, 70, 229, .03);
}
.ia-search-drop:hover { background: rgba(79, 70, 229, .08); border-color: var(--primary); }
.ia-drop-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
  background: rgba(79, 70, 229, .1); color: var(--primary);
  font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.ia-drop-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ia-drop-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 以文搜图:输入行 + 热词 */
.ia-text-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ia-text-input-row input {
  flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 13.5px; outline: none; transition: var(--transition); background: var(--card); color: var(--text);
}
.ia-text-input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .14); }
/* 覆盖 .btn-primary 全局 width:100%/大内边距: 行内搜索按钮应为自适应小按钮,把空间让给输入框 */
.ia-text-input-row .btn-primary { width: auto; flex: 0 0 auto; margin-top: 0; padding: 10px 26px; font-size: 13.5px; border-radius: 10px; }
.ia-text-tips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ia-tip-chip {
  font-size: 12px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: var(--transition);
}
.ia-tip-chip:hover { color: var(--primary); border-color: rgba(79, 70, 229, .4); background: rgba(79, 70, 229, .07); }

/* ============ 违规检测视图 ============ */
.ia-nude-stats { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ia-stat-pill {
  flex: 1; min-width: 76px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  background: var(--card); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: var(--transition);
}
.ia-stat-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
.ia-stat-pill.active { border-color: var(--primary); background: rgba(79, 70, 229, .06); }
.ia-stat-n { font-size: 18px; font-weight: 800; color: var(--text); }
.ia-stat-pill.blocked.active .ia-stat-n { color: var(--danger); }
.ia-stat-pill.review.active .ia-stat-n { color: var(--warning); }
.ia-stat-pill.safe.active .ia-stat-n { color: var(--success); }
.ia-stat-l { font-size: 11.5px; color: var(--muted); }
.ia-nude-card { position: relative; }
.ia-nude-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 11px; font-weight: 700; color: #fff; padding: 3px 9px; border-radius: 8px;
}
.ia-nude-badge.blocked { background: var(--danger); box-shadow: 0 2px 8px rgba(220, 38, 38, .4); }
.ia-nude-badge.review { background: var(--warning); box-shadow: 0 2px 8px rgba(245, 158, 11, .4); }
.ia-nude-badge.safe { background: var(--success); box-shadow: 0 2px 8px rgba(22, 163, 74, .4); }
.ia-nude-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 6px;
  padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.72));
}
.ia-nude-chips { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.ia-label-chip {
  font-size: 9.5px; color: #fff; background: rgba(255, 255, 255, .22);
  padding: 2px 6px; border-radius: 6px; backdrop-filter: blur(4px); white-space: nowrap;
}
.ia-nude-score { font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0; }
.ia-nude-card img { cursor: zoom-in; }

/* ============ 违规详情弹窗 ============ */
.ia-detail-card { max-width: 520px; }
.ia-detail-canvas-wrap {
  position: relative; border-radius: 12px; overflow: hidden; background: #0f172a; margin-bottom: 12px;
}
.ia-detail-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.ia-detail-status {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 12px; font-weight: 800; color: #fff; padding: 4px 11px; border-radius: 9px;
}
.ia-detail-status.blocked { background: var(--danger); }
.ia-detail-status.review { background: var(--warning); }
.ia-detail-status.safe { background: var(--success); }
.ia-detail-meta { margin-bottom: 14px; }
.ia-det-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ia-det-summary b { color: var(--text); }
.ia-det-rows {
  background: var(--bg-soft); border-radius: 10px; padding: 4px 12px;
  max-height: 168px; overflow-y: auto;
}
.ia-det-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ia-det-row:last-child { border-bottom: none; }
.ia-det-class { font-size: 12.5px; color: var(--text); }
.ia-det-score { font-size: 12px; font-weight: 700; color: var(--primary); }
.ia-detail-censor { border-top: 1px solid var(--border); padding-top: 14px; }
.ia-censor-label { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 9px; }
.ia-mode-seg { display: inline-flex; background: var(--bg-soft); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.ia-mode-seg label { cursor: pointer; }
.ia-mode-seg input { display: none; }
.ia-mode-seg span {
  display: inline-block; padding: 7px 18px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); transition: var(--transition);
}
.ia-mode-seg input:checked + span { background: var(--card); color: var(--primary); box-shadow: 0 1px 5px rgba(15, 23, 42, .14); }
.ia-censor-btn { width: 100%; }
.ia-censor-btn:disabled { opacity: .6; cursor: default; }
.ia-censor-tip { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; text-align: center; }

/* 移动端适配 */
@media (max-width: 600px) {
  .img-ai-bar { gap: 6px; }
  .img-ai-chip { padding: 6px 11px; font-size: 12px; }
  .ia-dup-members { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .ia-dup-thumb { width: 46px; height: 46px; }
  .ia-dup-clean { padding: 6px 9px; font-size: 11px; }
  .ia-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ============ 社交页 ============ */
.social-card { padding: 24px; }

/* 社交子 Tab 切换面板 */
.stab-pane { display: none; animation: fadeUp .25s ease; }
.stab-pane.active { display: block; }

/* 区块标题 */
.section-title {
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin: 20px 0 10px; display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .5px;
}
.section-title:first-child { margin-top: 0; }
.count-badge {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(79, 70, 229, .12); padding: 2px 8px; border-radius: 10px;
}

/* 搜索栏 */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input {
  flex: 1; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--card); outline: none;
  transition: var(--transition);
}
.search-bar input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.search-bar button {
  padding: 0 16px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.search-bar button:hover { background: var(--primary-dark); }
.search-bar button:disabled { opacity: .6; cursor: not-allowed; }

/* 搜索结果 */
.search-results {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); overflow: hidden; margin-bottom: 4px;
}
.search-results[hidden] { display: none; }
.search-results-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* 用户行(搜索结果 / 好友 / 群成员) */
.user-list { display: flex; flex-direction: column; gap: 4px; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-soft); transition: var(--transition);
}
.user-row:hover { background: #eef2ff; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; /* 头像图裁剪为圆形 */
}
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.user-main { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 500; color: var(--text); }
.user-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-mini {
  padding: 6px 14px; border: none; border-radius: 7px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.btn-mini.primary { background: var(--primary); color: #fff; }
.btn-mini.primary:hover { background: var(--primary-dark); }
.btn-mini.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-mini.ghost:hover { color: var(--danger); border-color: var(--danger); }
.btn-mini.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); }
.btn-mini.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-mini:disabled { opacity: .6; cursor: not-allowed; }

/* 好友请求卡(旧 friends 页内嵌,已迁移至新朋友页) */
.requests-list { display: flex; flex-direction: column; gap: 6px; }
.requests-list:empty { display: none; }

/* ============ 新朋友 / 群通知(对标 QQ 通知页) ============ */
/* 子 Tab 红点徽标(数字角标) */
.stab-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 5px;
  border-radius: 8px; background: #fa5151; color: #fff;
  font-size: 10px; font-style: normal; font-weight: 700; line-height: 1;
  vertical-align: middle;
}
.stab-dot[hidden] { display: none; }
/* 社交子 Tab 带红点时保持文字与角标居中对齐 */
#socialSubTabs .sub-tab { display: inline-flex; align-items: center; gap: 0; }

/* 通知列表(新朋友/群通知共用) */
.nf-list { display: flex; flex-direction: column; gap: 4px; }
.nf-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft); transition: var(--transition);
}
.nf-row:hover { background: #eef2ff; }
.nf-main { flex: 1; min-width: 0; }
.nf-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.nf-msg {
  font-size: 12.5px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nf-msg-empty { color: #b6bcc4; }
.nf-time { font-size: 11px; color: #b6bcc4; margin-top: 4px; }
.nf-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* 已处理行:整体弱化 + 状态标签(对标 QQ) */
.nf-row.processed { opacity: .72; }
.nf-row.processed:hover { background: var(--bg-soft); }
.nf-status { font-size: 12px; color: #b6bcc4; flex-shrink: 0; }

/* 群通知行:群头像 + 进出角标 */
.gn-avatar {
  position: relative; width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 12px; overflow: visible;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.gn-avatar img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; display: block; }
.gn-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card); color: #fff;
}
.gn-badge svg { display: block; }
.gn-avatar.join .gn-badge { background: #07c160; }
.gn-avatar.leave .gn-badge { background: #b6bcc4; }
.gn-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.gn-me { color: var(--primary); font-weight: 600; }

/* 好友验证消息弹窗(加好友,对标 QQ) */
#friendVerifyModal .modal-body { display: flex; flex-direction: column; gap: 14px; }
.nf-verify-head { display: flex; align-items: center; gap: 12px; }
.nf-verify-head .user-avatar { width: 46px; height: 46px; font-size: 18px; }
.nf-verify-name { font-size: 15px; font-weight: 600; color: var(--text); }
.nf-verify-uid { font-size: 12px; color: var(--muted); margin-top: 3px; }
#friendVerifyModal textarea {
  width: 100%; min-height: 96px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: var(--card);
  outline: none; resize: none; line-height: 1.6;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#friendVerifyModal textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
#friendVerifyModal textarea::placeholder { color: #94a3b8; }
.nf-counter { font-size: 11px; color: var(--muted); text-align: right; margin-top: -6px; }

/* 空状态块 */
.empty-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; text-align: center;
}
.empty-block[hidden] { display: none; }

/* 群聊卡列表 */
.group-list { display: flex; flex-direction: column; gap: 8px; }
.group-list[hidden] { display: none; }
.group-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: var(--bg-soft); transition: var(--transition);
}
.group-row:hover { background: #eef2ff; transform: translateX(2px); }
.group-avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  background-size: cover; background-position: center; /* 群头像图 cover 填充 */
  color: #fff; font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* 群头像右下"群"字下标(对标 QQ:所有群头像可辨识,与 conv-avatar-badge 同风格) */
.gav-badge {
  position: absolute; right: -4px; bottom: -4px;
  background: #fff; color: #576b95;
  font-size: 9px; font-weight: 700; line-height: 1;
  padding: 2px 3px; border-radius: 4px;
  border: 1px solid #576b95;
  pointer-events: none; z-index: 1;
}
.group-main { flex: 1; min-width: 0; }
.group-name { font-size: 14px; font-weight: 500; color: var(--text); }
.group-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.role-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; margin-left: 6px;
}
.role-tag.owner { background: rgba(245, 158, 11, .15); color: #b45309; }
.role-tag.admin { background: rgba(79, 70, 229, .12); color: var(--primary); }
.role-tag.member { background: rgba(100, 116, 139, .12); color: var(--muted); }

/* 弹层 Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .3);
  display: flex; flex-direction: column; max-height: 88vh;
  animation: fadeUp .25s ease;
}
.modal-card.lg { max-width: 560px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--bg-soft); color: var(--muted); font-size: 14px; cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.modal-footer .btn-primary { width: auto; padding: 10px 22px; margin-top: 0; }
.btn-secondary {
  padding: 10px 22px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { color: var(--text); border-color: var(--muted); }

/* 群信息区 */
.group-info {
  background: var(--bg-soft); border-radius: 10px; padding: 12px 16px;
  margin-bottom: 16px;
}
.group-info .info-row { padding: 6px 0; }

/* 群成员列表(对标 QQ:角色分组 + 徽章 + 管理菜单) */
.group-members { margin-top: 4px; }
.member-list-title { display: flex; align-items: center; gap: 8px; }
.member-count-badge {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 1px 8px; border-radius: 10px;
}

/* 概览页头像矩阵(对标 QQ:网格头像 + 加号入口) */
.member-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px 8px; padding: 10px 2px;
}
.member-grid-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: default; min-width: 0;
}
.member-grid-avatar {
  width: 44px; height: 44px; border-radius: 10px;
  color: #fff; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.member-grid-avatar.owner { background: linear-gradient(135deg, #f59e0b, #d97706); }
.member-grid-avatar.admin { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.member-grid-avatar.member { background: linear-gradient(135deg, #64748b, #475569); }
.member-grid-avatar.add {
  background: var(--bg-soft); border: 1.5px dashed var(--border);
  color: var(--muted); font-size: 22px; font-weight: 400;
  cursor: pointer; transition: var(--transition);
}
.member-grid-avatar.add:hover { border-color: var(--primary); color: var(--primary); }
.member-grid-name {
  font-size: 11px; color: var(--muted); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-view-all {
  width: 100%; padding: 9px; margin-top: 8px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg-soft); color: var(--muted); font-size: 13px;
  cursor: pointer; transition: var(--transition);
}
.member-view-all:hover { border-color: var(--primary); color: var(--primary); background: rgba(79, 70, 229, .06); }

/* 成员列表弹窗加宽 */
.modal-lg { max-width: 520px; }
.modal-sm { max-width: 380px; }
.member-list-full { max-height: 420px; }

.member-filter-bar { margin: 8px 0 10px; }
.member-filter-bar input {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; outline: none; background: var(--card);
  transition: var(--transition);
}
.member-filter-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.member-list-wrap { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.member-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 4px 4px; font-size: 12px; font-weight: 600;
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.member-group-label.owner { color: #b45309; }
.member-group-label.admin { color: var(--primary); }
.member-group-label.member { color: var(--muted); }
.member-group-count { color: var(--muted); font-weight: 400; font-size: 11px; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  transition: var(--transition);
}
.member-row:hover { background: var(--bg-soft); }
.member-avatar {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.member-avatar.owner { background: linear-gradient(135deg, #f59e0b, #d97706); }
.member-avatar.admin { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.member-avatar.member { background: linear-gradient(135deg, #64748b, #475569); }
/* 头像照片覆盖层(通用回退方案):字母/渐变常驻底层,图片加载成功覆盖其上,加载失败 onerror 自动移除回退字母/渐变,永不出现隐形空位 */
.msg-avatar, .member-avatar, .member-grid-avatar, .gm-check-avatar, .gm-admin-av, .gm-rank-avatar, .fg-avatar, .gav, .conv-avatar, .chs-member-avatar, .chs-result-avatar { position: relative; }
.av-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit;
  display: block; user-select: none; pointer-events: none;
}
.member-main { flex: 1; min-width: 0; }
.member-name {
  font-size: 14px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.member-realname { font-size: 11px; color: var(--muted); font-weight: 400; }
.member-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.role-badge {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
}
.role-badge.owner { background: rgba(245, 158, 11, .15); color: #b45309; }
.role-badge.admin { background: rgba(79, 70, 229, .12); color: var(--primary); }
.mute-badge {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
  background: rgba(220, 38, 38, .1); color: var(--danger);
}
.me-badge {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
  background: rgba(22, 163, 74, .12); color: var(--success);
}
.member-manage-btn {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 16px;
  cursor: pointer; flex-shrink: 0; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.member-manage-btn:hover { background: var(--border); color: var(--text); }
.member-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

/* 成员管理菜单(浮层) */
.member-menu {
  position: fixed; z-index: 300; min-width: 150px;
  background: var(--card); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, .22);
  border: 1px solid var(--border); padding: 4px;
  animation: fadeUp .15s ease;
}
.member-menu[hidden] { display: none; }
.member-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; border-radius: 7px;
  background: transparent; font-size: 13px; color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.member-menu-item:hover { background: var(--bg-soft); }
.member-menu-item.danger { color: var(--danger); }
.member-menu-item.danger:hover { background: rgba(220, 38, 38, .08); }

/* 禁言弹窗选项 */
.mute-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mute-option {
  padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--card); font-size: 13px; color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.mute-option:hover { border-color: var(--primary); color: var(--primary); }
.mute-option.selected { border-color: var(--primary); background: rgba(79, 70, 229, .08); color: var(--primary); font-weight: 600; }
.mute-custom { display: flex; flex-direction: column; gap: 6px; }
.mute-custom label { font-size: 12px; color: var(--muted); }
.mute-custom input {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; transition: var(--transition);
}
.mute-custom input:focus { border-color: var(--primary); }

/* ============ Q群管家·通用卡片(管理群二级弹窗复用) ============ */
.bot-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.bot-card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.switch-line { display: flex; align-items: center; gap: 8px; flex-direction: row !important; }
.switch-line > span { font-size: 12px; color: var(--muted); font-weight: 500; }

/* 开关组件 */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: #cbd5e1; border-radius: 20px; transition: .2s;
}
.switch-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 2px; bottom: 2px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* 自助问答(对标 Q 群管家) */
.bot-qa-tip { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bot-qa-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.bot-qa-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  background: var(--bg-soft); border-radius: 8px;
}
.bot-qa-item.disabled { opacity: 0.55; }
.bot-qa-q { font-weight: 600; font-size: 13px; }
.bot-qa-kws { font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 6px; }
.bot-qa-a { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; word-break: break-all; }
.bot-qa-body { flex: 1; min-width: 0; }
.bot-qa-ops { display: flex; gap: 6px; flex-shrink: 0; }

/* 定时消息列表(对标 QQ:白卡列表项,整行可点编辑) */
.bot-scheduled-list { display: flex; flex-direction: column; gap: 8px; }
.bot-scheduled-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--card); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  cursor: pointer; transition: background .15s ease;
}
.bot-scheduled-item:hover, .bot-scheduled-item:active { background: var(--bg-soft); }
.bot-sched-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bot-sched-content { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-sched-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bot-sched-status.active { color: var(--success); }
.bot-sched-status.inactive { color: var(--muted); }
.bot-sched-time { font-weight: 500; color: var(--text); }
.bot-sched-del {
  flex-shrink: 0; border: none; background: transparent; color: #c3c7cf;
  font-size: 12px; cursor: pointer; padding: 6px 8px; border-radius: 8px;
  font-family: inherit; transition: var(--transition);
}
.bot-sched-del:hover { color: #e5484d; background: rgba(229, 72, 77, .08); }

/* 空状态添加入口(虚线卡) */
.bs-sched-empty-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; background: transparent;
  border: 1px dashed #c3c7cf; border-radius: 14px;
  color: var(--muted); font-size: 14px; cursor: pointer; font-family: inherit;
  transition: var(--transition);
}
.bs-sched-empty-add:hover { border-color: var(--primary); color: var(--primary); }
.bs-sched-empty-plus { font-size: 17px; line-height: 1; }

.bot-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 12px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ============ Q群管家·快捷服务(对标 QQ:灰底滚动区 + 白色圆角卡片列表) ============ */
/* 禁发关键词弹窗从禁发消息二级页内打开,须叠于所有 bot 弹窗之上(DOM 顺序无法保证) */
#bannedKeywordModal { z-index: 210; }
/* 定时消息编辑器(三级弹窗)须叠于定时消息列表(二级弹窗)之上 */
#botSchedEditorModal { z-index: 215; }
#mutePeriodModal { z-index: 215; }
/* 加群验证问题三级弹窗(取消/完成 + 灰底输入卡 + 10字计数)须叠于加群方式(二级弹窗)之上 */
#gmVerifyQModal { z-index: 215; }
#gmVerifyQModal .modal-card { max-width: 360px; }
#gmVerifyQModal .modal-header { border-bottom: none; padding: 14px 12px 4px; }
#gmVerifyQModal .modal-body { padding: 10px 16px 20px; }
.gm-vq-cancel {
  border: none; background: transparent; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 4px 10px; border-radius: 8px; font-family: inherit;
}
.gm-vq-cancel:hover { background: var(--bg-soft); }
.gm-vq-done {
  border: none; background: transparent; color: #07c160;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 10px; border-radius: 8px; font-family: inherit;
}
.gm-vq-done:disabled { opacity: .4; cursor: default; }
.gm-q-field {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-soft); border-radius: 12px; padding: 13px 14px;
}
.gm-q-label { font-size: 14px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.gm-q-field input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font: inherit; font-size: 14px; color: var(--text); padding: 0;
}
.gm-q-field input::placeholder { color: var(--muted); opacity: .75; }
.gm-q-count { margin: 6px 2px 0; text-align: right; font-size: 12px; color: var(--muted); }
#gmVQAnswerBlock { margin-top: 14px; }
/* 验证方式行下的问题预览(灰字) */
.gm-verify-q { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4; }

/* 弹窗头部返回按钮(QQ 式左侧返回) */
.modal-back-btn {
  border: none; background: transparent; color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 10px 4px 0;
  margin-right: 2px; border-radius: 8px; font-family: system-ui, sans-serif;
}
.modal-back-btn:hover { background: var(--bg-soft); }

/* 定时消息编辑器(对标 QQ 设置消息提醒:正文卡 + iOS 设置行) */
.bot-sched-editor .bs-sched-msg textarea { min-height: 120px; font-size: 15px; }
.bs-sched-settings .bs-cell-title { flex: 1; font-size: 15px; font-weight: 500; }
.bs-sched-settings .bs-cell-value { font-size: 14px; max-width: 55%; }
.bs-sched-settings .bs-cell-value.bs-sched-time-val { color: var(--text); }

/* 展开面板(时间选择) */
.bs-sched-panel { display: flex; flex-direction: column; gap: 10px; }
.bs-sched-panel[hidden] { display: none; }
.bs-sched-picker {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-sched-picker .bs-field-half { display: flex; flex-direction: row; gap: 10px; }
.bs-sched-picker .bs-field-half .bs-field { flex: 1; }

/* 重复单选(iOS 列表式:选中主色高亮 + 右侧 ✓) */
.bs-sched-opt .bs-sched-check {
  font-size: 15px; color: transparent; flex-shrink: 0;
  transform: translateX(2px); transition: color .15s ease;
}
.bs-sched-opt.selected .bs-sched-check { color: #07c160; }
.bs-sched-opt.selected .bs-cell-title { color: #07c160; font-weight: 600; }

/* 每周重复日选择(QQ 式圆形 chips) */
.bs-sched-weekdays { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.bs-sched-wd-label { font-size: 13px; color: var(--text); font-weight: 500; padding: 0 4px; }
.bs-sched-wd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.bs-sched-wd {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  font-size: 14px; color: var(--text); cursor: pointer;
  transition: var(--transition); user-select: none;
}
.bs-sched-wd:hover { border-color: #07c160; }
.bs-sched-wd input[type="checkbox"] { display: none; }
.bs-sched-wd:has(input[type="checkbox"]:checked) {
  background: #07c160; border-color: #07c160; color: #fff; font-weight: 600;
  box-shadow: 0 3px 8px rgba(7, 193, 96, .3);
}
.bot-svc { max-width: 480px; }
.bot-svc .modal-body,
.bot-sub .modal-body {
  background: var(--bg-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bot-sub { max-width: 480px; }

/* 群详情入口行状态(已启用绿字) */
#gsBotValue.on { color: #07c160; font-weight: 500; }

/* 机器人身份卡 */
.bs-bot-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-bot-avatar {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c5cff 0%, #5b6cff 100%);
  color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(124, 92, 255, .3);
}
.bs-bot-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bs-bot-name { font-size: 16px; font-weight: 600; color: var(--text); }
.bs-bot-status { font-size: 12px; color: var(--muted); }
.bs-bot-status.on { color: #07c160; font-weight: 500; }

.bs-intro { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 0 4px; }

/* 服务列表(iOS 设置组:白色圆角卡片 + 行分隔线) */
.bs-list {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-cell {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 16px; background: transparent; border: none; text-align: left;
  cursor: pointer; font: inherit; transition: background .15s ease;
}
.bs-cell + .bs-cell { border-top: 1px solid var(--border); }
button.bs-cell:hover, button.bs-cell:active { background: var(--bg-soft); }
.bs-cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bs-cell-title { font-size: 15px; font-weight: 600; color: var(--text); }
.bs-cell-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.bs-cell-value {
  font-size: 13px; color: var(--muted); flex-shrink: 0;
  max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bs-cell-value.on { color: #07c160; font-weight: 500; }
.bs-cell-arrow {
  color: #c3c7cf; font-size: 19px; line-height: 1; flex-shrink: 0;
  font-family: system-ui, sans-serif; transform: translateY(-1px);
}
.bs-cell-static { cursor: default; }
.bs-cell-static:hover, .bs-cell-static:active { background: transparent; }
.bs-cell-static .bs-cell-title { flex: 1; font-weight: 500; }

/* 机器人名称行 */
.bs-name-row {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-name-fields { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.bs-name-fields label { font-size: 13px; color: var(--text); font-weight: 500; }
.bs-name-fields input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bs-name-fields input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.bs-name-save { width: auto; padding: 10px 20px; margin-top: 0; border-radius: 10px; flex-shrink: 0; }

/* 弹窗头部"完成"按钮(QQ 式右上主操作) */
.modal-header-actions { display: flex; align-items: center; gap: 10px; }
.modal-done-btn {
  border: none; background: transparent; color: #07c160;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; font-family: inherit;
}
.modal-done-btn:hover { background: rgba(7, 193, 96, .08); }
.modal-done-btn:disabled { opacity: .5; cursor: default; }

/* 开关行(标题+描述 左,开关右) */
.bs-switch-line {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-switch-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bs-switch-title { font-size: 15px; font-weight: 600; color: var(--text); }
.bs-switch-desc { font-size: 12px; color: var(--muted); }

/* 编辑器(欢迎语/定时消息:白卡 + textarea + 工具栏) */
.bs-editor {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-editor textarea {
  width: 100%; border: none; outline: none; resize: vertical;
  font-size: 14px; line-height: 1.6; color: var(--text); font-family: inherit;
  min-height: 84px; background: transparent;
}
.bs-editor textarea::placeholder { color: #94a3b8; }
.bs-editor-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.bs-var-btn {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-size: 12px; padding: 4px 10px; border-radius: 14px; cursor: pointer;
  font-family: inherit; transition: var(--transition);
}
.bs-var-btn:hover { border-color: var(--primary); color: var(--primary); }
.bs-editor-meta { flex: 1; font-size: 11px; color: var(--muted); text-align: right; }
.bs-counter { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.bs-counter b { color: var(--text); font-weight: 600; }
.bs-editor-tip { font-size: 11px; color: var(--muted); line-height: 1.5; }
.bs-editor-tip code {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; font-size: 11px; color: var(--primary);
}

/* 编辑器工具按钮组(@新成员/@全体成员/@成员/图片) */
.bs-editor-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 配图预览(欢迎语/定时消息:缩略图 + 移除按钮,对标 QQ) */
.bs-attach-preview {
  position: relative; align-self: flex-start;
  border-radius: 10px; overflow: visible;
}
.bs-attach-preview img {
  display: block; width: 96px; height: 96px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
.bs-attach-del {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(15, 23, 42, .72); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.bs-attach-del:hover { background: var(--danger); }

/* ============ 底部时间选择器(对标 QQ:三列滚轮) ============ */
.bot-time-picker-wrap { align-items: flex-end; padding: 0; z-index: 230; }
.btp-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  background: #fff; border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, .25);
  animation: btpSlideUp .25s ease;
  overflow: hidden;
}
@keyframes btpSlideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.btp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.btp-title { font-size: 15px; font-weight: 600; color: var(--text); }
.btp-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; font-family: inherit; padding: 4px 8px; border-radius: 8px;
  transition: var(--transition);
}
.btp-cancel { color: var(--muted); }
.btp-cancel:hover { color: var(--text); }
.btp-confirm { color: var(--primary); font-weight: 600; }
.btp-confirm:hover { background: rgba(79, 70, 229, .08); }
.btp-columns {
  display: flex; height: 240px; position: relative;
}
/* 中心高亮带(上下渐隐遮罩,对标 iOS 滚轮) */
.btp-columns::before,
.btp-columns::after {
  content: ''; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
}
.btp-columns::before { top: 0; height: 100px; background: linear-gradient(to bottom, #fff 30%, rgba(255,255,255,0)); }
.btp-columns::after { bottom: 0; height: 100px; background: linear-gradient(to top, #fff 30%, rgba(255,255,255,0)); }
/* 中心带上下细线(选择区视觉框) */
.btp-highlight-frame {
  position: absolute; left: 12px; right: 12px; top: 100px; height: 40px;
  border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0;
  z-index: 3; pointer-events: none;
}
.btp-col {
  flex: 1; overflow-y: auto; scrollbar-width: none;
  scroll-snap-type: y mandatory;
  /* snap 点 = 条目 offsetTop(100+i*40) 再上移 100px = i*40,与中心高亮带重合;
     不加时强制吸附会偏 ±20px,导致高亮线穿过数字 */
  scroll-padding-top: 100px;
  -ms-overflow-style: none;
}
.btp-col::-webkit-scrollbar { display: none; }
.btp-pad { height: 100px; scroll-snap-align: start; }
.btp-item {
  height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #94a3b8; scroll-snap-align: start;
  cursor: pointer; transition: color .12s ease, font-weight .12s ease;
  user-select: none;
}
/* 选中项仅加粗变色,不做 scale(放大盒会溢出 40px 高亮框 1px,导致边线贴字) */
.btp-item.center {
  color: var(--text); font-weight: 600;
}
/* 中心带边线 */
.btp-columns .btp-col::after { content: none; }

/* ============ @群成员选择器(对标 QQ) ============ */
.bot-mention-picker-wrap { z-index: 230; }
.bot-mention-picker { max-width: 420px; }
.bmp-search { padding: 0 20px 12px; }
.bmp-search input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--bg-soft); font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bmp-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.bmp-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.bmp-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border: none; background: transparent;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background .12s ease; width: 100%;
}
.bmp-item:hover { background: var(--bg-soft); }
.bmp-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.bmp-avatar-all { background: linear-gradient(135deg, #f59e0b, #ef4444); font-size: 17px; }
.bmp-info { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bmp-name { font-size: 14px; color: var(--text); font-weight: 500; }
.bmp-desc { font-size: 12px; color: var(--muted); }
.bmp-role { font-size: 11px; color: var(--muted); background: var(--bg-soft); padding: 1px 6px; border-radius: 4px; }
.bmp-empty { padding: 32px 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* 添加表单卡片(定时消息/自助问答) */
.bs-add-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-add-title { font-size: 15px; font-weight: 600; color: var(--text); }
.bs-field { display: flex; flex-direction: column; gap: 7px; position: relative; }
.bs-field > label { font-size: 13px; color: var(--text); font-weight: 500; }
.bs-field input[type="text"],
.bs-field textarea,
.bs-field select,
.bs-field input[type="date"],
.bs-field input[type="time"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bs-field textarea { min-height: 96px; }
.bs-field input:focus, .bs-field textarea:focus, .bs-field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.bs-field input::placeholder, .bs-field textarea::placeholder { color: #94a3b8; }
.bs-field-half { flex-direction: row; gap: 10px; }
.bs-field-half .bs-field { flex: 1; }
.bs-counter-field { align-self: flex-end; margin-top: -4px; }
.bs-add-btn { align-self: flex-end; width: auto; padding: 10px 32px; margin-top: 0; border-radius: 10px; }

/* 关键词标签(QQ 式 chips) */
.bs-kw-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bs-kw-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-kw-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px; background: rgba(79, 70, 229, .06);
  border: 1px solid rgba(79, 70, 229, .25); border-radius: 15px;
  font-size: 13px; color: var(--primary);
}
.bs-kw-x {
  border: none; background: rgba(79, 70, 229, .12); color: var(--primary);
  width: 17px; height: 17px; border-radius: 50%; cursor: pointer;
  font-size: 10px; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.bs-kw-x:hover { background: var(--primary); color: #fff; }
.bs-kw-add {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  border: 1px dashed #c3c7cf; background: var(--bg-soft); color: var(--muted);
  font-size: 16px; cursor: pointer; font-family: inherit; transition: var(--transition);
}
.bs-kw-add:hover { border-color: var(--primary); color: var(--primary); }
.bs-kw-input {
  width: 110px; padding: 6px 10px; border: 1px solid var(--primary);
  border-radius: 8px; font-size: 13px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

/* 说明横幅 + 分组标题(禁发特定消息) */
.bs-banner {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  background: var(--card); border-radius: 10px; padding: 10px 14px;
}
.bs-group-title { font-size: 12px; color: var(--muted); padding: 0 4px; margin-top: -4px; }

/* 违规处理方式预览(QQ 式消息气泡演示) */
.bs-violate-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.bs-violate-label { font-size: 15px; font-weight: 600; color: var(--text); }
.bs-preview {
  display: flex; gap: 10px; padding: 12px;
  background: var(--bg-soft); border-radius: 10px;
}
.bs-preview-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c5cff 0%, #5b6cff 100%);
  color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.bs-preview-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bs-preview-sys { font-size: 11px; color: var(--muted); }
.bs-preview-bubble {
  align-self: flex-start; max-width: 100%;
  background: #fff; border-radius: 2px 10px 10px 10px;
  padding: 8px 12px; font-size: 13px; color: var(--text); line-height: 1.6;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
  word-break: break-all;
}
.bs-preview-at { color: var(--primary); font-weight: 500; }

/* ============ 群操作按钮区 ============ */
.group-actions { margin-left: auto; }

/* ============ 聊天布局 ============ */
.chat-view { padding: 0 !important; }
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100%;
  min-height: 0;
  background: var(--card);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

/* 会话列表侧栏 */
.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fafbfd;
}
.chat-search { padding: 12px 12px 8px; }
.chat-search input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--card); outline: none;
  transition: var(--transition);
}
.chat-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

.conv-list { flex: 1; overflow-y: auto; }
.conv-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted); text-align: center; padding: 40px 20px;
}
.conv-empty .empty-icon { color: var(--border); margin-bottom: 8px; }

.conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
  transition: background .15s;
}
.conv-item:hover { background: #f0f2f5; }
.conv-item.active { background: #e8f0fe; }
.conv-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.conv-info { flex: 1; min-width: 0; }
/* 群会话头像区分(微信/QQ标准:群会话可辨识) */
.conv-avatar.group {
  background: linear-gradient(135deg, #576b95, #3f5179);
  position: relative;
  border-radius: 8px;
}
.conv-avatar-badge {
  position: absolute; right: -4px; bottom: -4px;
  background: #fff; color: #576b95;
  font-size: 9px; font-weight: 700;
  line-height: 1; padding: 2px 3px;
  border-radius: 4px;
  border: 1px solid #576b95;
}
.conv-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2px;
}
.conv-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time { font-size: 11px; color: var(--muted); flex-shrink: 0; margin-left: 8px; }
.conv-bottom {
  display: flex; justify-content: space-between; align-items: center;
}
.conv-preview {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; margin-right: 8px;
}
.conv-unread {
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* 消息流主区 */
.chat-main {
  position: relative; /* 查找聊天记录面板(chs-panel) absolute 覆盖锚点 */
  display: flex; flex-direction: column;
  overflow: hidden;
  background: #f5f5f5;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.chat-title { font-size: 15px; font-weight: 600; color: var(--text); }

.msg-list {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
  display: flex; flex-direction: column;
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted); text-align: center;
}
.chat-empty .empty-icon { color: var(--border); margin-bottom: 8px; }

/* 时间分隔 */
.time-divider {
  text-align: center; font-size: 11px; color: var(--muted);
  margin: 12px 0 8px; padding: 2px 8px;
  background: rgba(0,0,0,.05); border-radius: 4px;
  align-self: center;
}

/* 消息行(行业标准:mine 右对齐 bubble 在左 avatar 在右;theirs 左对齐 avatar 在左 bubble 在右) */
.msg-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 10px; max-width: 75%;
}
.msg-row.mine { align-self: flex-end; }
.msg-row.pending { opacity: .6; }
.msg-row.failed { opacity: .5; }

.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.msg-content { display: flex; flex-direction: column; min-width: 0; }
.msg-sender-name {
  font-size: 11px; color: var(--muted); margin-bottom: 2px;
}

.msg-bubble {
  padding: 9px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.5;
  word-break: break-word; position: relative;
  max-width: 100%;
}
.msg-row.mine .msg-bubble {
  background: #95ec69; color: #000;
  border-top-right-radius: 4px;
}
.msg-row.theirs .msg-bubble {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.msg-bubble.recalled, .msg-bubble.system {
  background: transparent !important; border: none !important;
  color: var(--muted); font-size: 12px; font-style: italic;
  text-align: center; align-self: center;
}
.msg-fail-icon { color: var(--danger); margin-left: 4px; }

.msg-image {
  max-width: 200px; max-height: 200px;
  border-radius: 8px; cursor: pointer; display: block;
}

/* bot 消息:文带图(欢迎语/定时消息配图,图随文下方) */
.msg-image-inline {
  max-width: 200px; max-height: 200px;
  border-radius: 8px; cursor: pointer; display: block;
  margin-top: 6px;
}

/* @提及高亮(欢迎语@新成员/定时消息@全体成员/@群成员) */
.msg-mention {
  color: #1d4ed8; font-weight: 600;
}
.msg-row.mine .msg-mention { color: #0b5ed7; }

/* ============ Bot/系统消息 ============ */
.msg-row.system {
  align-self: center; max-width: 80%; margin: 8px 0;
}
.msg-system-text {
  background: rgba(0,0,0,.05); color: var(--muted);
  font-size: 12px; padding: 4px 12px; border-radius: 8px;
  text-align: center;
}
/* 精华通知(对标 QQ:蓝色可点击,点击定位原消息) */
.msg-system-text.essence-notice {
  background: transparent; color: var(--link, #576b95); cursor: pointer;
  font-weight: 500;
}
.msg-system-text.essence-notice:hover { text-decoration: underline; }
.msg-system-text.essence-notice:active { opacity: .7; }
/* 气泡精华角标(对标 QQ:挂在消息气泡下方,不挤占气泡内文本右侧) */
.msg-main { display: flex; flex-direction: column; min-width: 0; }
.msg-essence-tag {
  display: flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: #d97706; background: rgba(217, 119, 6, .08);
  padding: 3px 8px; border-radius: 999px;
  width: fit-content; margin-top: 4px; user-select: none; pointer-events: none;
}
/* 我的消息:角标右对齐下挂(随气泡靠右);对方消息:左对齐下挂 */
.msg-row.mine .msg-essence-tag { align-self: flex-end; }
/* 右键菜单"取消精华"态 */
.ctx-item.essence.essence-on { color: #b45309; }
.msg-row.bot .msg-avatar.bot-avatar {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  font-size: 16px;
}
.msg-sender-name.bot-name { display: flex; align-items: center; gap: 6px; color: #1d4ed8; }
.bot-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: #dbeafe; color: #1d4ed8; font-style: normal;
}
.msg-row.bot .msg-bubble {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a;
  border-top-left-radius: 4px;
}

/* ============ 命令提示面板 ============ */
.command-hint-panel {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  max-height: 200px; overflow-y: auto; z-index: 20; margin-bottom: 4px;
}
.command-hint-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--bg-soft);
}
.command-hint-item:last-child { border-bottom: none; }
.command-hint-item:hover { background: var(--bg-soft); }
.command-hint-item .cmd-name { font-weight: 600; color: var(--primary); font-size: 13px; min-width: 60px; }
.command-hint-item .cmd-desc { color: var(--muted); font-size: 12px; }

/* 输入栏 */
.chat-input-bar {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 16px; background: var(--card);
  border-top: 1px solid var(--border);
  position: relative;
}
.chat-input-bar textarea {
  flex: 1; resize: none;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px;
  font-family: inherit; outline: none;
  max-height: 120px; line-height: 1.5;
  transition: var(--transition);
}
.chat-input-bar textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.chat-send-btn {
  padding: 9px 20px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.chat-send-btn:hover { background: var(--primary-dark); }
.chat-send-btn:active { transform: scale(.97); }

/* ============ 阶段3:多媒体工具栏 ============ */
.chat-toolbar {
  display: flex; gap: 4px; padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.toolbar-btn {
  width: 32px; height: 32px;
  border: none; border-radius: 8px;
  background: var(--bg-soft);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.toolbar-btn:hover { background: #e0e7ff; }

.msg-video { max-width: 240px; max-height: 200px; border-radius: 8px; display: block; }
.voice-icon, .file-icon { margin-right: 4px; }

/* ============ 阶段4:引用回复 ============ */
.reply-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: #f0f9ff;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 0 0;
}
.reply-info { flex: 1; min-width: 0; }
.reply-label { font-size: 12px; color: var(--primary); font-weight: 600; }
.reply-content {
  display: inline; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 300px;
}
.reply-cancel {
  border: none; background: transparent; cursor: pointer;
  font-size: 16px; color: var(--muted);
  width: 24px; height: 24px; border-radius: 50%;
}
.reply-cancel:hover { background: #e2e8f0; }
.msg-reply {
  font-size: 12px; color: var(--muted);
  padding: 4px 8px; margin-bottom: 4px;
  background: rgba(0,0,0,.06); border-radius: 4px;
  border-left: 2px solid #cbd5e1;
}
.reply-quote { color: var(--primary); font-weight: 500; }

/* ============ 阶段4:右键菜单 ============ */
.ctx-menu {
  position: fixed; z-index: 10000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  padding: 4px; min-width: 120px;
  animation: ctxFade .15s ease;
}
@keyframes ctxFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.ctx-item {
  display: block; width: 100%;
  padding: 8px 12px; border: none;
  background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text);
  text-align: left; border-radius: 6px;
  transition: var(--transition);
}
.ctx-item:hover { background: var(--bg-soft); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: #fef2f2; }

/* ============ 阶段5:群公告栏 ============ */
.announcement-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: #fef9c3;
  border-bottom: 1px solid #fde68a;
  font-size: 13px; color: #92400e;
}
.ann-text {
  flex: 1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ============ 群公告(微信风格) ============ */
/* 群详情板块分隔线 */
.gd-divider {
  height: 1px; background: var(--border);
  margin: 16px 0;
}

/* 群详情概览公告条目(微信列表项风格:白底 + 细线 + 绿图标 + 灰箭头) */
.gd-announcement-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer; user-select: none;
  transition: background .15s ease;
}
.gd-announcement-row:hover { background: var(--bg-soft); }
.gd-announcement-row:active { background: #f2f3f5; }
.gd-announcement-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.gd-ann-main { flex: 1; min-width: 0; }
.gd-ann-label { font-size: 15px; color: var(--text); line-height: 1.4; }
.gd-ann-preview {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px; line-height: 1.4;
}
.gd-unread-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #fa5151; color: #fff;
  font-size: 11px; font-weight: 600;
  line-height: 18px; text-align: center;
  flex-shrink: 0;
}
.gd-ann-arrow { color: #c8c8c8; font-size: 20px; flex-shrink: 0; line-height: 1; }

/* 公告列表弹窗 */
.ann-header-actions { display: flex; align-items: center; gap: 10px; }
.ann-publish-btn {
  width: auto; margin-top: 0;
  padding: 6px 16px; font-size: 13px;
  background: #07c160;
}
.ann-publish-btn:hover { background: #06ad56; }

.ann-pinned { margin-bottom: 12px; }
.ann-history {
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ann-history::before {
  content: '历史公告';
  display: block;
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .5px;
  margin-bottom: 2px;
}
.ann-history:empty { display: none; }

.ann-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--card);
  transition: var(--transition);
}
.ann-card.pinned {
  border-color: rgba(7, 193, 96, .3);
  border-left: 3px solid #07c160;
  background: #f6fffa;
}
.ann-card.history { cursor: pointer; }
.ann-card.history:hover { background: var(--bg-soft); }

.ann-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.ann-pin-tag {
  font-size: 11px; font-weight: 600; color: #07c160;
  background: rgba(7, 193, 96, .1);
  border-radius: 4px; padding: 2px 7px;
  flex-shrink: 0; white-space: nowrap;
}
.ann-card-content {
  font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}
.ann-card-content.clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ann-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px;
  font-size: 12px; color: var(--muted);
}
.ann-card-author { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-card-ops { display: flex; gap: 2px; flex-shrink: 0; }
.ann-op-btn {
  border: none; background: none; cursor: pointer;
  font-size: 12px; color: var(--muted);
  padding: 3px 8px; border-radius: 6px;
  transition: var(--transition);
}
.ann-op-btn:hover { background: var(--bg-soft); color: var(--text); }
.ann-op-btn.danger:hover { color: var(--danger); background: rgba(220, 38, 38, .08); }

.ann-confirm-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.ann-confirm-count { font-size: 12px; color: var(--muted); }
.ann-confirm-btn {
  width: auto; margin-top: 0;
  padding: 6px 18px; font-size: 13px;
  background: #07c160;
}
.ann-confirm-btn:hover { background: #06ad56; }
.ann-confirmed-tag {
  font-size: 12px; color: #07c160; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.ann-empty { text-align: center; padding: 48px 0; color: var(--muted); }
.ann-empty .empty-icon { font-size: 40px; margin-bottom: 10px; opacity: .6; }
.ann-empty .empty-text { font-size: 14px; }

/* 公告发布/编辑弹窗表单 */
#announcementEditorModal .modal-body { display: flex; flex-direction: column; gap: 14px; }
#announcementEditorModal .form-row { display: flex; flex-direction: column; gap: 6px; }
#announcementEditorModal .form-row > label:not(.switch-line) {
  font-size: 12px; color: var(--muted); font-weight: 500;
}
#announcementEditorModal input[type="text"],
#announcementEditorModal textarea {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: var(--card); outline: none; resize: vertical;
  transition: var(--transition);
}
#announcementEditorModal input[type="text"]:focus,
#announcementEditorModal textarea:focus {
  border-color: #07c160;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, .12);
}
#announcementEditorModal .switch-line {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft); border-radius: 8px;
}
#announcementEditorModal .switch-line > span { font-size: 13px; color: var(--text); }
#announcementEditorModal .switch input:checked + .switch-slider { background: #07c160; }

/* 编辑器:字数统计 */
.ann-char-count { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* 编辑器:图片上传区 */
.ann-image-picker { display: flex; align-items: flex-start; gap: 10px; }
.ann-image-add {
  width: 88px; height: 88px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--border); border-radius: 8px;
  background: var(--bg-soft); cursor: pointer;
  font-size: 12px; color: var(--muted);
  transition: var(--transition);
}
.ann-image-add:hover { border-color: #07c160; color: #07c160; }
.ann-image-add-icon { font-size: 22px; line-height: 1; }
.ann-image-preview {
  position: relative; width: 88px; height: 88px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
}
.ann-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.ann-image-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.ann-image-remove:hover { background: rgba(220,38,38,.8); }

/* 编辑器:选项行(带描述) */
.ann-options { display: flex; flex-direction: column; gap: 8px; }
.ann-opt-text { display: flex; flex-direction: column; gap: 2px; }
.ann-opt-name { font-size: 13px; color: var(--text); font-weight: 500; }
.ann-opt-desc { font-size: 11px; color: var(--muted); }

/* 编辑器:高级设置折叠区 */
.ann-advanced { border-top: 1px solid var(--border); padding-top: 10px; }
.ann-advanced-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 12px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text);
  border-radius: 8px; transition: var(--transition);
}
.ann-advanced-toggle:hover { background: var(--bg-soft); }
.ann-advanced-arrow { font-size: 16px; color: var(--muted); transition: transform .2s; }
.ann-advanced-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* 公告卡片:配图 */
.ann-card-image { margin: 10px 0 4px; }
.ann-card-image img {
  max-width: 100%; max-height: 200px;
  border-radius: 8px; object-fit: cover;
  display: block;
}

/* 公告卡片:修改群昵称按钮行 */
.ann-nickname-row {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.ann-nickname-btn { width: 100%; margin-top: 0; font-size: 13px; padding: 8px; }

/* 公告已读回执(对标钉钉/企微) */
.ann-count-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--primary); font-size: 12px; font-weight: 500;
}
.ann-count-link:hover { text-decoration: underline; }
.ann-read-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.ann-read-tab {
  padding: 8px 16px; background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: var(--transition);
}
.ann-read-tab:hover { color: var(--text); }
.ann-read-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ann-read-list { max-height: 380px; overflow-y: auto; }
.ann-read-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--bg-soft);
}
.ann-read-row:last-child { border-bottom: none; }
.ann-read-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.ann-read-pending { font-size: 12px; color: #f59e0b; flex-shrink: 0; font-weight: 500; }
.ann-read-loading, .ann-read-empty {
  padding: 32px 0; text-align: center; color: var(--muted); font-size: 13px;
}

/* ============ 阶段6:查找聊天记录(微信风格) ============ */
.chs-panel {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: #fff;
  animation: chsIn .18s ease;
}
@keyframes chsIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
.chs-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #fff;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chs-back-btn {
  width: 32px; height: 32px; border: none; background: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; border-radius: 8px;
  transition: background .12s ease;
}
.chs-back-btn:hover { background: var(--bg-soft); }
.chs-nav-title { font-size: 15px; font-weight: 600; color: var(--text); }
.chs-nav-spacer { width: 32px; flex-shrink: 0; }

.chs-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }
/* 搜索框(微信灰底圆角) */
.chs-search-row {
  display: flex; align-items: center; gap: 8px;
  background: #f7f7f7; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 12px;
}
.chs-search-icon { color: #9aa0a6; display: inline-flex; flex-shrink: 0; }
.chs-search-row input {
  flex: 1; border: none; background: none; outline: none;
  font: inherit; font-size: 14px; color: var(--text); min-width: 0;
}
.chs-search-row input::placeholder { color: #9aa0a6; }
.chs-input-clear {
  border: none; background: none; cursor: pointer;
  font-size: 14px; color: #9aa0a6; padding: 2px 4px; flex-shrink: 0;
}
.chs-input-clear:hover { color: var(--text); }

/* 分类(微信样式:无边框纯蓝色可点击文字,紧凑排列) */
.chs-subtitle { font-size: 13px; color: var(--muted); margin: 0 0 2px; }
.chs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.chs-cat {
  padding: 13px 4px; border: none;
  background: none; font: inherit; font-size: 14px; color: #576b95;
  cursor: pointer; transition: opacity .12s ease;
}
.chs-cat:hover { text-decoration: underline; }
.chs-cat:active { opacity: .6; }

/* 子面板(日期/成员) */
.chs-subview-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.chs-subview-back {
  display: inline-flex; align-items: center; gap: 2px;
  border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: #576b95; padding: 4px 6px;
  border-radius: 6px;
}
.chs-subview-back:hover { background: #f7f7f7; }
.chs-subview-title { font-size: 14px; color: var(--muted); }
.chs-date-row { display: flex; align-items: center; gap: 10px; }
.chs-date-row input[type="date"] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; font-size: 14px; color: var(--text);
  outline: none; background: #fff; min-width: 0;
}
.chs-date-row input[type="date"]:focus { border-color: #576b95; }
.chs-go-btn {
  padding: 9px 22px; border: none; border-radius: 8px;
  background: #576b95; color: #fff; font: inherit; font-size: 14px;
  cursor: pointer; flex-shrink: 0; transition: opacity .12s ease;
}
.chs-go-btn:hover { opacity: .88; }

/* 成员列表 */
.chs-member-list { display: flex; flex-direction: column; }
.chs-member-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px; cursor: pointer; border-radius: 8px;
  transition: background .12s ease;
}
.chs-member-item:hover { background: #f7f7f7; }
.chs-member-avatar {
  width: 38px; height: 38px; border-radius: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e8ebf2; color: #576b95;
  font-size: 15px; font-weight: 600;
}
.chs-member-name { flex: 1; font-size: 14px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chs-member-me { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 4px; }
.chs-member-arrow { color: #c5c9d0; flex-shrink: 0; }

/* 结果列表 */
.chs-hint { font-size: 13px; color: var(--muted); text-align: center; padding: 24px 0; margin: 0; }
.chs-result-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 6px; cursor: pointer; border-radius: 8px;
  transition: background .12s ease;
}
.chs-result-item:hover { background: #f7f7f7; }
.chs-result-item + .chs-result-item { border-top: 1px solid #f5f5f5; }
.chs-result-avatar {
  width: 38px; height: 38px; border-radius: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e8ebf2; color: #576b95;
  font-size: 15px; font-weight: 600;
}
.chs-result-main { flex: 1; min-width: 0; }
.chs-result-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.chs-result-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chs-result-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.chs-result-content {
  font-size: 13px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-highlight { animation: highlightPulse 2s ease; }
@keyframes highlightPulse {
  0%, 100% { background: transparent; }
  50% { background: #fef9c3; }
}

/* ============ 阶段6:会话列表图标 ============ */
.conv-muted-icon, .conv-pinned-icon {
  font-size: 11px; margin-left: 4px; opacity: .6;
}
.chat-icon-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--muted);
  padding: 4px 8px; border-radius: 6px;
  transition: var(--transition);
}
.chat-icon-btn:hover { background: var(--bg-soft); color: var(--text); }

/* ============ 响应式 ============ */

/* 平板:侧栏收窄 */
@media (max-width: 1024px) {
  .chat-layout { grid-template-columns: 220px 1fr; }
}

/* 桌面端:隐藏移动端专属按钮 */
@media (min-width: 769px) {
  #chatConvListBtn { display: none !important; }
}

/* 移动端:单列,侧栏滑出覆盖 */
@media (max-width: 768px) {
  .app-content { margin: 8px auto; padding: 0 12px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: var(--card);
    width: 100%;
  }
  .chat-layout.show-sidebar .chat-sidebar { display: flex; }
  .chat-sidebar-mobile-back { display: flex; }
  .msg-row { max-width: 85%; }
}
.chat-sidebar-mobile-back {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
}
.chat-sidebar-mobile-back:hover { background: var(--bg-soft); }

/* ============ 社交整合:全高布局 + 聊天覆盖层 ============ */
.social-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.social-wrap .sub-tabs { flex-shrink: 0; }
.social-wrap .stab-pane { flex: 1; min-height: 0; overflow-y: auto; }
.user-row.clickable { cursor: pointer; transition: var(--transition); }
.user-row.clickable:hover { background: var(--bg-soft); }

/* 聊天覆盖层:覆盖社交列表,全高 */
.chat-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--card);
  display: flex;
}
.chat-overlay[hidden] { display: none !important; }
.chat-overlay .chat-layout { flex: 1; min-height: 0; height: 100%; }

/* 返回按钮 */
.chat-back-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 8px; border-radius: 8px;
  color: var(--text); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.chat-back-btn:hover { background: var(--bg-soft); }
.chat-header { gap: 4px; }

/* ============ 个人资料抽屉(微信风格,从右滑入)============ */
.profile-drawer {
  position: fixed; inset: 0; z-index: 220;
  display: flex; justify-content: flex-end;
}
.profile-drawer[hidden] { display: none !important; }
.profile-drawer-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.profile-drawer-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px; height: 100%;
  background: var(--card); box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column;
  animation: drawerSlideIn .28s cubic-bezier(.16,.84,.44,1);
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.profile-drawer-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--card);
}
.profile-drawer-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.profile-drawer-back {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 8px; border-radius: 8px; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.profile-drawer-back:hover { background: var(--bg-soft); }
.profile-drawer-body { flex: 1; overflow-y: auto; padding: 24px 20px; }

/* 大头像 */
.profile-avatar-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.profile-avatar {
  position: relative; width: 96px; height: 96px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 36px; font-weight: 600;
  transition: var(--transition);
}
.profile-avatar:hover { box-shadow: 0 0 0 4px rgba(79, 70, 229, .15); }
.profile-avatar:hover .profile-avatar-mask { opacity: 1; }
.profile-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-fallback { position: relative; z-index: 0; }
.profile-avatar-mask {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(15, 23, 42, .55); color: #fff;
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s ease;
}

/* 信息行 */
.profile-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.profile-label { font-size: 13px; color: var(--muted); width: 60px; flex-shrink: 0; }
.profile-value { font-size: 14px; color: var(--text); flex: 1; word-break: break-all; }
.profile-uid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.profile-edit-btn {
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px;
  transition: var(--transition);
}
.profile-edit-btn:hover { background: var(--bg-soft); color: var(--primary); }
.profile-edit-input {
  flex: 1; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--card); outline: none;
  transition: var(--transition);
}
.profile-edit-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
#profileBioInput { resize: vertical; min-height: 44px; font-family: inherit; }
.profile-save-btn, .profile-cancel-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: var(--transition); border: 1px solid var(--border);
}
.profile-save-btn { background: var(--primary); color: #fff; border-color: var(--primary); }
.profile-save-btn:hover { background: var(--primary-dark); }
.profile-cancel-btn { background: var(--card); color: var(--muted); }
.profile-cancel-btn:hover { color: var(--text); border-color: var(--muted); }

/* 移动端:全屏抽屉 */
@media (max-width: 600px) {
  .profile-drawer-panel { max-width: 100%; }
}

/* ============================================================
   下载子 Tab(B站下载集成,行业标准)
   ============================================================ */
.download-pane {
  padding: 4px 0;
}
.dl-input-row {
  display: flex; gap: 10px; margin-bottom: 16px;
}
#dlUrlInput {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--card); color: var(--text);
  transition: var(--transition);
}
#dlUrlInput:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.btn-dl-extract {
  padding: 10px 20px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-dl-extract:hover:not(:disabled) { background: var(--primary-dark); }
.btn-dl-extract:disabled { opacity: 0.6; cursor: not-allowed; }

/* 视频信息预览 */
.dl-info {
  display: flex; gap: 12px; padding: 12px;
  background: var(--bg); border-radius: 8px; margin-bottom: 12px;
}
.dl-thumb {
  width: 160px; height: 90px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0; background: #ddd;
}
.dl-meta { flex: 1; min-width: 0; }
.dl-title {
  font-weight: 600; font-size: 14px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.dl-sub { font-size: 12px; color: var(--muted); }

/* 格式选择 */
.dl-formats { margin-bottom: 16px; }
.dl-mode-toggle {
  display: flex; gap: 4px; margin-bottom: 10px;
  background: var(--bg); border-radius: 8px; padding: 4px;
}
.dl-mode {
  flex: 1; padding: 8px; border: none; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 500;
  border-radius: 6px; cursor: pointer; transition: var(--transition);
}
.dl-mode.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.dl-format-sel {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--card); color: var(--text);
  margin-bottom: 10px; cursor: pointer;
}
.dl-format-sel:focus { outline: none; border-color: var(--primary); }
.dl-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); margin-right: 16px; cursor: pointer;
}
.dl-opt input { cursor: pointer; }

.btn-dl-go {
  width: 100%; padding: 12px; margin-top: 10px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-dl-go:hover:not(:disabled) { background: var(--primary-dark); }
.btn-dl-go:disabled { opacity: 0.6; cursor: not-allowed; }

/* 任务列表 */
.dl-tasks { display: flex; flex-direction: column; gap: 8px; }
.dl-empty { text-align: center; padding: 32px; color: var(--muted); font-size: 14px; }

.dl-task-card {
  padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card); transition: var(--transition);
}
.dl-task-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; gap: 8px;
}
.dl-task-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.dl-stage-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: rgba(79,70,229,0.1); color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
}

/* 进度条 */
.dl-bar {
  height: 6px; background: var(--bg); border-radius: 3px;
  overflow: hidden; margin-bottom: 6px;
}
.dl-bar-fill {
  height: 100%; background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-radius: 3px; transition: width 0.3s ease;
}
.dl-task-meta {
  display: flex; gap: 12px; font-size: 11px; color: var(--muted);
  margin-bottom: 8px;
}
.dl-pct { font-weight: 600; color: var(--text); }

.dl-task-actions { display: flex; gap: 8px; align-items: center; }
.dl-btn-cancel, .dl-btn-del, .dl-btn-view {
  padding: 4px 10px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); cursor: pointer; transition: var(--transition);
}
.dl-btn-cancel:hover { color: #ef4444; border-color: #ef4444; }
.dl-btn-del:hover { color: #ef4444; border-color: #ef4444; }
.dl-btn-view { color: var(--primary); border-color: var(--primary); }
.dl-btn-view:hover { background: var(--primary); color: #fff; }
.dl-error {
  font-size: 11px; color: #ef4444;
  max-width: 200px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* 移动端适配 */
@media (max-width: 600px) {
  .dl-thumb { width: 120px; height: 68px; }
  .dl-input-row { flex-direction: column; }
  .btn-dl-extract { width: 100%; }
  .dl-opt { margin-right: 8px; }
}

/* ============================================================
   群设置主页 + 管理群(对标 QQ,2026-09-05)
   ============================================================ */
.gs-body { padding: 16px 20px; }
/* 群头部(对标 QQ:方形头像 + 群名 + 群号,整行可点) */
.gs-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
  padding: 8px; margin-left: -8px; margin-right: -8px; border-radius: 12px;
  cursor: pointer; transition: background .15s ease;
}
.gs-header:hover { background: var(--bg-soft); }
.gs-header:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gs-avatar {
  width: 58px; height: 58px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; background-size: cover; background-position: center;
  position: relative;
}
.gs-header-info { flex: 1; min-width: 0; }
.gs-name {
  font-size: 17px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-name span#groupDetailName { overflow: hidden; text-overflow: ellipsis; }
.gs-edit-icon { font-size: 13px; color: var(--muted); opacity: .6; flex-shrink: 0; }
.gs-sub { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.gs-number { cursor: pointer; border-radius: 4px; }
.gs-number:hover { color: var(--primary); text-decoration: underline; }
/* 右侧二维码入口 + 箭头(QQ 式竖排) */
.gs-header-actions {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; flex-shrink: 0; padding-right: 2px;
}
.gs-qr-btn {
  width: 34px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: #9aa0aa; cursor: pointer;
  border-radius: 8px; transition: color .15s ease, background .15s ease;
}
.gs-qr-btn:hover { color: var(--primary); background: rgba(79, 70, 229, .08); }
.gs-header-arrow { color: #c3c7cf; font-size: 20px; line-height: 1; }

/* ============================================================
   找群 / 群二维码 / 加入群确认(对标 QQ,2026-09-07)
   ============================================================ */
/* files-bar 双按钮(找群 + 建群) */


/* 找群弹窗 */
.fg-search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.fg-search-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); background: var(--card); font-family: inherit;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.fg-search-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.fg-search-row .btn-primary { width: auto; margin-top: 0; padding: 10px 18px; border-radius: 10px; }
.fg-results { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.fg-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 0; }
.fg-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fg-item:hover { border-color: rgba(79, 70, 229, .35); box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
.fg-avatar {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; background-size: cover; background-position: center;
}
.fg-item-info { flex: 1; min-width: 0; }
.fg-item-name { font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-item-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fg-item-desc { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-join-btn { width: auto; margin-top: 0; padding: 8px 16px; border-radius: 9px; font-size: 13px; flex-shrink: 0; }

/* 群二维码弹窗(QQ 式白卡) */
.qr-card { max-width: 360px; }
.qr-body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 18px; }
.qr-white-card {
  width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 20px 16px; display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}
.qr-group-head { display: flex; align-items: center; gap: 12px; width: 100%; padding-bottom: 14px; border-bottom: 1px solid #f1f2f6; }
.qr-avatar { width: 44px; height: 44px; border-radius: 10px; font-size: 17px; }
.qr-group-info { flex: 1; min-width: 0; text-align: left; }
.qr-name { font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-number { font-size: 12px; color: var(--muted); margin-top: 3px; }
.qr-canvas-wrap {
  margin-top: 16px; padding: 12px; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.qr-canvas-wrap canvas, .qr-canvas-wrap img { display: block; }
.qr-hint { margin-top: 12px; font-size: 13px; color: #6b7280; }
.qr-download-btn { width: auto; margin-top: 0; padding: 9px 22px; border-radius: 10px; }

/* 加入群确认弹窗(QQ 式加群页) */
.jg-card {
  display: flex; gap: 14px; padding: 14px; margin-bottom: 4px;
  background: var(--bg-soft); border-radius: 14px;
}
.jg-avatar { width: 56px; height: 56px; border-radius: 12px; font-size: 20px; }
.jg-info { flex: 1; min-width: 0; }
.jg-name { font-size: 16px; font-weight: 600; color: var(--text); }
.jg-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.jg-desc {
  font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.jg-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.jg-form .form-row { display: flex; flex-direction: column; gap: 7px; }
.jg-form .form-row > label { font-size: 13px; color: var(--text); font-weight: 500; }
.jg-form .form-row input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); background: var(--card); font-family: inherit;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.jg-form .form-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.jg-question-text { font-size: 14px; color: var(--text); background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.jg-status {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 13px; text-align: center;
}
.jg-status.ok { background: rgba(16, 185, 129, .1); color: #059669; }
.jg-status.err { background: rgba(239, 68, 68, .08); color: #dc2626; }
.jg-status:not(.ok):not(.err) { background: var(--bg-soft); color: var(--muted); }

.gs-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 4px;
  cursor: pointer; transition: var(--transition); border-radius: 8px;
}
.gs-row:hover { background: var(--bg-soft); }
.gs-label { font-size: 14px; color: var(--text); flex: 1; }
.gs-value { font-size: 13px; color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-arrow { color: #c0c4cc; font-size: 16px; }
.gs-danger-text { color: var(--danger); }
.gs-manage-hint { font-size: 12px; }
.gs-switch-row { cursor: default; }
.gs-switch-row:hover { background: transparent; }
.gs-switch-row .gs-label { flex: 1; }

.gs-dnd { border-left: 0; }
.gs-dnd-detail { padding: 4px 4px 8px; display: flex; flex-direction: column; gap: 10px; }
.gs-dnd-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.gs-radio-group, .gs-check-group { display: flex; flex-direction: column; gap: 8px; }
.gs-radio-group label, .gs-check-group label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer;
}
.gs-radio-group input, .gs-check-group input { accent-color: var(--primary); }
.gs-follow-block { display: flex; flex-direction: column; gap: 8px; }
.gs-follow-head { display: flex; align-items: center; justify-content: space-between; }
.gs-follow-add {
  border: none; background: transparent; color: var(--primary); font-size: 12px;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.gs-follow-add:hover { background: var(--bg-soft); }
.gs-follow-list { display: flex; flex-wrap: wrap; gap: 8px; }
.gs-follow-item {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--bg-soft); border-radius: 14px; font-size: 12px; color: var(--text);
}
.gs-follow-remove {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0;
}
.gs-follow-remove:hover { color: var(--danger); }

/* ============ 管理群弹窗(对标微信/QQ:灰底滚动区 + 白色分组卡片) ============ */
.gm-card { display: flex; flex-direction: column; max-height: 88vh; }
.gm-card.lg { max-width: 640px; }

/* QQ 式分组列表:灰色分组标题 + 白色圆角卡片 + 行右侧灰色摘要 */
.gm-group { margin-bottom: 18px; }
.gm-group:last-child { margin-bottom: 2px; }
.gm-group-title { font-size: 12px; color: var(--muted); padding: 0 4px 7px; }
.gm-list {
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.gm-cell {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 14px 16px;
  background: transparent; border: none; text-align: left;
  cursor: pointer; font: inherit; transition: background .15s ease;
}
.gm-cell + .gm-cell { border-top: 1px solid var(--border); }
.gm-cell:hover { background: var(--bg-soft); }
.gm-cell:active { background: #eef0f5; }
.gm-cell-label { flex: 1; font-size: 15px; color: var(--text); white-space: nowrap; }
.gm-cell-value {
  font-size: 13px; color: var(--muted); max-width: 45%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gm-cell-value.pending { color: #f59e0b; font-weight: 600; }
.gm-cell-arrow {
  color: #c3c7cf; font-size: 20px; line-height: 1; flex-shrink: 0;
  font-family: system-ui, sans-serif; transform: translateY(-1px);
}

/* 内容区:微信式灰底滚动区 */
.gm-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg-soft); }
.gm-body::-webkit-scrollbar { width: 6px; }
.gm-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
/* 二级弹窗容器:iOS 设置页(灰底滚动区 + 白色分组卡片,header/footer 白色) */
.gm-sub .modal-body { display: flex; flex-direction: column; gap: 14px; background: var(--bg-soft); padding: 16px; }

/* 卡片上方小节标题(P2 式灰色小字,仅二级弹窗) */
.gm-sub .gm-group-title { padding: 0 4px; margin-top: -2px; }
/* 卡片下方说明文字(P2 式底部灰字) */
.gm-footnote { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 0 4px; }

/* ===== 群精华消息列表(对标 QQ 群精华页) ===== */
.essence-list { display: flex; flex-direction: column; gap: 12px; flex: 1; overflow-y: auto; }
.essence-card {
  background: var(--card); border-radius: 12px; padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.ess-card-main { display: flex; flex-direction: column; gap: 8px; }
.ess-sender {
  font-size: 12px; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.ess-content {
  font-size: 14px; color: var(--text); line-height: 1.6;
  word-break: break-word; white-space: pre-wrap;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.ess-content.ess-media { color: var(--muted); font-style: normal; }
.ess-thumb {
  height: 150px; border-radius: 10px;
  background: var(--bg-soft) center/contain no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
.ess-thumb-fail { height: auto; padding: 18px 0; background: var(--bg-soft); }
.ess-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.ess-meta { font-size: 11.5px; color: #b6bcc4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 精华卡片可点击:进入群聊定位原消息(对标 QQ) */
.essence-card { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.essence-card:active { transform: scale(.985); }
.essence-card:hover { box-shadow: 0 2px 10px rgba(217, 119, 6, .12); }
/* 右键菜单"设为精华"项 */
.ctx-item.essence { color: #d97706; }

/* ===== 社交页顶栏 + +按钮下拉菜单(对标 QQ) ===== */
.social-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-topbar .sub-tabs { margin-bottom: 0; }
.social-plus-wrap { position: relative; flex-shrink: 0; }
.social-plus-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.social-plus-btn:hover { background: var(--bg-soft); }
.social-plus-btn.open { background: var(--primary); color: #fff; border-color: var(--primary); transform: rotate(45deg); }
.social-plus-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 148px; padding: 6px;
  background: var(--card); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .04);
  animation: spmIn .16s ease;
}
@keyframes spmIn {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.spm-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border: none; border-radius: 9px;
  background: none; font: inherit; font-size: 14px; color: var(--text);
  text-align: left; cursor: pointer; transition: background .12s ease;
}
.spm-item:hover { background: var(--bg-soft); }
.spm-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.spm-icon-group { background: #7c5cff; }
.spm-icon-person { background: #f59e0b; }

/* ===== iOS 分段控件(加好友/群弹窗) ===== */
.seg-tabs {
  display: flex; background: #f1f2f6; border-radius: 9px; padding: 2px;
  margin-bottom: 14px;
}
.seg-tab {
  flex: 1; padding: 7px 0; border: none; border-radius: 7px;
  background: none; font: inherit; font-size: 14px; color: var(--muted);
  cursor: pointer; transition: all .15s ease;
}
.seg-tab.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }

/* 添加禁言时段·周一~周日选择行(对标QQ:右侧蓝色圆形✓,多选) */
.gm-wd-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: transparent;
  border: 1.5px solid #d1d5db; background: transparent;
  transition: var(--transition);
}
.gm-wd-check.on {
  color: #fff; border-color: var(--primary);
  background: var(--primary);
}

/* ============ 设置管理员(对标QQ:主行共N人+4头像堆 / 二级页 / 底部弹窗) ============ */
/* 主列表"设置管理员"行摘要(共N人 + 头像堆 + 箭头) */
.gm-admin-cell .gm-admin-summary {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  max-width: 58%; min-width: 0;
}
.gm-admin-count { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.gm-admin-avatars { display: flex; align-items: center; }
.gm-admin-avatars .gm-admin-av { margin-left: -8px; border: 2px solid var(--card); }
.gm-admin-avatars .gm-admin-av:first-child { margin-left: 0; }
/* 首字母头像(群主金/管理员紫/普通灰) */
.gm-admin-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #94a3b8, #64748b);
}
.gm-admin-av.owner { background: linear-gradient(135deg, #f59e0b, #d97706); }
.gm-admin-av.admin { background: linear-gradient(135deg, #818cf8, #6366f1); }
/* 二级页行:头像+名字+右值 */
.gm-adm-row .gm-admin-av { width: 38px; height: 38px; font-size: 16px; }
.gm-adm-name {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.gm-adm-row-wrap {
  display: flex; align-items: center;
}
.gm-adm-row-wrap + .gm-adm-row-wrap { border-top: 1px solid var(--border); }
.gm-adm-row-wrap .gm-list-cell { flex: 1; border-top: none !important; }
/* 编辑模式:红色移除圆钮 + 行右移 */
.gm-adm-remove {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  margin: 0 10px 0 14px; border: none; cursor: pointer;
  background: #f87171; color: #fff; font-size: 17px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.gm-adm-remove:hover { background: #ef4444; }
.gm-adm-row-shift { padding-left: 4px !important; }
.gm-adm-empty { padding: 22px 16px; font-size: 13px; color: var(--muted); text-align: center; }
/* "添加管理员"行(绿色+圆) */
.gm-admin-add-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(7, 193, 96, .12); color: #07c160;
  font-size: 17px; font-weight: 600; line-height: 1;
}
#gmAdminAddRow .gm-list-label { color: #07c160; font-weight: 500; }
/* 底部弹窗(iOS ActionSheet:白色选项卡+独立取消按钮) */
#gmReceiveSheet { align-items: flex-end; padding: 0; z-index: 220; }
.gm-sheet-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; background: transparent;
  animation: btpSlideUp .25s ease;
}
.gm-sheet-list { padding: 0; }
.gm-sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 16px; background: none; border: none;
  font: inherit; font-size: 15px; color: var(--text); text-align: left; cursor: pointer;
  transition: background .15s ease;
}
.gm-sheet-item + .gm-sheet-item { border-top: 1px solid var(--border); }
.gm-sheet-item:hover { background: var(--bg-soft); }
.gm-sheet-item .gm-list-label { flex: 1; text-align: center; }
.gm-sheet-check { color: #07c160; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.gm-sheet-cancel {
  width: 100%; padding: 15px; border: none; border-radius: 14px;
  background: var(--card); font: inherit; font-size: 16px; color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.gm-sheet-cancel:hover { background: var(--bg-soft); }

/* 白色分组卡片(iOS 设置组样式) */
.gm-sub .bot-card {
  background: var(--card); border: none; border-radius: 14px;
  padding: 16px; gap: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.gm-sub .bot-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.gm-card-desc { font-size: 12px; color: var(--muted); margin-top: -8px; line-height: 1.5; }

/* 表单行(统一规格:标签 + 输入框) */
.gm-sub .form-row,
#mutePeriodModal .form-row,
#bannedKeywordModal .form-row,
#groupRemarkModal .form-row,
#groupNameModal .form-row {
  display: flex; flex-direction: column; gap: 7px; flex-shrink: 0;
}
.gm-sub .form-row > label:not(.switch),
#mutePeriodModal .form-row > label,
#bannedKeywordModal .form-row > label,
#groupRemarkModal .form-row > label,
#groupNameModal .form-row > label {
  font-size: 13px; color: var(--text); font-weight: 500;
}
.gm-sub .form-row input[type="text"],
.gm-sub .form-row input[type="number"],
.gm-sub .form-row textarea,
.gm-sub .form-row input[type="time"],
#mutePeriodModal .form-row input,
#bannedKeywordModal .form-row input,
#groupRemarkModal .form-row input,
#groupNameModal .form-row input,
#gmWhitelistModal .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gm-sub .form-row input:focus,
.gm-sub .form-row textarea:focus,
#mutePeriodModal .form-row input:focus,
#bannedKeywordModal .form-row input:focus,
#groupRemarkModal .form-row input:focus,
#groupNameModal .form-row input:focus,
#gmWhitelistModal .form-row textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.gm-sub .form-row input::placeholder,
.gm-sub .form-row textarea::placeholder,
#mutePeriodModal .form-row input::placeholder,
#bannedKeywordModal .form-row input::placeholder,
#groupRemarkModal .form-row input::placeholder,
#groupNameModal .form-row input::placeholder,
#gmWhitelistModal .form-row textarea::placeholder { color: #94a3b8; }
/* 链接白名单:QQ 式固定高度输入区,无拖拽手柄 */
#gmWhitelistModal .form-row textarea {
  resize: none; min-height: 132px; line-height: 1.7; margin-bottom: 8px;
}
#gmWhitelistModal .form-row > label {
  font-size: 13px; color: var(--text); font-weight: 500;
}
#gmWhitelistModal .bot-qa-tip { margin-bottom: 0; }

/* 群资料字段编辑器(三级弹窗:群名/介绍/标签/地点)——弹窗无 .gm-sub 类,
   表单行纳入统一样式组(同 gmWhitelistModal 修复惯例,防默认样式裸奔) */
#gmFieldEditorModal .form-row {
  display: flex; flex-direction: column; gap: 7px; flex-shrink: 0;
}
#gmFieldEditorModal .form-row > label {
  font-size: 13px; color: var(--text); font-weight: 500;
}
#gmFieldEditorModal .form-row input[type="text"],
#gmFieldEditorModal .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#gmFieldEditorModal .form-row input:focus,
#gmFieldEditorModal .form-row textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
#gmFieldEditorModal .form-row input::placeholder,
#gmFieldEditorModal .form-row textarea::placeholder { color: #94a3b8; }
/* 群介绍( textarea 模式):对标 QQ 编辑页——标题即说明,隐藏行内 label,
   大输入区固定高度无拖拽手柄,计数器右下角 */
#gmFieldTextareaRow > label { display: none; }
#gmFieldEditorModal .form-row textarea {
  resize: none; min-height: 168px; line-height: 1.7;
}
#gmFieldEditorModal .bs-counter-field { align-self: flex-end; }
#gmFieldEditorModal .gm-footnote { margin-top: 10px; }

/* 开关行(微信设置行:左标签右开关) */
.gm-switch-row {
  flex-direction: row !important; align-items: center;
  justify-content: space-between; gap: 12px;
}
.gm-switch-row + .gm-switch-row { border-top: 1px solid var(--border); padding-top: 13px; }
.gm-switch-row > label:first-child { font-size: 13px; color: var(--text); font-weight: 500; }

/* 单选组(P2 式 iOS 列表行:白卡内 hairline 分隔 + 右置勾选,选中文字高亮) */
.gm-sub .gs-radio-group { display: flex; flex-direction: column; }
.gm-sub .gs-radio-group label {
  display: flex; align-items: center; padding: 13px 2px;
  font-size: 14px; color: var(--text); cursor: pointer; transition: var(--transition);
}
.gm-sub .gs-radio-group label + label { border-top: 1px solid var(--border); }
.gm-sub .gs-radio-group label:has(input:checked) span { color: var(--primary); font-weight: 600; }
.gm-sub .gs-radio-group input { margin-left: auto; accent-color: var(--primary); flex-shrink: 0; }

/* 保存按钮(QQ 式右对齐主操作) */
.gm-save-btn {
  width: auto; padding: 10px 32px; margin-top: 2px; align-self: flex-end;
  border-radius: 10px; font-size: 14px;
}
/* 卡片内次级按钮统一规格 */
.gm-sub .btn-secondary {
  width: auto; padding: 8px 16px; margin-top: 0; align-self: flex-start;
  border-radius: 9px; font-size: 13px;
}

/* iOS 列表单元格组(QQ 设置行:白卡内 hairline 分隔,整行可点) */
.gm-sub .bot-card.gm-celllist { padding: 0; gap: 0; }
.gm-celllist { display: flex; flex-direction: column; }
.gm-list-cell {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; background: none; border: none;
  font: inherit; text-align: left; cursor: pointer;
  transition: background .15s ease; flex-shrink: 0;
}
.gm-celllist > .gm-list-cell + .gm-list-cell,
.gm-celllist > .gm-list-cell + div,
.gm-celllist > div + .gm-list-cell,
.gm-celllist > div + div { border-top: 1px solid var(--border); }
button.gm-list-cell:hover { background: var(--bg-soft); }
.gm-list-label {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text);
  text-align: left; line-height: 1.4;
}
.gm-list-value {
  flex-shrink: 0; max-width: 46%; font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
.gm-list-cell input[type="radio"] { margin-left: auto; accent-color: var(--primary); flex-shrink: 0; }
.gm-list-cell:has(input[type="radio"]:checked) .gm-list-label { color: var(--primary); font-weight: 600; }
.gm-list-cell .switch { margin-left: auto; flex-shrink: 0; }
.gm-list-static { cursor: default; }
/* 邀请权限嵌套项(QQ:总开关下缩进的机器人/审核方式行) */
.gm-list-cell.gm-indent { padding-left: 32px; }
.gm-list-cell .gm-cell-arrow { flex-shrink: 0; font-size: 16px; color: var(--muted); line-height: 1; }
/* 审核方式手风琴面板(卡片内嵌展开区) */
.gm-review-collapse {
  margin: 0 12px 8px; border-radius: 10px; background: var(--bg-soft);
  border: 1px solid var(--border); overflow: hidden;
}
.gm-review-collapse > .gm-list-cell + .gm-list-cell { border-top: 1px solid var(--border); }
.gm-sub-cell { padding-left: 32px; }
.gm-list-value.gm-avatar-cell { max-width: none; }
.gm-list-value.gm-avatar-cell .gs-avatar {
  width: 36px; height: 36px; font-size: 13px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
/* 小尺寸群头像(管理群列表行/数据页):角标等比缩小防溢出 */
.gm-list-value.gm-avatar-cell .gs-avatar .gav-badge,
.gm-stats-head .gs-avatar .gav-badge {
  right: -3px; bottom: -3px; font-size: 8px; padding: 1.5px 2.5px; border-radius: 3px;
}

/* 群封面(QQ 式头图:换封面按钮悬浮右下) */
.gm-cover {
  position: relative; aspect-ratio: 16 / 6; min-height: 120px; max-height: 168px;
  border-radius: 14px; overflow: hidden; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gm-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.gm-cover-placeholder { font-size: 13px; color: var(--muted); }
.gm-cover-btn {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: none; border-radius: 16px;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: 12px;
  cursor: pointer; backdrop-filter: blur(6px); transition: background .15s ease;
}
.gm-cover-btn:hover { background: rgba(15, 23, 42, .72); }

/* 群头像行 */
.gm-avatar-row { display: flex; align-items: center; gap: 14px; }
.gm-avatar-row .gs-avatar {
  width: 52px; height: 52px; font-size: 18px; border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}
.gm-avatar-row .btn-secondary {
  width: auto; padding: 7px 16px; margin-top: 0; border-radius: 9px; font-size: 13px;
}

/* 标签 */
.gm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.gm-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 6px 4px 12px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 14px;
  font-size: 12px; color: var(--text);
}
.gm-tag-x {
  border: none; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 11px; width: 17px; height: 17px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.gm-tag-x:hover { color: #fff; background: var(--danger); }

/* 群分类(QQ 式彩色图标 4 列网格) */
.gm-cat-group { display: flex; flex-direction: column; }
.gm-cat-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.gm-cat-subs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.gm-cat-sub {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 6px 2px; border: none; background: transparent; border-radius: 10px;
  font-size: 11px; color: var(--text); cursor: pointer;
  transition: var(--transition); font-weight: 500; line-height: 1.3;
}
.gm-cat-sub > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-cat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.gm-ci-blue { background: #e8efff; color: #4f7cff; }
.gm-ci-orange { background: #fff1e6; color: #ff8c42; }
.gm-ci-green { background: #e6f7ee; color: #2fbf6a; }
.gm-cat-sub:hover .gm-cat-icon { transform: translateY(-1px); }
.gm-cat-sub.active .gm-cat-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, .35);
}
.gm-cat-sub.active { color: var(--primary); font-weight: 600; }

/* 加群管理(P2 式:验证方式子分组,透明容器) */
.gm-verify-detail { display: flex; flex-direction: column; gap: 14px; }
.gm-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; }

/* 成员数据(iOS 分段控件 + 白色统计卡) */
.gm-period-tabs, .gm-period-seg {
  display: inline-flex; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; align-self: center;
}
.gm-period-tab {
  padding: 6px 22px; border-radius: 8px; border: none;
  background: transparent; font-size: 12px; color: var(--muted);
  cursor: pointer; font-weight: 500; transition: var(--transition);
}
.gm-period-tab.active { background: var(--primary); color: #fff; }
.gm-stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.gm-stat-card {
  background: var(--bg-soft); border-radius: 10px; padding: 12px 6px; text-align: center;
}
.gm-stat-num { font-size: 22px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.gm-stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.gm-chart { width: 100%; height: 150px; padding: 10px 8px 6px; }
.gm-chart svg { width: 100%; height: 100%; }

/* 群数据(QQ 式:群头部 + 时间分段 + 双 Tab) */
.gm-stats-head { display: flex; align-items: center; gap: 12px; padding: 0 2px; }
.gm-stats-head .gs-avatar {
  width: 44px; height: 44px; font-size: 16px; border-radius: 12px; flex-shrink: 0;
}
.gm-stats-name {
  font-size: 16px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gm-stats-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gm-stats-updated { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.gm-stats-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 3px;
}
.gm-stats-tab {
  padding: 7px 0; border-radius: 8px; border: none; background: transparent;
  font-size: 13px; color: var(--muted); font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.gm-stats-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.gm-stats-pane { display: flex; flex-direction: column; gap: 14px; }
.gm-chart-title { font-size: 14px; font-weight: 600; color: var(--text); }
.gm-chart-total {
  font-size: 24px; font-weight: 700; color: var(--text); margin-top: 6px;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.gm-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gm-view-all {
  border: none; background: none; padding: 0; font-size: 12px;
  color: var(--primary); cursor: pointer; font-weight: 500;
}
.gm-view-all:hover { opacity: .75; }
.gm-chart-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px;
  font-size: 11px; color: var(--muted); padding: 6px 8px 0;
}
.lg-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 3px;
  margin-right: 4px; vertical-align: middle;
}
.lg-pink { background: #ec4899; }
.lg-orange { background: #f59e0b; }
.lg-purple { background: #8b5cf6; }
.lg-blue { background: #38bdf8; }
.lg-green { background: #22c55e; }

/* 发言排行(头像 + 连续活跃天数 + 右侧条数,前三名奖牌配色) */
.gm-rank-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.gm-rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; }
.gm-rank-item:hover { background: var(--bg-soft); }
.gm-rank-no {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0;
  border-radius: 7px; background: var(--bg-soft);
}
.gm-rank-item:nth-child(1) .gm-rank-no { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.gm-rank-item:nth-child(2) .gm-rank-no { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.gm-rank-item:nth-child(3) .gm-rank-no { background: linear-gradient(135deg, #fdba74, #fb923c); color: #fff; }
.gm-rank-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.gm-rank-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gm-rank-item .gm-rank-name { flex: 0 0 auto; font-size: 13px; }
.gm-rank-sub { font-size: 11px; color: var(--muted); }
.gm-rank-count {
  font-size: 14px; font-weight: 700; color: var(--text); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.gm-rank-count i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 2px; font-weight: 400; }
.gm-rank-name { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-rank-meta { font-size: 11px; color: var(--muted); flex-shrink: 0; }

/* 勾选行(黑名单批量/禁言成员列表共用) */
.gm-check-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 9px; cursor: pointer; transition: background .15s ease;
}
.gm-check-item:hover { background: var(--bg-soft); }
.gm-check-item input { accent-color: var(--primary); flex-shrink: 0; }
.gm-check-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; font-weight: 600;
}
.gm-check-name { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-check-sub { font-size: 11px; color: var(--muted); }

/* 黑名单 */
.bl-header-actions { display: flex; align-items: center; gap: 10px; }
/* 黑名单批量管理按钮/操作条(复用 gm-batch 系列类名) */
.gm-batch-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--primary);
  font-size: 12px; padding: 5px 14px; border-radius: 8px; cursor: pointer;
  font-weight: 500; transition: var(--transition);
}
.gm-batch-btn:hover { border-color: var(--primary); background: rgba(79, 70, 229, .05); }
.gm-batch-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(79, 70, 229, .06); border: 1px solid rgba(79, 70, 229, .22);
  border-radius: 10px; margin-bottom: 10px; font-size: 13px;
}
.gm-batch-bar span { flex: 1; color: var(--text); }
.gm-batch-bar .btn-primary, .gm-batch-bar .btn-secondary {
  width: auto; padding: 6px 14px; margin-top: 0; font-size: 12px; border-radius: 8px;
}
.gm-blacklist-tip {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  background: var(--bg-soft); border-radius: 8px; padding: 10px 12px;
}
.bl-banner {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  background: var(--bg-soft); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 12px;
}
.bl-body-wrap { position: relative; display: flex; gap: 4px; }
.bl-grouped-list { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bl-group { display: flex; flex-direction: column; }
.bl-group + .bl-group { margin-top: 4px; }
.bl-group-head {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 8px 12px 4px; position: sticky; top: 0; background: var(--card);
  z-index: 1; border-radius: 8px;
}
.bl-group .gm-check-item { border-radius: 9px; }
.bl-item { padding: 10px 12px; }
.bl-item .gm-check-sub { flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-alpha-index {
  position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1px; padding: 4px 2px; z-index: 2;
}
.bl-alpha-index button {
  border: none; background: none; padding: 1px 4px; font-size: 10px;
  color: var(--muted); cursor: pointer; line-height: 1.2; font-weight: 500;
}
.bl-alpha-index button:hover { color: var(--primary); font-weight: 700; }

/* 禁言成员挑选候选(复用特别关注弹窗) */
.gm-mute-cand { cursor: pointer; }
.gm-mute-cand:hover { background: var(--bg-soft); }

/* 管理群入口行强调 */
.gs-manage-row .gs-manage-hint { font-size: 12px; color: var(--muted); }

/* 发言管理 */
.gm-desc-banner {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  background: var(--bg-soft); border-radius: 10px; padding: 10px 12px;
}
.gm-preview-card {
  background: var(--bg-soft); border: none; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.gm-preview-main { display: flex; flex-direction: column; gap: 8px; }
.gm-preview-sys { text-align: center; font-size: 11px; color: var(--muted); }
.gm-preview-bubble {
  max-width: 88%; align-self: flex-start;
  background: #fff; border-radius: 4px 12px 12px 12px;
  padding: 9px 12px; font-size: 13px; color: var(--text); line-height: 1.5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.gm-mute-periods {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--bg-soft); border-radius: 10px;
}
.gm-period-list { display: flex; flex-direction: column; }
.gm-period-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  background: transparent; border: none;
  font-size: 13px; color: var(--text);
}
.gm-period-list .gm-period-item + .gm-period-item { border-top: 1px solid var(--border); }
.gm-period-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gm-period-main b { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.gm-period-main i { font-style: normal; font-size: 11px; color: var(--muted); }
.gm-period-item.off .gm-period-main b,
.gm-period-item.off .gm-period-main i { color: var(--muted); }
.gm-period-del {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; width: 22px; height: 22px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.gm-period-del:hover { color: #fff; background: var(--danger); }
.gm-add-link {
  width: 100%; border: none; background: none; padding: 11px 16px;
  font-size: 13px; color: var(--primary); font-weight: 500;
  cursor: pointer; text-align: left; transition: background .15s ease;
}
.gm-add-link:hover { background: var(--bg-soft); }
.gm-period-item span { flex: 1; }
.gm-add-period { width: auto; padding: 8px 16px; margin-top: 0; align-self: flex-start; }
.gm-muted-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.gm-muted-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--bg-soft); border-radius: 9px; font-size: 13px;
}
.gm-muted-item .gm-check-name { flex: 1; }
.gm-muted-until { font-size: 11px; color: var(--muted); }
.gm-banned-summary { font-size: 13px; color: var(--text); }

/* 查找聊天记录:已迁移至聊天面板微信风格页(chs-*,见阶段6样式) */

/* 移动端 */
@media (max-width: 640px) {
  .gm-card.lg { max-width: 100%; }
  .modal-card.gm-sub { max-width: 100%; }
  .gm-body { padding: 12px; }
  .gm-cell { padding: 13px 14px; }
  .gm-cell-label { font-size: 14px; }
  .gm-sub .bot-card { padding: 13px; gap: 12px; }
  .gm-sub .bot-card.gm-celllist { padding: 0; }
  .gm-list-cell { padding: 11px 14px; }
  .gm-sub-cell { padding-left: 28px; }
  .gm-cat-subs { grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
  .gm-cat-icon { width: 40px; height: 40px; border-radius: 11px; }
  .gm-cover { min-height: 96px; }
  .gm-stat-cards { grid-template-columns: repeat(3, 1fr); }
  .gm-stats-bar { flex-wrap: wrap; }
  .gm-save-btn { align-self: stretch; }
  .gm-list-value { max-width: 42%; }
}

/* ============================================================
   QQ 数据中心：NapCat + 自研业务层, 不嵌入或暴露 NapCat WebUI
   ============================================================ */
.qq-wrap { max-width: 1280px; margin: 0 auto; padding: 26px 20px 42px; }
.qq-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 0 0 18px; }
.qq-eyebrow { margin: 0 0 7px; color: #7c3aed; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.qq-hero h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.qq-hero p:not(.qq-eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 620px; }
.qq-hero-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.qq-status { border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.qq-status.is-online { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
/* 被其他用户挤下线: 琥珀色区别于普通的"等待连接"(灰)与正常在线(绿), 提示这是可恢复的中断 */
.qq-status.is-kicked { border-color: #fcd34d; background: #fffbeb; color: #b45309; }
/* 退出登录(NapCat 上的 QQ 登录): 红色描边按钮, 仅 QQ 处于登录态时显示 */
.qq-logout-btn {
  border: 1px solid #fecaca; background: #fff; color: #dc2626;
  border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .15s ease, transform .15s ease;
}
.qq-logout-btn:hover { background: #fef2f2; }
.qq-logout-btn:active { transform: scale(.97); }
.qq-logout-btn:disabled { opacity: .55; cursor: default; }

/* 绑定卡片 — 大厂标准两栏布局(说明 + 扫码) */
.qq-setup { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.35fr); gap: 24px 36px; padding: 24px; margin-bottom: 18px; }
.qq-setup.is-bound { opacity: .88; }
.qq-setup.is-online { display: none; }
/* 注意: 功能亮点与安全标识在任何可见状态下都保留。
   之前用 .is-bound 隐藏它们, 会导致页面先渲染静态 HTML、overview 返回后又隐藏,
   出现"闪一下就消失"。状态差异改由文案体现。 */
/* 左栏:标题 + 描述 + 功能亮点 + 安全标识 */
.qq-setup-copy h3, .qq-panel-title h3 { margin: 0; font-size: 16px; }
.qq-setup-copy p { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.qq-setup-points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.qq-setup-points li { display: flex; gap: 12px; align-items: flex-start; }
.qq-setup-points .pt-ico { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: linear-gradient(135deg, #f1eefc, #e9f0ff); display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: inset 0 0 0 1px rgba(124,92,240,.08); }
.qq-setup-points strong { font-size: 12.5px; display: block; color: var(--text); }
.qq-setup-points small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; line-height: 1.55; }
/* 安全/隐私标识(浏览器内不接触凭据等) */
.qq-trust { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.qq-trust-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #f5f7ff; color: #4338ca; font-size: 11px; font-weight: 600; line-height: 1.4; }
.qq-trust-tag .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.qq-trust-tag .dot-ok { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
/* 右栏:扫码登录(唯一绑定方式) */
.qq-setup-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.qq-qr-panel { background: linear-gradient(180deg, #fafbff 0%, #f5f6fc 100%); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.qq-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qq-section-title { display: flex; align-items: center; gap: 9px; }
.qq-section-name { font-size: 14px; font-weight: 700; color: var(--text); }
/* 刷新二维码按钮(顶部右上角) */
.qq-refresh-qr { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; height: 28px; padding: 0 10px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.qq-refresh-qr:hover:not(:disabled) { color: #6d28d9; border-color: #c4b5fd; background: #faf9ff; }
.qq-refresh-qr:disabled { opacity: .55; cursor: wait; }
.qq-refresh-qr svg { transition: transform .5s ease; }
.qq-refresh-qr.is-loading svg { animation: qqQrSpin 1s linear infinite; }
@keyframes qqQrSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* 二维码舞台:QR + 倒计时(倒计时放在二维码下方, 不遮挡码面影响识别) */
.qq-qr-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qq-qr-box { width: 200px; height: 200px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e5e7f0; border-radius: 16px; padding: 10px; box-shadow: 0 6px 18px rgba(28,25,57,.08); position: relative; overflow: hidden; }
.qq-qr-box canvas, .qq-qr-box img { display: block; border-radius: 8px; width: 100%; height: 100%; }
.qq-qr-box::after { content: ''; position: absolute; inset: 0; border-radius: 16px; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(124,58,237,.06); }
/* 倒计时(二维码下方, 不覆盖码面) */
.qq-qr-countdown { display: inline-flex; align-items: center; gap: 4px; background: #f3f4f6; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 999px; line-height: 1.4; border: 1px solid var(--border); }
.qq-qr-countdown strong { color: #6d28d9; font-weight: 700; font-variant-numeric: tabular-nums; }
.qq-qr-countdown.is-warn { background: #fff7ed; border-color: #fed7aa; color: #b45309; }
.qq-qr-countdown.is-warn strong { color: #b45309; }
.qq-qr-countdown.is-danger { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.qq-qr-countdown.is-danger strong { color: #dc2626; }
/* 二维码图(代理直出) */
.qq-qr-img { width: 100%; height: 100%; object-fit: contain; }
/* 触发重新扫码的行动按钮(通道已登录但当前账号未绑定 / 已被他人绑定) */
.qq-qr-cta { margin-top: 8px; min-height: 32px; padding: 0 14px; font-size: 12px; }
/* 从功能预览卡跳转过来时短暂高亮二维码, 指引视线落点 */
.qq-qr-box { transition: border-color .25s ease, box-shadow .25s ease; }
.qq-qr-box.is-highlight { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124,58,237,.16), 0 6px 18px rgba(28,25,57,.08); }
/* 二维码不可用时的中性占位 */
.qq-qr-off { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 10px; }
.qq-qr-off-icon { font-size: 30px; opacity: .8; line-height: 1.2; }
.qq-qr-off-title { margin: 5px 0 0; font-size: 12.5px; font-weight: 700; color: var(--text); }
.qq-qr-off-sub { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.55; max-width: 160px; }
/* 警示态(通道被他人占用 / 我的 QQ 被挤下线): 说明较长且带动作按钮,
   放宽二维码框尺寸, 避免文案被挤成窄条难以阅读。 */
.qq-qr-box:has(.qq-qr-off.is-warn) { width: 100%; max-width: 360px; height: auto; min-height: 200px; padding: 16px; }
.qq-qr-off.is-warn { gap: 6px; }
.qq-qr-off.is-warn .qq-qr-off-icon { font-size: 26px; }
.qq-qr-off.is-warn .qq-qr-off-title { color: #b45309; font-size: 13px; }
.qq-qr-off.is-warn .qq-qr-off-sub { max-width: 300px; font-size: 11.5px; }
.qq-qr-off.is-warn .qq-qr-off-sub strong { color: #b45309; font-weight: 700; }
/* 状态 + 步骤 + 提示(右栏文字区) */
.qq-qr-meta { display: grid; gap: 10px; }
.qq-qr-status { margin: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.qq-qr-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(0,0,0,.04); animation: qqPulse 1.8s ease-in-out infinite; }
.qq-qr-status.is-wait { color: #b45309; }
.qq-qr-status.is-ok { color: #047857; }
.qq-qr-status.is-ok::before { background: #10b981; animation: none; }
.qq-qr-status.is-err { color: #dc2626; }
.qq-qr-status.is-idle { color: var(--muted); }
.qq-qr-status.is-idle::before { background: var(--muted); animation: none; }
.qq-qr-steps { margin: 4px 0 0; padding: 0 0 0 18px; color: var(--text); font-size: 12px; line-height: 1.85; }
.qq-qr-steps li { padding-left: 2px; }
.qq-qr-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; padding: 8px 10px; background: rgba(124,58,237,.04); border-radius: 8px; border-left: 2px solid #c4b5fd; }
.qq-primary, .qq-secondary { border: 1px solid #7c3aed; border-radius: 9px; min-height: 38px; padding: 0 16px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: .18s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.qq-primary { background: #7c3aed; color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,.18); }
.qq-primary:hover:not(:disabled) { background: #6d28d9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.28); }
.qq-primary:disabled, .qq-secondary:disabled { opacity: .55; cursor: wait; box-shadow: none; transform: none; }
/* 未绑定:功能预览区(替代真实数据面板) */
.qq-preview { margin-bottom: 18px; }
.qq-preview-head { margin: 0 0 14px; }
.qq-preview-head h3 { margin: 0; font-size: 15px; }
.qq-preview-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.qq-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.qq-preview-card { -webkit-appearance: none; appearance: none; font: inherit; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px 18px 18px; cursor: pointer; display: grid; justify-items: center; gap: 8px; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.qq-preview-card:hover { border-color: #c4b5fd; box-shadow: 0 8px 22px rgba(124, 58, 237, .1); transform: translateY(-2px); }
.qq-preview-card strong { font-size: 13.5px; }
.qq-preview-card > p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.qp-ico { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 21px; }
.qp-ico-dash { background: #ede9fe; }
.qp-ico-chat { background: #e0f2fe; }
.qp-ico-file { background: #fef3c7; }
.qp-ico-album { background: #fce7f3; }
.qp-ico-alert { background: #fee2e2; }
.qp-lock { margin-top: 4px; font-size: 10.5px; font-weight: 700; color: #7c3aed; background: #f5f3ff; border: 1px solid #ddd6fe; padding: 3px 10px; border-radius: 999px; }

.qq-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qq-setup:not(.is-bound) .qq-actions { display: none; } /* 未绑定时不显示"同步群与好友"这类无关操作 */
.qq-secondary { border-color: var(--border); background: #fff; color: var(--text); }
.qq-secondary:hover { border-color: #8b5cf6; color: #6d28d9; }
.qq-hint { margin: 0; }

/* 板块 Tab(iOS 分段控件风格) */
.qq-tabs-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.qq-tabs-row .qq-tabs { margin-bottom: 0; flex: 1; }
.qq-tabs { display: flex; gap: 4px; background: #f1eefc; border-radius: 12px; padding: 4px; margin-bottom: 18px; overflow-x: auto; }
.qq-tab { flex: 1; border: 0; background: transparent; border-radius: 9px; min-height: 34px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: .18s ease; }
.qq-tab:hover { color: var(--text); }
.qq-tab.active { background: #fff; color: #6d28d9; box-shadow: 0 1px 4px rgba(28,25,57,.10); }
.qq-tabpane { display: none; animation: qqFade .22s ease; }
.qq-tabpane.active { display: block; }
@keyframes qqFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 面板通用 */
.qq-panel { overflow: hidden; min-height: 200px; }
.qq-panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding: 15px 16px; flex-wrap: wrap; }
.qq-panel-title span { color: var(--muted); font-size: 11px; }
.qq-mini-btn { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; min-height: 28px; padding: 0 10px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.qq-mini-btn:hover { border-color: #8b5cf6; color: #6d28d9; }
.qq-mini-btn.danger { color: #dc2626; }
.qq-mini-btn.danger:hover { border-color: #dc2626; }
.qq-empty { color: var(--muted); font-size: 12px; line-height: 1.6; padding: 22px 16px; text-align: center; }

/* ① 大盘 */
.qq-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.qq-stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; }
.qq-stat-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.qq-stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.qq-dash-grid { display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 1fr); gap: 18px; margin-bottom: 18px; }
.qq-dash-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.qq-trend-chart { padding: 12px 10px 6px; }
.qq-trend-chart svg { width: 100%; height: auto; display: block; }
.qq-trend-line { fill: none; stroke: #7c3aed; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.qq-trend-area { fill: rgba(124,58,237,.09); }
.qq-trend-bar { stroke: rgba(124,58,237,.18); stroke-width: 14; stroke-linecap: round; }
.qq-trend-label { fill: var(--muted); font-size: 10px; }
.qq-trend-num { fill: #6d28d9; font-size: 10px; font-weight: 700; }
.qq-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.qq-live-dot.on { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.15); animation: qqPulse 1.6s infinite; }
.qq-live-dot.is-kicked { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
@keyframes qqPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,.18); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,.05); } }
.qq-live-feed { max-height: 300px; overflow: auto; }
.qq-live-item { padding: 10px 16px; border-bottom: 1px solid var(--border); animation: qqFade .25s ease; }
.qq-live-item .qq-live-conv { display: inline-block; margin-right: 6px; background: #ede9fe; color: #6d28d9; border-radius: 6px; padding: 1px 7px; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.qq-live-item strong { font-size: 12px; }
.qq-live-item p { margin: 5px 0 0; font-size: 12px; color: var(--text); line-height: 1.5; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qq-live-item time { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.qq-top-list { max-height: 320px; overflow: auto; }
.qq-top-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.qq-top-rank { font-size: 15px; min-width: 22px; text-align: center; }
.qq-top-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #ede9fe; color: #6d28d9; font-size: 12px; font-weight: 800; }
.qq-top-main { flex: 1; min-width: 0; }
.qq-top-main strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-top-main small { color: var(--muted); font-size: 10px; }
.qq-top-count { color: #6d28d9; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* 告警条目(大盘/规则页共用) */
.qq-alert-list { max-height: 360px; overflow: auto; }
.qq-alert-item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); position: relative; transition: background .15s ease; }
.qq-alert-item:hover { background: #faf9ff; }
.qq-alert-item.unread { background: #fdf6ff; }
.qq-alert-item.unread::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #8b5cf6; }
.qq-alert-level { flex: 0 0 auto; align-self: flex-start; border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 800; }
.qq-alert-level.lv-info { background: #e0f2fe; color: #0369a1; }
.qq-alert-level.lv-warn { background: #fef3c7; color: #b45309; }
.qq-alert-level.lv-critical { background: #fee2e2; color: #b91c1c; }
.qq-alert-main { flex: 1; min-width: 0; }
.qq-alert-main header { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.qq-alert-main header strong { font-size: 12px; }
.qq-alert-main header span { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-alert-main header time { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.qq-alert-main p { margin: 4px 0 0; font-size: 12px; color: var(--text); line-height: 1.5; word-break: break-word; }
.qq-alert-fresh { flex: 0 0 auto; align-self: flex-start; font-size: 9px; font-weight: 800; color: #7c3aed; background: #ede9fe; border-radius: 999px; padding: 1px 6px; letter-spacing: .04em; }

/* 级别筛选 chips + 未读徽标 */
.qq-alert-filters { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.qq-chip { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.qq-chip:hover { border-color: #c4b5fd; color: #6d28d9; }
.qq-chip.active { background: #f3efff; border-color: #8b5cf6; color: #6d28d9; }
.qq-chip .cnt { margin-left: 3px; font-weight: 800; opacity: .75; }
.qq-unread-badge { display: inline-block; vertical-align: 2px; margin-left: 6px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 7px; line-height: 1.5; }

/* 富空状态 */
.qq-empty-rich { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 16px; text-align: center; }
.qq-empty-rich .qq-empty-icon { font-size: 26px; opacity: .8; }
.qq-empty-rich p { font-size: 12px; font-weight: 700; color: var(--text); margin: 0; }
.qq-empty-rich small { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ② 聊天记录 */
.qq-chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.qq-side { position: sticky; top: 12px; }
.qq-conv-search { padding: 10px 12px 0; }
.qq-conv-search input, .qq-chat-tools input, .qq-rule-form input, .qq-toolbar select, .qq-rule-form select { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); padding: 0 10px; outline: none; font: inherit; font-size: 12px; }
.qq-conv-search input:focus, .qq-chat-tools input:focus, .qq-rule-form input:focus, .qq-toolbar select:focus, .qq-rule-form select:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.qq-conversation-list { display: flex; flex-direction: column; max-height: 560px; overflow: auto; }
.qq-conversation { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 11px 12px; text-align: left; color: var(--text); cursor: pointer; }
.qq-conversation:hover, .qq-conversation.active { background: #f7f5ff; }
.qq-conversation-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #ede9fe; color: #6d28d9; font-size: 12px; font-weight: 800; }
.qq-conversation strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.qq-conversation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; color: var(--muted); font-size: 10px; }
.qq-conversation time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.qq-chat-tools { display: flex; gap: 8px; align-items: center; }
.qq-chat-tools input { width: 180px; }
.qq-message-list { max-height: 560px; overflow: auto; padding: 5px 16px 12px; }
.qq-message { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--border); }
.qq-message.is-recalled { background: linear-gradient(90deg, rgba(220,38,38,.05), transparent); margin: 0 -16px; padding: 13px 16px; }
.qq-message header { display: flex; align-items: baseline; gap: 7px; min-width: 0; flex-wrap: wrap; }
.qq-message header strong { font-size: 12px; }
.qq-message header span, .qq-message header time { color: var(--muted); font-size: 10px; }
.qq-message header time { margin-left: auto; white-space: nowrap; }
.qq-recall-tag { font-style: normal; font-size: 10px; font-weight: 800; color: #dc2626; background: #fee2e2; border-radius: 6px; padding: 2px 7px; }
.qq-message.is-recalled p { color: #9f1239; text-decoration: line-through; text-decoration-color: rgba(159,18,57,.4); }
.qq-message p { margin: 6px 0 0; color: var(--text); font-size: 13px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.qq-msg-assets { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.qq-asset-chip { border: 1px solid var(--border); background: #fafafd; border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 11px; color: var(--text); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-asset-chip:hover { border-color: #8b5cf6; color: #6d28d9; }
.qq-asset-chip:disabled { opacity: .55; cursor: not-allowed; }
.qq-asset-chip.is-failed { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.qq-asset-chip.is-failed:hover { border-color: #ef4444; color: #991b1b; }
.qq-load-more { display: flex; justify-content: center; padding: 12px; }

/* ③④ 工具栏(文件/相册) */
.qq-toolbar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 18px; flex-wrap: wrap; }
.qq-toolbar-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.qq-toolbar-field select { width: auto; min-width: 200px; }
.qq-breadcrumb { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; font-size: 12px; }
.qq-crumb { border: 0; background: transparent; color: #6d28d9; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 4px; white-space: nowrap; }
.qq-crumb:hover { text-decoration: underline; }
.qq-crumb-sep { color: var(--muted); }
.qq-toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.qq-file-list { max-height: 480px; overflow: auto; }
.qq-file-row { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 11px 16px; text-align: left; color: var(--text); }
button.qq-file-row { cursor: pointer; }
button.qq-file-row:hover { background: #f7f5ff; }
.qq-file-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #f1eefc; color: #6d28d9; font-size: 9px; font-weight: 800; overflow: hidden; }
.qq-file-icon.dir { font-size: 16px; }
.qq-file-main { min-width: 0; }
.qq-file-main strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-file-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-file-chev { color: var(--muted); font-size: 16px; }
.qq-tasks-panel { margin-top: 18px; }
.qq-task-list { max-height: 380px; overflow: auto; }
.qq-task { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.qq-task header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qq-task header strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-task-status { flex: 0 0 auto; border-radius: 6px; padding: 2px 8px; font-size: 10px; font-weight: 800; }
.qq-task-status.st-running { background: #e0f2fe; color: #0369a1; }
.qq-task-status.st-completed { background: #ecfdf5; color: #047857; }
.qq-task-status.st-failed { background: #fee2e2; color: #b91c1c; }
.qq-task-status.st-cancelled { background: #f3f4f6; color: #6b7280; }
.qq-task-bar { height: 6px; border-radius: 999px; background: #f1eefc; margin: 10px 0 8px; overflow: hidden; }
.qq-task-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8b5cf6, #7c3aed); transition: width .4s ease; }
.qq-task footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qq-task footer small { color: var(--muted); font-size: 10px; }
.qq-task-actions { display: flex; gap: 6px; }
.qq-task-err { margin: 7px 0 0; color: #b91c1c; font-size: 11px; word-break: break-word; }

/* ④ 相册 */
.qq-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 16px; }
.qq-album-card { display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 10px; text-align: left; cursor: pointer; transition: .18s ease; color: var(--text); }
.qq-album-card:hover { border-color: #8b5cf6; box-shadow: 0 4px 14px rgba(28,25,57,.08); transform: translateY(-2px); }
.qq-album-cover { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 9px; background: #f1eefc; overflow: hidden; color: #6d28d9; font-size: 26px; }
.qq-album-cover img { width: 100%; height: 100%; object-fit: cover; }
.qq-album-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-album-card small { color: var(--muted); font-size: 10px; }
.qq-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 16px; }
.qq-photo-cell { display: block; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #f1eefc; }
.qq-photo-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.qq-photo-cell:hover img { transform: scale(1.05); }

/* ⑤ 告警规则 */
.qq-alerts-layout { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(340px, 1.1fr); gap: 18px; align-items: start; }
.qq-rule-form { display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.qq-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qq-field-label { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.qq-field-keyword { flex: 1 1 100%; }
.qq-rule-form .qq-field:not(.qq-field-keyword) { flex: 1 1 130px; max-width: 170px; }
.qq-rule-submit { flex: 1 1 100%; height: 36px; margin-top: 2px; }
.qq-rule-form select { width: 100%; }
.qq-rule-list, #qqPaneAlerts .qq-hint { padding: 0 16px; }
#qqPaneAlerts .qq-hint { padding-top: 12px; padding-bottom: 4px; }
.qq-rule { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.qq-rule:last-child { border-bottom: 0; }
.qq-rule.off { opacity: .55; }
.qq-rule-main { flex: 1; min-width: 0; }
.qq-rule-main header { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.qq-rule-main strong { font-size: 13px; word-break: break-all; }
.qq-rule-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.qq-rule-hit { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: #6d28d9; background: #f3efff; border-radius: 999px; padding: 1px 7px; }
.qq-rule-actions { display: flex; align-items: center; gap: 8px; }
.qq-switch { position: relative; display: inline-block; }
.qq-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.qq-switch i { display: block; width: 40px; height: 23px; border-radius: 999px; background: #e5e7eb; transition: .18s ease; position: relative; }
.qq-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .18s ease; }
.qq-switch input:checked + i { background: #7c3aed; }
.qq-switch input:checked + i::after { transform: translateX(17px); }

/* 响应式 */
@media (max-width: 1080px) {
  .qq-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .qq-dash-grid, .qq-dash-grid2, .qq-alerts-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .qq-chat-layout { grid-template-columns: 1fr; }
  .qq-side { position: static; }
  .qq-conversation-list { max-height: 260px; }
  .qq-setup { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .qq-setup-body { grid-template-columns: 1fr; gap: 14px; }
  .qq-qr-panel { padding: 14px; }
}
@media (max-width: 640px) {
  .qq-wrap { padding: 18px 12px 28px; }
  .qq-tabs-row { flex-wrap: wrap; }
  .qq-tabs-row .qq-tabs { flex-basis: 100%; }
  .qq-hero { flex-direction: column; gap: 12px; }
  .qq-setup { display: flex; flex-direction: column; padding: 14px; }
  .qq-setup-body { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .qq-qr-panel { padding: 14px; }
  .qq-qr-box { width: 180px; height: 180px; }
  /* 警示态在窄屏撑满可用宽度, 长文案才不会挤成细条 */
  .qq-qr-box:has(.qq-qr-off.is-warn) { width: 100%; max-width: none; }
  .qq-trust { gap: 4px; }
  .qq-trust-tag { font-size: 10.5px; padding: 3px 8px; }
  .qq-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .qq-rule-form .qq-field:not(.qq-field-keyword) { flex: 1 1 calc(50% - 5px); max-width: none; }
  .qq-alert-list { max-height: 300px; }
  .qq-toolbar-field select { min-width: 140px; }
  .qq-chat-tools { width: 100%; }
  .qq-chat-tools input { flex: 1; width: auto; }
}

/* ============ 内嵌播放器 MediaPlayer(基于 Video.js) ============ */
.mp-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  margin: 4px 0 18px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.mp-panel[hidden] { display: none; }
.mp-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.mp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mp-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mp-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 3px 8px; border-radius: 999px; letter-spacing: .5px;
}
.mp-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mp-actions button {
  width: 30px; height: 30px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--bg-soft); color: var(--muted); font-size: 14px; transition: var(--transition);
}
.mp-actions button:hover { background: var(--primary); color: #fff; }

/* 舞台:16:9 自适应,限高防长屏 */
.mp-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 68vh; background: #000; border-radius: 10px; overflow: hidden; }
.mp-stage .video-js { width: 100%; height: 100%; }
.mp-stage .video-js video { object-fit: contain; }
.mp-stage[data-fit="cover"] .video-js video { object-fit: cover; }
.mp-stage[data-fit="fill"] .video-js video { object-fit: fill; }

/* 播放列表 */
.mp-playlist { display: flex; flex-direction: column; min-height: 0; background: var(--bg-soft); border-radius: 10px; overflow: hidden; }
.mp-pl-head { padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.mp-pl-count { font-size: 11px; font-weight: 500; color: var(--muted); }
.mp-pl-list { flex: 1; min-height: 0; overflow-y: auto; }
.mp-pl-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer;
  font-size: 12px; color: var(--text); border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.mp-pl-item:hover { background: rgba(99, 102, 241, .08); }
.mp-pl-item.active { background: rgba(99, 102, 241, .14); }
.mp-pl-item.active .mp-pl-num { color: var(--primary); }
.mp-pl-num { flex-shrink: 0; width: 18px; text-align: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-pl-info { min-width: 0; }
.mp-pl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-pl-sub { font-size: 10px; color: var(--muted); }
.mp-pl-foot { padding: 8px 12px; border-top: 1px solid var(--border); }
.mp-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; user-select: none; }
.mp-switch input { accent-color: var(--primary); }

/* 设置浮层 */
.mp-settings {
  position: absolute; z-index: 30; top: 54px; right: 16px; width: min(360px, 92%);
  max-height: calc(100% - 70px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .22);
}
.mp-settings[hidden] { display: none; }
.mp-settings-head {
  position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; font-size: 13px; font-weight: 700; color: var(--text);
  background: var(--card); border-bottom: 1px solid var(--border);
}
.mp-settings-head button { border: none; background: var(--bg-soft); color: var(--muted); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; }
.mp-settings-head button:hover { background: var(--danger); color: #fff; }
.mp-settings-body { padding: 6px 14px 14px; }
.mp-set-group { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.mp-set-group:last-child { border-bottom: none; }
.mp-set-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mp-radio-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-radio-row label {
  position: relative; font-size: 12px; color: var(--text); cursor: pointer;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; transition: var(--transition);
}
.mp-radio-row label:has(input:checked) { border-color: var(--primary); background: rgba(99, 102, 241, .1); color: var(--primary); font-weight: 600; }
.mp-radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.mp-switch-row { display: flex; gap: 16px; }
.mp-file-btn {
  display: inline-block; padding: 7px 12px; font-size: 12px; cursor: pointer;
  border: 1px dashed var(--primary); color: var(--primary); border-radius: 8px; transition: var(--transition);
}
.mp-file-btn:hover { background: rgba(99, 102, 241, .08); }
.mp-stream-row { display: flex; gap: 6px; }
.mp-stream-row input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 12px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); outline: none;
}
.mp-stream-row input:focus { border-color: var(--primary); }
.mp-stream-row button { padding: 7px 14px; font-size: 12px; border: none; border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer; }
.mp-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 11px; color: var(--muted); }
.mp-keys b { color: var(--text); font-weight: 600; }

/* Video.js 自定义按钮与微调 */
.video-js .vjs-mp-btn .vjs-icon-placeholder { font-size: 15px; line-height: 1.4; font-family: inherit; }
.video-js .vjs-mp-btn.vjs-mp-loop-button.mp-on { color: #22d3ee; }
.video-js .vjs-mp-btn.mp-on .vjs-icon-placeholder::after { content: '✓'; margin-left: 2px; font-size: 10px; }

/* 浅色主题(面板 + 播放器皮肤覆盖) */
.mp-light { background: #f8fafc; }
.mp-light .mp-title, .mp-light .mp-pl-head, .mp-light .mp-pl-item { color: #1e293b; }
.mp-light .mp-pl-item.active { background: rgba(99, 102, 241, .12); }
.mp-light .video-js .vjs-control-bar { background-color: rgba(241, 245, 249, .96); color: #1e293b; }
.mp-light .video-js .vjs-control-bar .vjs-button { color: #334155; }
.mp-light .video-js .vjs-control-bar .vjs-button:hover { color: #4f46e5; }
.mp-light .video-js .vjs-progress-control .vjs-play-progress { background-color: #6366f1; }
.mp-light .video-js .vjs-volume-level,
.mp-light .video-js .vjs-play-progress::before { background-color: #6366f1; }
.mp-light .video-js .vjs-big-play-button { background-color: rgba(99, 102, 241, .9); }
.mp-light .mp-settings, .mp-light .mp-settings-head { background: #f8fafc; }

/* 移动端:上下排布,播放列表折叠高度 */
@media (max-width: 768px) {
  .mp-panel { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .mp-stage { max-height: 44vh; }
  .mp-playlist { max-height: 200px; }
  .mp-keys { grid-template-columns: 1fr; }
  .mp-settings { right: 8px; left: 8px; width: auto; }
}

/* ============================================================
   文件分类(Google Magika AI 内容类型识别)
   ============================================================ */
.cls-wrap { display: flex; flex-direction: column; gap: 20px; max-width: 1080px; margin: 0 auto; }

/* 头部:标题 + 预测模式 + 引擎状态 */
.cls-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cls-title { font-size: 24px; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -.02em; }
.cls-sub { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.cls-hero-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cls-mode { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cls-mode-label { font-weight: 600; white-space: nowrap; }
.cls-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font-size: 13px; cursor: pointer; outline: none; }
.cls-select:focus { border-color: var(--primary); }
.cls-engine { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: var(--bg-soft); padding: 7px 12px; border-radius: 20px; white-space: nowrap; }
.cls-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cls-dot.ok { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.cls-dot.loading { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); animation: cls-pulse 1.2s ease-in-out infinite; }
.cls-dot.err { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
@keyframes cls-pulse { 50% { opacity: .4; } }

/* 卡片 */
.cls-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.cls-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cls-card-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.cls-card-sub { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* 拖拽区 */
.cls-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; border: 2px dashed var(--border); border-radius: 12px; color: var(--muted); cursor: pointer; text-align: center; transition: border-color .2s, background .2s, color .2s; outline: none; }
.cls-drop:hover, .cls-drop:focus-visible, .cls-drop.drag { border-color: var(--primary); background: rgba(79, 70, 229, .04); color: var(--primary); }
.cls-drop-text { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.cls-drop-sub { font-size: 12px; color: var(--muted); margin: 0; }
.cls-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; color: var(--muted); font-size: 13px; }
.cls-spin { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: cls-rotate .8s linear infinite; }
@keyframes cls-rotate { to { transform: rotate(360deg); } }
.cls-error { padding: 14px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: 13px; }

/* 快检结果卡片 */
.cls-inspect-result { margin-top: 16px; }

/* 上传并归档结果(每个文件一行:名称/大小/状态 + 进度条 + 归档信息) */
.cls-upload-result { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cls-up-row { border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 9px; transition: border-color .25s, background .25s; }
.cls-up-row.done { border-color: #bbf7d0; background: #f0fdf4; }
.cls-up-row.failed { border-color: #fecaca; background: #fef2f2; }
.cls-up-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.cls-up-name { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.cls-up-size { font-size: 11px; color: var(--muted); flex: none; }
.cls-up-state { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: auto; flex: none; white-space: nowrap; }
.cls-up-row.done .cls-up-state { color: var(--success); }
.cls-up-row.failed .cls-up-state { color: var(--danger); }
.cls-up-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.cls-up-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--primary); transition: width .25s ease; }
.cls-up-bar.indet i { width: 30%; background: linear-gradient(90deg, var(--primary), #a78bfa); animation: cls-up-indet 1.2s ease-in-out infinite; }
@keyframes cls-up-indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.cls-up-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cls-up-meta .cls-gbadge:first-child { margin-left: 0; }
.cls-up-archived { font-size: 12px; font-weight: 600; color: var(--success); }
.cls-up-archived.pending { color: var(--warning); }
.cls-up-err { font-size: 12px; color: var(--danger); }
.cls-up-view { padding: 3px 10px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.cls-up-view:hover { border-color: var(--primary); background: rgba(79, 70, 229, .06); }
.cls-ir { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 12px; }
.cls-ir-warn { border-color: #fecaca; background: #fffbeb; }
.cls-ir-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cls-ir-file { display: flex; flex-direction: column; min-width: 0; }
.cls-ir-name { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.cls-ir-size { font-size: 12px; color: var(--muted); }
.cls-ir-label { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.cls-ir-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.cls-ir-item { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.cls-ir-item span { color: var(--muted); }
.cls-ir-item b { color: var(--text); font-weight: 600; word-break: break-all; }
.cls-ir-score { display: flex; align-items: center; gap: 10px; }
.cls-ir-score-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cls-ir-warn { padding: 10px 14px; border-radius: 10px; background: #fee2e2; color: #b91c1c; font-size: 13px; font-weight: 600; }
.cls-ir-ext { font-size: 13px; }
.cls-ir-foot { font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }

/* 统计条 */
.cls-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cls-stat { display: flex; align-items: center; gap: 8px; background: var(--bg-soft); border-radius: 10px; padding: 8px 14px; }
.cls-stat-num { font-size: 18px; font-weight: 800; color: var(--text); }
.cls-stat-label { font-size: 12px; color: var(--muted); }
.cls-stat-warn .cls-stat-num { color: #dc2626; }

/* 批量进度 */
.cls-batch-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cls-batch-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.cls-batch-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--primary), #7c3aed); transition: width .4s ease; }
.cls-batch-text { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 筛选 chips */
.cls-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cls-chip { padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.cls-chip:hover { border-color: var(--primary); color: var(--primary); }
.cls-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 表格 */
.cls-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.cls-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); }
.cls-table th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.cls-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.cls-table tbody tr:last-child td { border-bottom: none; }
.cls-table tbody tr:hover { background: rgba(79, 70, 229, .03); }
.cls-row-warn td { background: #fffbeb; }
.cls-row-warn:hover td { background: #fef3c7 !important; }
.td-name { max-width: 260px; }
.td-name > span:first-child { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-sub { font-size: 11px; color: var(--muted); }
.td-size { white-space: nowrap; color: var(--muted); }
.td-label { white-space: nowrap; }
.td-ext { white-space: nowrap; }
.td-op { text-align: right; white-space: nowrap; }

.cls-label { font-weight: 700; color: var(--text); }
.cls-un { color: var(--muted); font-size: 12px; }
.cls-gbadge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: 1px; }
.cls-note { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: #fff7ed; color: #c2410c; font-size: 10px; font-weight: 600; vertical-align: 1px; cursor: help; }

/* 置信度条:横条 + 右侧百分数 */
/* 百分比 b 绝对定位在进度条外侧(left:100%),不占布局宽度;
   margin-right 为其预留空间,防止表格「扩展名审计」列 / flex 行后续文字与百分比重叠 */
.cls-score { position: relative; display: inline-block; width: 110px; height: 5px; background: var(--bg-soft); border-radius: 3px; vertical-align: middle; margin-right: 42px; }
.cls-score i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 3px; min-width: 2px; }
.cls-score b { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; font-size: 12px; color: var(--text); font-weight: 700; white-space: nowrap; }
.cls-score-hi i { background: #16a34a; }
.cls-score-mid i { background: #f59e0b; }
.cls-score-lo i { background: #dc2626; }

/* 扩展名审计标记 */
.cls-extmark { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.cls-extmark.ok { background: #f0fdf4; color: #15803d; }
.cls-extmark.bad { background: #fee2e2; color: #b91c1c; }
.cls-extmark.none { background: var(--bg-soft); color: var(--muted); }

/* 按钮 */
.btn-cls-batch { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s; }
.btn-cls-batch:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-cls-batch:disabled { opacity: .6; cursor: not-allowed; }
.btn-cls-one { padding: 6px 14px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-cls-one:hover:not(:disabled) { background: var(--primary-dark); }
.btn-cls-one:disabled { opacity: .6; cursor: wait; }
.btn-cls-one.ghost { background: var(--bg-soft); color: var(--muted); }
.btn-cls-one.ghost:hover:not(:disabled) { background: #e2e8f0; color: var(--text); }

/* 空态 */
.cls-empty { text-align: center; padding: 40px 20px; }
.cls-empty-text { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.cls-empty-sub { font-size: 12px; color: var(--muted); margin: 0; }

/* 移动端 */
@media (max-width: 768px) {
  .cls-hero { align-items: flex-start; }
  .cls-card { padding: 16px; }
  .cls-table th, .cls-table td { padding: 8px 10px; font-size: 12px; }
  .td-name { max-width: 150px; }
  .cls-ir-name { max-width: 100%; }
}

/* ============ 文本/电子书阅读(我的文件·文本子 Tab) ============ */
body.reader-open { overflow: hidden; } /* 阅读器打开时锁页面滚动 */

/* -- 阅读卡片(与音频卡片同设计语言:纵向居中网格单元) -- */
.text-read-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 12px; gap: 6px; aspect-ratio: 1; cursor: pointer;
}
.trk-icon {
  width: 64px; height: 64px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; font-size: 30px; transition: var(--transition);
}
.trk-icon-ebook { background: linear-gradient(135deg, #ede9fe, #ddd6fe); box-shadow: inset 0 0 0 1px #c4b5fd; }
.trk-icon-txt { background: linear-gradient(135deg, #e0f2fe, #dbeafe); box-shadow: inset 0 0 0 1px #93c5fd; }
.text-read-card:hover .trk-icon { transform: translateY(-2px) scale(1.04); }
.trk-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.trk-sub { font-size: 11px; color: var(--muted); }
.text-read-card .file-del { top: 8px; right: 8px; }

/* -- epub.js 全屏阅读器覆盖层 -- */
.ebook-reader {
  position: fixed; inset: 0; z-index: 95;
  display: flex; flex-direction: column;
  background: #f8fafc;
  animation: er-in .25s ease;
}
@keyframes er-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.er-topbar {
  display: flex; align-items: center; gap: 14px; flex: none;
  height: 52px; padding: 0 18px;
  background: var(--card); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(15, 23, 42, .06);
}
.er-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 10px; border: none; border-radius: 10px;
  background: var(--bg-soft); color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.er-back:hover { background: var(--border); transform: translateX(-2px); }
.er-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.er-brand { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .4px; }
.er-frame-wrap { position: relative; flex: 1; min-height: 0; }
.er-frame { width: 100%; height: 100%; border: none; display: block; background: #fff; }
.er-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: #f8fafc; color: var(--muted); font-size: 14px;
  transition: opacity .3s;
}
.er-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: er-spin .8s linear infinite;
}
@keyframes er-spin { to { transform: rotate(360deg); } }

/* -- 纯文本阅读面板(居中卡片式) -- */
.txt-reader {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: tr-fade .2s ease;
}
@keyframes tr-fade { from { opacity: 0; } to { opacity: 1; } }
.tr-panel {
  display: flex; flex-direction: column; width: min(880px, 100%); height: min(86vh, 900px);
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .35);
  animation: tr-pop .25s cubic-bezier(.2, .8, .3, 1);
}
@keyframes tr-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.tr-topbar {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--bg-soft);
}
.tr-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.tr-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tr-btn {
  min-width: 34px; height: 30px; padding: 0 9px; border: none; border-radius: 8px;
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 700;
  cursor: pointer; box-shadow: inset 0 0 0 1px var(--border); transition: var(--transition);
}
.tr-btn:hover { background: var(--border); }
.tr-fs-label { min-width: 38px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-close:hover { background: #fee2e2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.tr-body { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 30px; background: var(--card); }
.tr-content {
  font-family: "Georgia", "Noto Serif SC", "Songti SC", "SimSun", serif; /* 衬线字体:长文阅读更舒适 */
  font-size: 17px; line-height: 1.9; color: #1e293b;
  white-space: pre-wrap; word-break: break-word; text-align: justify;
}
.tr-foot {
  flex: none; padding: 8px 18px; border-top: 1px solid var(--border);
  background: var(--bg-soft); font-size: 11.5px; color: var(--muted); text-align: right;
}

/* -- 移动端适配 -- */
@media (max-width: 768px) {
  .er-topbar { height: 48px; padding: 0 12px; gap: 10px; }
  .er-back span { display: none; } /* 窄屏只留返回箭头 */
  .er-brand { display: none; }
  .txt-reader { padding: 0; }
  .tr-panel { width: 100%; height: 100%; border-radius: 0; }
  .tr-body { padding: 18px 16px; }
  .tr-content { text-align: left; }
  .trk-icon { width: 56px; height: 56px; font-size: 26px; }
}

/* ============================================================
 * 全能阅读器 UniReader(reader-architecture-v3)
 * 四大内核 + 模式合成器 + 看板娘 + 成就系统
 * ============================================================ */
.uni-reader {
  --ur-bg: #f8fafc;
  --ur-panel: #ffffff;
  --ur-fg: #0f172a;
  --ur-muted: #64748b;
  --ur-line: #e2e8f0;
  --ur-accent: #7c3aed;
  --ur-stage: #ffffff;
  --ur-fs: 17px;
  position: fixed; inset: 0; z-index: 96;
  display: flex; flex-direction: column;
  background: var(--ur-bg); color: var(--ur-fg);
  animation: ur-in .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes ur-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* 主题 */
.uni-reader[data-theme="dark"] {
  --ur-bg: #101014; --ur-panel: #1c1c22; --ur-fg: #ededf2;
  --ur-muted: #9a9aa6; --ur-line: #2c2c34; --ur-stage: #1a1a20;
}
.uni-reader[data-theme="sepia"] {
  --ur-bg: #f3e9d8; --ur-panel: #fbf5e9; --ur-fg: #43321b;
  --ur-muted: #8a7457; --ur-line: #e4d5bb; --ur-stage: #f8f0df;
}

/* -- 顶栏 -- */
.ur-topbar {
  flex: none; display: flex; align-items: center; gap: 12px;
  height: 54px; padding: 0 16px;
  background: var(--ur-panel); border-bottom: 1px solid var(--ur-line);
  transition: opacity .3s, transform .3s;
}
.ur-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 10px; border: none; border-radius: 10px;
  background: transparent; color: var(--ur-fg); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.ur-back:hover { background: rgba(124, 58, 237, .1); }
.ur-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ur-title {
  font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ur-chapter {
  font-size: 11.5px; color: var(--ur-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ur-pageinfo { flex: none; font-size: 12px; color: var(--ur-muted); font-variant-numeric: tabular-nums; }
.ur-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.ur-btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px; border: none; border-radius: 9px;
  background: transparent; color: var(--ur-fg); cursor: pointer; transition: background .15s;
}
.ur-btn:hover { background: rgba(124, 58, 237, .1); }
.ur-theme-label { font-size: 12px; font-weight: 600; }

/* -- 内核舞台 -- */
.ur-stage { position: relative; flex: 1; min-height: 0; background: var(--ur-stage); overflow: hidden; }
.ur-stage foliate-view { width: 100%; height: 100%; }
/* 暗色主题下 foliate iframe 反色(纯文本向书籍) */
.uni-reader[data-theme="dark"] .ur-stage:not(.ur-stage-fixed) foliate-view::part(filter) {
  filter: invert(.92) hue-rotate(180deg);
  background: #16161c;
}
.uni-reader[data-theme="sepia"] .ur-stage:not(.ur-stage-fixed) foliate-view::part(filter) {
  filter: sepia(.35) saturate(.85);
  background: #f8f0df;
}

/* comimi 覆写:撑满舞台 */
.ur-spread-host, .ur-hybrid-spread { position: absolute; inset: 0; z-index: 5; background: var(--ur-stage); }
.ur-spread-host .comimi-root, .ur-hybrid-spread .comimi-root {
  width: 100% !important; max-width: none !important; aspect-ratio: auto !important;
  height: 100% !important; min-height: 0 !important; max-height: none !important;
  margin: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.ur-spread-host .comimi-resize-handle, .ur-hybrid-spread .comimi-resize-handle { display: none; }
.ur-hybrid-spread:not(.is-active) { pointer-events: none; }
.ur-hybrid-bar {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 8; padding: 10px 22px; border: none; border-radius: 999px;
  background: rgba(124, 58, 237, .92); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; box-shadow: 0 6px 20px rgba(124, 58, 237, .4);
  animation: ur-bar-in .25s ease;
}
@keyframes ur-bar-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* -- 条漫纵向流 -- */
.ur-webtoon {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  background: #000; scroll-behavior: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ur-webtoon-slot { position: relative; width: 100%; background: #111; overflow: hidden; }
.ur-webtoon-slot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #000; user-select: none; -webkit-user-drag: none;
}

/* -- 文本内核 -- */
.ur-text { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.ur-text-inner {
  max-width: 780px; margin: 0 auto; padding: 40px 34px 90px;
  font-size: var(--ur-fs); line-height: 2; color: var(--ur-fg);
}
.ur-text-chaphead {
  margin: 0 0 26px; padding-bottom: 14px; border-bottom: 1px solid var(--ur-line);
  font-size: calc(var(--ur-fs) + 3px); font-weight: 800; letter-spacing: .5px; text-align: center;
}
.ur-text-plain {
  font-family: "Georgia", "Noto Serif SC", "Songti SC", "SimSun", serif;
  white-space: pre-wrap; word-break: break-word; text-align: justify;
}
.ur-text-md { line-height: 1.9; word-break: break-word; }
.ur-text-md h1, .ur-text-md h2, .ur-text-md h3 { margin: 1.2em 0 .5em; line-height: 1.4; }
.ur-text-md h1 { font-size: calc(var(--ur-fs) + 8px); } .ur-text-md h2 { font-size: calc(var(--ur-fs) + 5px); }
.ur-text-md p { margin: .7em 0; }
.ur-text-md blockquote {
  margin: .8em 0; padding: .4em 1em; border-left: 3px solid var(--ur-accent);
  background: rgba(124, 58, 237, .06); border-radius: 0 8px 8px 0; color: var(--ur-muted);
}
.ur-text-md code {
  font-family: ui-monospace, Consolas, monospace; font-size: .92em;
  background: rgba(124, 58, 237, .1); padding: .1em .4em; border-radius: 5px;
}
.ur-text-md pre {
  margin: .9em 0; padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  background: rgba(15, 23, 42, .86); color: #e2e8f0; line-height: 1.6;
}
.ur-text-md pre code { background: none; padding: 0; color: inherit; }
.ur-text-md ul, .ur-text-md ol { margin: .7em 0; padding-left: 1.6em; }
.ur-text-md hr { margin: 1.6em 0; border: none; border-top: 1px solid var(--ur-line); }
.ur-text-md a { color: var(--ur-accent); }
.ur-text-nextbar {
  margin: 34px -10px 0; padding: 13px 16px; border-radius: 12px; text-align: center;
  background: rgba(124, 58, 237, .09); color: var(--ur-accent);
  font-size: calc(var(--ur-fs) - 2px); font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.ur-text-nextbar:hover { background: rgba(124, 58, 237, .16); }

/* -- 底部进度条 -- */
.ur-bottombar {
  flex: none; display: flex; align-items: center; gap: 14px;
  height: 34px; padding: 0 16px; background: var(--ur-panel); border-top: 1px solid var(--ur-line);
  transition: opacity .3s;
}
.ur-progress-track {
  flex: 1; height: 5px; border-radius: 3px; background: var(--ur-line); cursor: pointer;
  position: relative; overflow: hidden;
}
.ur-progress-track:hover { height: 7px; }
.ur-progress-fill {
  height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width .35s ease;
}
.ur-progress-meta { flex: none; display: flex; align-items: center; gap: 10px; }
.ur-progress-meta span:first-child { font-size: 12px; font-weight: 700; color: var(--ur-fg); font-variant-numeric: tabular-nums; }
.ur-brand { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; color: var(--ur-muted); }

/* -- 目录抽屉 -- */
.ur-drawer {
  position: absolute; top: 0; left: 0; bottom: 0; z-index: 30; width: min(340px, 86vw);
  display: flex; flex-direction: column;
  background: var(--ur-panel); border-right: 1px solid var(--ur-line);
  box-shadow: 8px 0 30px rgba(15, 23, 42, .18);
  transform: translateX(-102%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.ur-drawer.is-open { transform: none; }
.ur-drawer-head {
  flex: none; padding: 15px 18px; font-size: 14px; font-weight: 800;
  border-bottom: 1px solid var(--ur-line);
}
.ur-toc-list { flex: 1; overflow-y: auto; padding: 8px; }
.ur-toc-item {
  display: block; width: 100%; padding: 9px 12px; border: none; border-radius: 8px;
  background: none; color: var(--ur-fg); font-size: 13px; text-align: left;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ur-toc-item:hover { background: rgba(124, 58, 237, .09); color: var(--ur-accent); }
.ur-toc-empty { padding: 24px 18px; font-size: 13px; color: var(--ur-muted); }

/* -- 设置面板 -- */
.ur-settings {
  position: absolute; top: 54px; right: 12px; z-index: 30; width: min(320px, 90vw);
  background: var(--ur-panel); border: 1px solid var(--ur-line); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .25); padding: 6px 0 12px;
  transform: translateY(-8px) scale(.98); opacity: 0; pointer-events: none;
  transition: all .22s cubic-bezier(.2,.8,.2,1);
}
.ur-settings.is-open { transform: none; opacity: 1; pointer-events: auto; }
.ur-settings-head {
  padding: 12px 18px 8px; font-size: 13px; font-weight: 800; color: var(--ur-muted);
  text-transform: uppercase; letter-spacing: .6px;
}
.ur-set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px;
}
.ur-set-label { font-size: 13.5px; font-weight: 600; }
.ur-set-fs { display: flex; align-items: center; gap: 8px; }
.ur-set-btn {
  min-width: 32px; height: 30px; border: none; border-radius: 8px;
  background: var(--ur-bg); color: var(--ur-fg); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.ur-set-btn:hover { background: rgba(124, 58, 237, .12); }
.ur-set-val { min-width: 44px; text-align: center; font-size: 12.5px; color: var(--ur-muted); font-variant-numeric: tabular-nums; }
.ur-set-seg { display: flex; background: var(--ur-bg); border-radius: 9px; padding: 3px; }
.ur-set-seg-btn {
  padding: 6px 14px; border: none; border-radius: 7px; background: none;
  color: var(--ur-muted); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.ur-set-seg-btn.is-on { background: var(--ur-accent); color: #fff; }
.ur-set-switch {
  position: relative; width: 42px; height: 24px; border: none; border-radius: 999px;
  background: var(--ur-line); cursor: pointer; transition: background .2s;
}
.ur-set-switch i {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .2s;
}
.ur-set-switch.is-on { background: var(--ur-accent); }
.ur-set-switch.is-on i { transform: translateX(18px); }
.ur-set-tip { margin: 4px 18px 10px; font-size: 11.5px; line-height: 1.6; color: var(--ur-muted); }
.ur-set-legacy {
  display: block; margin: 4px 18px 0; width: calc(100% - 36px); padding: 10px;
  border: 1px dashed var(--ur-line); border-radius: 9px; background: none;
  color: var(--ur-muted); font-size: 12.5px; cursor: pointer;
}
.ur-set-legacy:hover { border-color: var(--ur-accent); color: var(--ur-accent); }

/* -- 遮罩 -- */
.ur-mask {
  position: absolute; inset: 0; z-index: 25;
  background: rgba(10, 8, 20, .4); backdrop-filter: blur(2px);
}

/* -- 加载 -- */
.ur-loading {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--ur-bg); color: var(--ur-muted); font-size: 14px;
}
.ur-spin {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--ur-line); border-top-color: var(--ur-accent);
  animation: ur-spin .8s linear infinite;
}
@keyframes ur-spin { to { transform: rotate(360deg); } }

/* -- Toast -- */
.ur-toast {
  position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%); z-index: 60;
  padding: 11px 20px; border-radius: 11px; max-width: 80vw;
  background: rgba(15, 23, 42, .92); color: #fff; font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: ur-toast-in .25s ease; transition: opacity .35s, transform .35s;
}
.ur-toast.error { background: rgba(185, 28, 28, .95); }
.ur-toast.is-out { opacity: 0; transform: translate(-50%, 6px); }
@keyframes ur-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* -- 看板娘 -- */
.ur-mascot {
  position: absolute; right: 22px; bottom: 52px; z-index: 45;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  cursor: pointer; transition: opacity .3s;
}
.ur-mascot.is-hidden { display: none; }
.ur-mascot-svg {
  width: 72px; height: 72px; filter: drop-shadow(0 6px 16px rgba(124, 58, 237, .35));
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.ur-mascot:hover .ur-mascot-svg { transform: scale(1.07) rotate(-3deg); }
.ur-mascot .ur-mascot-eyes { transform-origin: 60px 62px; transition: transform .12s; }
.ur-mascot .ur-mascot-ear { transform-origin: 60px 60px; animation: ur-ear 3.2s ease-in-out infinite; }
.ur-mascot .ur-mascot-ear-r { animation-delay: .18s; }
@keyframes ur-ear { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-5deg); } 94% { transform: rotate(4deg); } }
.ur-mascot[data-mode="celebrate"] .ur-mascot-star { opacity: 1; animation: ur-star .7s ease infinite alternate; }
@keyframes ur-star { from { transform: scale(.7) rotate(-8deg); } to { transform: scale(1.15) rotate(8deg); } }
.ur-mascot[data-mode="sleep"] .ur-mascot-zzz { opacity: 1; animation: ur-zzz 1.6s ease infinite; }
.ur-mascot[data-mode="sleep"] .ur-mascot-eyes { transform: scaleY(.12); }
@keyframes ur-zzz { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.ur-mascot-bubble {
  max-width: 260px; padding: 10px 14px; border-radius: 14px 14px 4px 14px;
  background: var(--ur-panel); color: var(--ur-fg); font-size: 12.5px; line-height: 1.6;
  border: 1px solid var(--ur-line); box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
  opacity: 0; transform: translateY(6px) scale(.96); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.ur-mascot.is-talking .ur-mascot-bubble { opacity: 1; transform: none; }

/* -- 沉浸模式 -- */
.uni-reader.ur-zen .ur-topbar {
  opacity: 0; transform: translateY(-100%); pointer-events: none;
}
.uni-reader.ur-zen .ur-topbar:hover { opacity: 1; transform: none; pointer-events: auto; }
.uni-reader.ur-zen .ur-bottombar { opacity: .12; }
.uni-reader.ur-zen .ur-bottombar:hover { opacity: 1; }
.uni-reader.ur-zen .ur-mascot { opacity: .4; }
.uni-reader.ur-zen .ur-mascot:hover { opacity: 1; }

/* -- 移动端 -- */
@media (max-width: 768px) {
  .ur-topbar { height: 50px; padding: 0 10px; gap: 8px; }
  .ur-back span { display: none; }
  .ur-theme-label { display: none; }
  .ur-text-inner { padding: 26px 18px 80px; }
  .ur-mascot-svg { width: 58px; height: 58px; }
  .ur-mascot { right: 12px; bottom: 44px; }
  .ur-settings { top: 50px; right: 8px; }
}


/* ============================================================
   RocketChat 标签页（独立第二台 ECS，与主站同 VPC 内网直连）
   品牌色取 Rocket.Chat 官方蓝 #1d74f5，与站内靛蓝主色区分开
   ============================================================ */
.rc-wrap { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }

/* ---- 主视觉 ---- */
.rc-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.rc-eyebrow { margin: 0 0 7px; color: #1d74f5; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.rc-hero h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.rc-hero p:not(.rc-eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 660px; line-height: 1.75; }
.rc-hero-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.rc-status {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 13px; color: var(--muted);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.rc-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.rc-status-checking .rc-dot { animation: rcPulse 1.1s ease-in-out infinite; }
.rc-status-online { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.rc-status-offline { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
@keyframes rcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

.rc-launch {
  display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #1d74f5, #1554c0); color: #fff;
  font-size: 13px; font-weight: 700; padding: 10px 18px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 116, 245, .32); transition: var(--transition);
}
.rc-launch:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(29, 116, 245, .42); }
.rc-launch:active:not(:disabled) { transform: translateY(0) scale(.98); }
.rc-launch:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---- 双栏 ---- */
.rc-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rc-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rc-card-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.rc-card-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.rc-badge {
  border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; white-space: nowrap;
}

/* ---- 工作区入口 ---- */
.rc-url-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.rc-url-row code {
  flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-copy {
  flex: 0 0 auto; border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 8px; padding: 5px 11px; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.rc-copy:hover { color: #1d74f5; border-color: #bfdbfe; background: #f8fbff; }

.rc-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.rc-actions .btn-primary { width: auto; padding: 10px 18px; font-size: 13px; }

.rc-steps { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: rcstep; display: flex; flex-direction: column; gap: 11px; }
.rc-steps li { position: relative; padding-left: 30px; font-size: 12.5px; color: var(--muted); line-height: 1.65; counter-increment: rcstep; }
.rc-steps li::before {
  content: counter(rcstep); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; background: #eff6ff; color: #1d4ed8;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.rc-steps b { color: var(--text); }
.rc-steps code { background: #f1f5f9; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; color: #1d4ed8; }

.rc-note {
  margin: 16px 0 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #fde68a; background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.65;
}

/* ---- 服务状态 ---- */
.rc-metrics-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rc-metrics-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px;
}
.rc-metrics-list li:last-child { border-bottom: 0; }
.rc-metrics-list span { color: var(--muted); flex: 0 0 auto; }
.rc-metrics-list b { font-weight: 700; text-align: right; min-width: 0; }
.rc-refresh {
  margin-top: 14px; width: 100%; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.rc-refresh:hover { background: var(--bg-soft); border-color: #cbd5e1; }

/* ---- 能力清单 ---- */
.rc-cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.rc-cap {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: var(--transition);
}
.rc-cap:hover { border-color: #bfdbfe; background: #f8fbff; }
.rc-cap-ico {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px;
  background: #eff6ff; color: #1d74f5; display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.rc-cap strong { display: block; font-size: 12.5px; font-weight: 700; }
.rc-cap small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

/* ---- 站内内嵌浮层（工作区为 HTTPS 时可用） ---- */
.rc-embed-layer { position: fixed; inset: 0; z-index: 9999; background: #0f172a; display: flex; flex-direction: column; }
.rc-embed-bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: #1f2329; color: #f1f5f9;
}
.rc-embed-title { font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.rc-embed-state { flex: 1 1 auto; text-align: center; font-size: 12px; color: #94a3b8; }
.rc-embed-state[data-state="opening"] { color: #fbbf24; }
.rc-embed-state[data-state="sent"] { color: #4ade80; }
.rc-embed-state[data-state="error"] { color: #f87171; }
.rc-embed-tools { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.rc-embed-link { color: #93c5fd; font-size: 12.5px; font-weight: 700; text-decoration: none; }
.rc-embed-link:hover { text-decoration: underline; }
.rc-embed-close {
  border: 0; background: rgba(255, 255, 255, .1); color: #f1f5f9; width: 28px; height: 28px;
  border-radius: 8px; font-size: 15px; cursor: pointer; transition: background .15s ease;
}
.rc-embed-close:hover { background: rgba(255, 255, 255, .22); }
.rc-embed-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
body.rc-embed-open { overflow: hidden; }

/* ---- 移动端 ---- */
@media (max-width: 860px) {
  .rc-hero { flex-direction: column; gap: 12px; }
  .rc-hero-right { flex-wrap: wrap; }
  .rc-grid { grid-template-columns: 1fr; }
  .rc-cap-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .rc-actions .btn-primary { flex: 1 1 100%; }
}

/* ============================================================
   我的文件 · 文件概览 & 可预览/仅下载区分
   —— 概览:一行轻量统计(可在线查看 / 仅可下载 / 占比),与站点其它轻量元素同风格
   —— 分类数量由子 Tab 徽章承担,此处不再重复
   —— 卡片角标:绿色「可查看」/ 灰色「仅下载」
   ============================================================ */
.fo-panel { display: flex; flex-direction: column; }

/* --- 概览:一行统计(加载完成后出现) --- */
.files-overview {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 14px;
  font-size: 12px; color: var(--muted);
}
.files-overview[hidden] { display: none; }
.fo-stat { display: inline-flex; align-items: baseline; gap: 3px; }
.fo-stat b { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.fo-stat-view b { color: var(--success); }
.fo-sep { color: #cbd5e1; }

/* 可在线查看占比:迷你条 + 百分比 */
.fo-meter {
  position: relative; flex: none;
  width: 58px; height: 5px; border-radius: 999px; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.fo-meter-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.fo-pct { font-size: 12px; font-weight: 700; color: var(--text); }

/* --- 卡片角标:仅服务于「可在线查看」的卡片 ---
   仅下载卡片不再用角标 —— 其底部「下载」键本身就是降级标识 */
.fc-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1.35;
  pointer-events: none; white-space: nowrap;
  transition: var(--transition);
}
.fc-badge-view { background: rgba(255, 255, 255, .92); color: #047857; box-shadow: 0 1px 5px rgba(15, 23, 42, .2); }
.file-card:hover .fc-badge-view { background: var(--success); color: #fff; }

/* --- 骨架屏 / 错误态 --- */
.fc-skeleton {
  aspect-ratio: 1; border-radius: 12px; pointer-events: none;
  background: linear-gradient(100deg, #f1f5f9 30%, #e9eef5 50%, #f1f5f9 70%);
  background-size: 200% 100%;
  animation: fcShimmer 1.25s ease-in-out infinite;
}
@keyframes fcShimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }

.files-error {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 48px 20px; text-align: center;
}
.fe-icon { font-size: 30px; line-height: 1; color: var(--warning); }
.fe-text { font-size: 14px; font-weight: 600; color: var(--text); }
.fe-sub { font-size: 12px; color: var(--muted); }
.fe-retry {
  margin-top: 8px; padding: 7px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.fe-retry:hover { border-color: var(--primary); color: var(--primary); }

/* 空状态主行动按钮 */
.empty-action {
  margin-top: 16px; padding: 9px 20px; border-radius: 9px; border: none;
  background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .28); transition: var(--transition);
}
.empty-action:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(79, 70, 229, .34); }

/* 「文件分类」上传区被跳转引导时的高亮脉冲 */
.cls-drop-pulse { animation: clsDropPulse 1.6s ease; }
@keyframes clsDropPulse {
  0%, 100% { box-shadow: none; border-color: var(--border); }
  35% { box-shadow: 0 0 0 6px rgba(79, 70, 229, .18); border-color: var(--primary); }
}
