﻿/* ============================================================
   ZRui电竞工作台 全局样式（响应式 + 轻动画）
   ============================================================ */
:root {
  --primary: #5c7cfa;
  --primary-dark: #4c6ef5;
  --success: #2f9e44;
  --danger: #e03131;
  --warning: #f08c00;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #212529;
  --text-2: #868e96;
  --border: #e9ecef;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============ 通用按钮 ============ */
.zr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 18px; border: none; border-radius: 8px; font-size: 14px;
  cursor: pointer; transition: all .2s ease; position: relative; overflow: hidden;
  min-height: 38px; user-select: none; -webkit-tap-highlight-color: transparent;
}
.zr-btn:disabled { opacity: .5; cursor: not-allowed; }
.zr-btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.zr-btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(92,124,250,.4); }
.zr-btn-success { background: var(--success); color: #fff; }
.zr-btn-success:not(:disabled):hover { box-shadow: 0 6px 16px rgba(47,158,68,.35); }
.zr-btn-danger { background: var(--danger); color: #fff; }
.zr-btn-danger:not(:disabled):hover { box-shadow: 0 6px 16px rgba(224,49,49,.35); }
.zr-btn-warning { background: var(--warning); color: #fff; }
.zr-btn-ghost { background: #eef1f8; border: 1px solid #dde3f0; color: #4a5568; }
.zr-btn-ghost:not(:disabled):hover { border-color: var(--primary); color: var(--primary); background: #e8edfb; }
.zr-btn-sm { padding: 5px 12px; font-size: 13px; min-height: 32px; border-radius: 6px; }
.zr-btn-xs { padding: 5px 14px; font-size: 13px; min-height: 32px; border-radius: 6px; }
.zr-btn-block { width: 100%; }
/* 水波纹 */
.btn-ripple .ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,.45);
  transform: scale(0); animation: ripple .5s ease-out; pointer-events: none;
}
.zr-btn-ghost .ripple, .zr-btn-danger .ripple { background: rgba(0,0,0,.12); }
@keyframes ripple { to { transform: scale(3); opacity: 0; } }

/* ============ 表单 ============ */
.zr-form .zr-field { position: relative; margin-bottom: 16px; }
.zr-field input, .zr-field select, .zr-field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; transition: border-color .2s, box-shadow .2s;
  background: #fff; color: var(--text);
}
.zr-field input:focus, .zr-field select:focus, .zr-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(92,124,250,.12);
}
.zr-field input.err, .zr-field select.err, .zr-field textarea.err { border-color: var(--danger); }
.zr-field .layui-icon { position: absolute; right: 14px; top: 12px; color: #adb5bd; pointer-events: none; }
.zr-field input { padding-right: 40px; }
.zr-field select { padding-right: 14px; }
.field-err { font-size: 12px; color: var(--danger); margin-top: 4px; min-height: 0; display: none; }
.field-err.show { display: block; animation: fadeIn .2s; }
.zr-field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.zr-field label .req { color: var(--danger); }
/* 网名输入：前缀 ZR- 是固定装饰，不在输入框里，用户删不掉；只需填后面 2-5 个字 */
.nick-wrap { position: relative; }
.nick-wrap .nick-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 700; color: var(--primary);
  pointer-events: none; user-select: none;
}
.zr-field .nick-wrap input { padding-left: 46px; }

/* 订单时限输入：小时 + 分钟两个输入框 */
.dur-input { display: flex; align-items: center; gap: 6px; }
.dur-input input { width: 84px; padding-right: 12px; text-align: center; }
.dur-input .dur-unit { font-size: 13px; color: var(--text-2); }

/* 单陪/双陪选择：两张票式卡片 */
.mode-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-item {
  flex: 1 1 210px; display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
  padding: 10px 12px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fafbfd;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.mode-item:hover { border-color: #c8d3e6; }
.mode-item input { margin-top: 3px; accent-color: var(--primary); }
.mode-item span { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.mode-item b { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.mode-item:has(input:checked) { border-color: var(--primary); background: #f3f6ff; box-shadow: 0 0 0 2px rgba(92, 124, 250, .12); }

/* ============ 登录页 ============ */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); padding: 20px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: fadeUp .5s ease;
}
.login-logo { text-align: center; font-size: 28px; font-weight: 700; color: #1a1a2e; margin-bottom: 24px; }
.login-logo span { font-size: 15px; color: var(--primary); margin-left: 8px; font-weight: 500; }
.login-tip { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 16px; }
/* Tab 平滑切换 */
.zr-tabs { position: relative; display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.zr-tab { flex: 1; text-align: center; padding: 10px 0; cursor: pointer; color: var(--text-2); font-size: 15px; transition: color .25s; }
.zr-tab.active { color: var(--primary); font-weight: 600; }
.zr-tab-line {
  position: absolute; bottom: -2px; left: 0; width: 50%; height: 2px;
  background: var(--primary); transition: transform .3s cubic-bezier(.4,0,.2,1);
}

/* ============ 管理端布局 ============ */
.admin-body { min-height: 100vh; }
.admin-side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: #1a1a2e;
  z-index: 200; transition: transform .3s ease; display: flex; flex-direction: column;
}
/* 侧栏品牌（左上角）：毛玻璃胶囊，视觉细节见下方「品牌区统一视觉」 */
.side-logo { margin: 14px 10px 6px; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #a5adcb;
  border-radius: 8px; cursor: pointer; transition: all .2s; margin-bottom: 4px; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.nav-item .layui-icon { font-size: 16px; }
.side-mask { display: none; }
.admin-main { margin-left: 220px; min-height: 100vh; display: flex; flex-direction: column; }
.admin-top {
  background: #fff; padding: 0 24px; height: 60px; display: flex; align-items: center;
  gap: 16px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100;
}
.top-menu-btn { display: none; background: none; border: none; font-size: 22px; color: var(--text-2); cursor: pointer; padding: 6px; }
.top-title { font-size: 17px; font-weight: 600; flex: 1; }
.top-right { display: flex; align-items: center; gap: 10px; }
.top-user { color: var(--text-2); font-size: 14px; }
.top-user .layui-icon { margin-right: 4px; }
.admin-content { padding: 24px; flex: 1; animation: fadeIn .3s ease; }

/* ============ 统计卡片 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(135deg,#5c7cfa,#4c6ef5); }
.stat-icon.green { background: linear-gradient(135deg,#51cf66,#2f9e44); }
.stat-icon.orange { background: linear-gradient(135deg,#ffa94d,#f08c00); }
.stat-icon.red { background: linear-gradient(135deg,#ff8787,#e03131); }
.stat-icon.purple { background: linear-gradient(135deg,#9775fa,#7048e8); }
.stat-icon.cyan { background: linear-gradient(135deg,#4dd4fa,#15aabf); }
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-2); }

/* ============ 面板/表格 ============ */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.panel-title { font-size: 16px; font-weight: 600; }
.panel-title::before { content: ''; display: inline-block; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; margin-right: 8px; vertical-align: -2px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; min-height: 38px;
}
.zr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.zr-table th { text-align: left; padding: 12px 10px; color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; background: #fafbfc; }
.zr-table td { padding: 12px 10px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
.zr-table tr:hover td { background: #f8f9ff; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-empty { text-align: center; color: var(--text-2); padding: 48px 0; font-size: 14px; }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; align-items: center; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pager button { padding: 6px 12px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager button.cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.tag-blue { background: #e7f0ff; color: #3b5bdb; }
.tag-green { background: #ebfbee; color: #2b8a3e; }
.tag-red { background: #fff5f5; color: #c92a2a; }
.tag-orange { background: #fff4e6; color: #d9480f; }
.tag-gray { background: #f1f3f5; color: #868e96; }
.tag-purple { background: #f3f0ff; color: #6741d9; }
.tag-cyan { background: #e3fafc; color: #0b7285; }

/* 等级标签 */
.level-tag { padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.level-金牌 { background: linear-gradient(135deg,#ffe066,#fab005); color: #7a5b00; }
.level-顶尖 { background: linear-gradient(135deg,#74c0fc,#339af0); color: #fff; }
.level-魔王 { background: linear-gradient(135deg,#9775fa,#7048e8); color: #fff; }
.level-明星 { background: linear-gradient(135deg,#ff8787,#fa5252); color: #fff; }

/* ============ 打手端布局 ============ */
.player-body { min-height: 100vh; padding-bottom: 70px; }
.player-top {
  background: linear-gradient(135deg, #1a1a2e, #16213e); color: #fff; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
/* ============ 品牌区统一视觉（登录页 / 管理侧栏左上角 / 打手端顶栏左上角） ============ */
.login-logo { font-weight: 800; letter-spacing: .6px; }

/* 毛玻璃胶囊：管理侧栏 + 打手端顶栏的品牌容器 */
.side-logo, .top-brand {
  display: inline-flex; align-items: center; gap: 9px; color: #fff;
  padding: 6px 12px 6px 6px; border-radius: 14px;
  white-space: nowrap; flex-wrap: nowrap; flex-shrink: 0; /* 品牌字一律不换行、不被压缩 */
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 8px 22px rgba(8,10,25,.28), inset 0 1px 0 rgba(255,255,255,.22);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}
/* 不支持毛玻璃时降级为实底，避免背景透出来看不清字 */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .side-logo, .top-brand { background: #23233f; }
}
/* 标记方块 */
.brand-badge {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; letter-spacing: .5px; color: #fff;
  background: linear-gradient(135deg, #8b7cff, #5c8cfa 52%, #22c6c6);
  box-shadow: 0 4px 12px rgba(92,124,250,.45), inset 0 1px 0 rgba(255,255,255,.4);
  -webkit-text-fill-color: currentColor;
}
/* 品牌名 */
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .6px; white-space: nowrap; }
/* 侧栏只有 220px，品牌胶囊整体收一档，避免溢出侧栏 */
.side-logo { gap: 8px; padding: 6px 10px 6px 6px; }
.side-logo .brand-name { font-size: 16px; letter-spacing: .2px; }
.side-logo .brand-sub { padding: 2px 8px; letter-spacing: .2px; }
/* 角色标签：-打手端 / -管理端 */
.brand-sub {
  display: inline-block; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  color: #b9c6ff; background: rgba(122,148,255,.18); border: 1px solid rgba(122,148,255,.36);
  -webkit-text-fill-color: currentColor;
}
/* 登录页副标题胶囊 */
.login-logo span {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; vertical-align: middle;
  transform: translateY(-1px); white-space: nowrap;
  color: #5c7cfa; background: rgba(92,124,250,.10); border: 1px solid rgba(92,124,250,.26);
}
/* 渐变字：不支持 background-clip:text 的浏览器自动保留纯色，不会出现“隐形字” */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .login-logo, .brand-name {
    background: linear-gradient(100deg, #8b7cff 0%, #5c8cfa 46%, #22c6c6 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: kBrandFlow 9s ease-in-out infinite;
  }
  /* 标记方块 / 角色标签要还原自己的颜色，否则会被父级的透明填充一起带走 */
  .login-logo span, .brand-badge, .brand-sub {
    background-clip: border-box; -webkit-background-clip: border-box;
    -webkit-text-fill-color: currentColor;
  }
}
@keyframes kBrandFlow {
  0%, 100% { background-position: 0 50%; }
  50%      { background-position: 100% 50%; }
}
.top-actions { display: flex; align-items: center; gap: 14px; }
.msg-btn { position: relative; background: rgba(255,255,255,.1); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.msg-dot {
  position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: #fa5252; animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(250,82,82,.5); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(250,82,82,0); }
}
.top-user-info { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 14px; }

/* 打手端 Tab：PC 顶部横排，手机底部固定 */
.player-tabs { display: flex; background: #fff; box-shadow: var(--shadow); position: sticky; top: 68px; z-index: 99; }
.p-tab {
  flex: 1; text-align: center; padding: 12px 0; cursor: pointer; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px;
  transition: color .25s; position: relative;
}
.p-tab .layui-icon { font-size: 20px; }
.p-tab.active { color: var(--primary); }
.p-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 30%; right: 30%; height: 3px;
  background: var(--primary); border-radius: 2px; animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.player-content { max-width: 1100px; margin: 0 auto; padding: 20px; animation: fadeIn .3s ease; }

/* ============ 任务大厅：头部信息卡 ============ */
.hall-hero {
  position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 16px;
  padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between; color: #fff;
  background: linear-gradient(135deg, #2b2f6b 0%, #4338ca 55%, #6d47d9 100%);
  box-shadow: 0 10px 26px rgba(67,56,202,.28);
}
/* 圆形光斑装饰 */
.hall-hero::before, .hall-hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hall-hero::before { width: 190px; height: 190px; right: -60px; top: -80px; background: rgba(255,255,255,.16); }
.hall-hero::after { width: 120px; height: 120px; right: 90px; bottom: -70px; background: rgba(255,255,255,.10); }
.hall-hero-main { position: relative; display: flex; align-items: center; gap: 14px; min-width: 0; }
.hall-hero .zr-avatar { border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.2); }
.hall-hero-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hall-hero-sub { font-size: 12px; opacity: .85; margin-top: 6px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hall-hero-sub .layui-icon { font-size: 13px; margin-right: 4px; }
.hall-hero-stats { position: relative; display: flex; gap: 10px; }
.hall-stat {
  min-width: 104px; padding: 10px 14px; border-radius: 12px; text-align: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hall-stat .num { font-size: 19px; font-weight: 700; line-height: 1.25; }
.hall-stat .lbl { font-size: 11px; opacity: .82; margin-top: 2px; }
/* 弃单冷却提示条 */
.hall-cool-tip {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 11px 14px;
  border-radius: 12px; font-size: 13px; color: #b35400;
  background: linear-gradient(135deg,#fff4e6,#ffe8cc); border: 1px solid #ffd8a8;
}
.hall-cool-tip .layui-icon { font-size: 16px; }
.hall-cool-tip b { font-variant-numeric: tabular-nums; }

/* ============ 游戏切换：轨道 + 渐变胶囊选中态 ============ */
.game-switch {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; max-width: 100%;
  background: #e9edf5; border-radius: 999px; box-shadow: inset 0 1px 3px rgba(30,45,90,.08);
}
.game-btn {
  flex: 0 0 auto; padding: 9px 24px; border-radius: 999px; border: none;
  background: transparent; font-size: 15px; font-weight: 600; color: var(--text-2);
  cursor: pointer; white-space: nowrap; transition: all .25s cubic-bezier(.4,0,.2,1);
}
.game-btn:hover { color: var(--primary); }
.game-btn.active {
  color: #fff; background: linear-gradient(135deg, var(--primary), #7c5cf6);
  box-shadow: 0 6px 16px rgba(92,124,250,.42);
}

/* ============ 类型筛选：胶囊 + 数量角标 ============ */
.type-filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.type-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none;
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  transition: all .2s cubic-bezier(.4,0,.2,1); -webkit-tap-highlight-color: transparent;
}
.type-chip:hover { border-color: #c7d2fe; color: var(--primary); transform: translateY(-1px); }
.type-chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #7c5cf6);
  box-shadow: 0 6px 14px rgba(92,124,250,.35);
}
.type-chip .chip-num {
  font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 8px;
  background: rgba(92,124,250,.12); color: var(--primary); font-variant-numeric: tabular-nums;
}
.type-chip.active .chip-num { background: rgba(255,255,255,.26); color: #fff; }

/* ============ 任务卡片 ============ */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.task-card {
  position: relative; background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid #eef1f6; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s, border-color .28s;
  animation: cardIn .4s ease backwards;
  cursor: pointer; /* 整卡可点击，鼠标手型提示（cursor 可继承到封面/文字） */
}
.task-card:hover { transform: translateY(-6px); box-shadow: 0 14px 32px rgba(30,45,90,.16); border-color: #c7d2fe; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* 封面 + 角标 */
.task-cover-wrap { position: relative; overflow: hidden; }
.task-cover { width: 100%; height: 150px; object-fit: cover; background: linear-gradient(135deg,#e9edf5,#dbe3f5); transition: transform .4s ease; }
.task-card:hover .task-cover { transform: scale(1.05); }
.task-cover-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 62px;
  background: linear-gradient(to top, rgba(0,0,0,.42), transparent); pointer-events: none;
}
.cover-badge {
  position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, rgba(21,170,191,.92), rgba(11,114,133,.92));
  box-shadow: 0 3px 10px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.cover-badge.special { background: linear-gradient(135deg, rgba(151,117,250,.94), rgba(112,72,232,.94)); }
.cover-hours {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px;
  border-radius: 999px; font-size: 12px; color: #fff; background: rgba(0,0,0,.42);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.cover-hours .layui-icon { font-size: 12px; }
.cover-hours b { font-weight: 600; letter-spacing: .2px; }
.cover-hours.urgent { background: rgba(224,49,49,.78); }  /* 剩余不足 30 分钟 */
.cover-hours.over { background: rgba(134,142,150,.72); }  /* 已超时 */

/* 卡片内容 */
.task-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.task-title { font-size: 15px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-meta:empty { display: none; }
.task-pub { font-size: 12px; color: var(--text-2); margin-left: auto; }  /* 发布时间：右对齐的弱化信息 */
.cover-mode {  /* 封面左上角「双陪」标记，紧跟在类型角标之后 */
  position: absolute; top: 10px; left: 62px; padding: 3px 9px; border-radius: 999px;
  background: rgba(112, 72, 232, .88); color: #fff; font-size: 12px; font-weight: 600;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.task-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 8px; border-top: 1px dashed #eef1f6;
}
.task-price { color: var(--text); font-weight: 600; font-size: 13px; }
.task-price small { font-size: 11px; font-weight: 400; color: var(--text-2); }
.task-hours { font-size: 12px; color: var(--text-2); }
/* 收益区：突出预估收入 */
.task-income-row {
  position: relative; overflow: hidden; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #f3fbf5, #eafaf0); border: 1px solid #d8f3e2;
}
.task-income-row::after {
  content: ''; position: absolute; right: -26px; top: -26px; width: 72px; height: 72px;
  border-radius: 50%; background: rgba(47,158,68,.08); pointer-events: none;
}
.task-income { position: relative; color: var(--success); font-weight: 700; font-size: 18px; line-height: 1.25; }
.task-income small { display: block; font-size: 11px; font-weight: 500; color: #5c8a6a; margin-bottom: 1px; }
.task-tip { position: relative; font-size: 11px; color: var(--text-2); text-align: right; line-height: 1.5; }
/* 底部按钮区：始终贴底，多张卡片高度不齐时按钮仍对齐 */
.task-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

/* 订单卡片 */
.order-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; animation: cardIn .35s ease backwards; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.order-title { font-weight: 600; font-size: 15px; }
.order-no { font-size: 12px; color: var(--text-2); }
.order-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.order-info b { color: var(--text); font-weight: 500; }
.order-ops { display: flex; gap: 10px; flex-wrap: wrap; }
.reject-box { background: #fff5f5; border-left: 3px solid var(--danger); padding: 10px 12px; border-radius: 6px; font-size: 13px; color: #c92a2a; margin-bottom: 12px; }
.deadline-warn { color: var(--warning); font-size: 12px; }

/* 空状态 */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-2); }
.empty-state .layui-icon { font-size: 60px; color: #dee2e6; margin-bottom: 14px; }
.empty-state p { font-size: 14px; }
/* 任务大厅空状态：圆形底色图标 + 副文案 */
.empty-state .empty-art {
  width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #e6ecff); border: 1px solid #dde4ff;
}
.empty-state .empty-art .layui-icon { font-size: 40px; color: #a5b4fc; margin: 0; }
.empty-state .empty-sub { font-size: 12px; margin-top: 6px; opacity: .85; }

/* 钱包卡片 */
.wallet-hero {
  background: linear-gradient(135deg, #1a1a2e, #0f3460); border-radius: 16px; color: #fff;
  padding: 28px 24px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.wallet-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: rgba(92,124,250,.25); border-radius: 50%;
}
.wallet-balance { font-size: 34px; font-weight: 700; margin: 6px 0; }
.wallet-label { font-size: 13px; opacity: .75; }
.wallet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.wallet-mini { background: #fff; border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.wallet-mini .num { font-size: 20px; font-weight: 700; color: var(--primary); }

/* 消息列表 */
.msg-item {
  background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: pointer; position: relative; transition: transform .2s; animation: cardIn .3s ease backwards;
}
.msg-item:hover { transform: translateX(4px); }
.msg-item.unread::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; background: var(--danger); border-radius: 2px; }
.msg-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.msg-item.unread .msg-title::after { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; margin-left: 6px; animation: breathe 1.6s infinite; }
.msg-content { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-time { font-size: 12px; color: #adb5bd; margin-top: 6px; }

/* ============ 弹窗内通用 ============ */
.popup-form { padding: 20px 20px 6px; max-height: 68vh; overflow-y: auto; }
.popup-form .zr-field { margin-bottom: 14px; }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.upload-box { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-item { position: relative; width: 90px; height: 90px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .del {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
}
.upload-add {
  width: 90px; height: 90px; border: 1.5px dashed #ced4da; border-radius: 8px; background: #f8f9fa;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; color: var(--text-2); font-size: 12px; transition: all .2s;
}
.upload-add:hover { border-color: var(--primary); color: var(--primary); }
.upload-add .layui-icon { font-size: 24px; }

/* ---- 图片裁剪弹窗（封面 16:9 / 头像 1:1） ---- */
.zr-crop-box { width: 100%; max-height: 62vh; background: #14122a; border-radius: 12px; overflow: hidden; }
.zr-crop-box img { display: block; max-width: 100%; max-height: 58vh; margin: 0 auto; }
.zr-crop-tip { margin-top: 10px; font-size: 12px; color: var(--text-2); text-align: center; }
/* Cropper 默认取景框太细，这里加粗并统一成品牌色 */
.zr-crop-box .cropper-view-box { outline: 2px solid rgba(124,92,255,.95); outline-color: rgba(124,92,255,.95); }
.zr-crop-box .cropper-line { background-color: rgba(124,92,255,.95); }
.zr-crop-box .cropper-point { width: 8px; height: 8px; background-color: #7c5cff; }
.zr-crop-box .cropper-dashed { border-color: rgba(255,255,255,.35); }
.detail-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.detail-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.detail-imgs img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.detail-desc { background: #f8f9fa; border-radius: 8px; padding: 12px; font-size: 13px; color: #495057; white-space: pre-wrap; word-break: break-word; }
.detail-row { display: flex; font-size: 13px; padding: 8px 0; border-bottom: 1px dashed #f1f3f5; }
.detail-row .k { color: var(--text-2); width: 90px; flex-shrink: 0; }
.detail-row .v { flex: 1; word-break: break-all; }
.delivery-block { background: #f8f9fa; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.delivery-block .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }

/* ============ Loading / Toast ============ */
.page-loading {
  position: fixed; inset: 0; background: rgba(255,255,255,.7); z-index: 9999;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.page-loading.show { opacity: 1; visibility: visible; }
.spinner {
  width: 44px; height: 44px; border: 3.5px solid #e7eaf3; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.zr-toast {
  position: fixed; top: 20%; left: 50%; transform: translateX(-50%); z-index: 99999999;
  background: rgba(33,37,41,.88); color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 14px; animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); max-width: 82vw; text-align: center;
}
.zr-toast.success { background: rgba(47,158,68,.92); }
.zr-toast.error { background: rgba(224,49,49,.92); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -16px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.zr-toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -12px); } }

/* layer 弹窗毛玻璃淡入缩放（both 填充模式消除闪白；半透明白底 + backdrop-filter 做毛玻璃） */
.layui-layer {
  animation: layerIn .3s cubic-bezier(.2,.8,.3,1) both !important;
  border-radius: 14px !important; overflow: hidden;
  transform-origin: center center;
  background: rgba(255,255,255,0.85) !important;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
@keyframes layerIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.layui-layer-title {
  background: rgba(248,249,250,0.75) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 600 !important;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.layui-layer-page .layui-layer-content { overflow-y: auto; }

/* 图片查看弹窗（ZR.imgView）：自绘关闭按钮，避免 layui 框外按钮被 overflow:hidden 裁掉 */
.zr-view-wrap { position: relative; padding: 10px; background: #14122a; }
.zr-view-wrap img { border-radius: 8px; }
.zr-view-close {
  position: absolute; right: 8px; top: 8px; z-index: 3;
  width: 28px; height: 28px; line-height: 26px; text-align: center;
  font-size: 15px; color: #fff; cursor: pointer; user-select: none;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.42); border-radius: 50%;
  transition: background .2s, transform .2s;
}
.zr-view-close:hover { background: var(--danger); transform: scale(1.08); }

/* ============ 弹窗遮罩毛玻璃渐变（自定义 keyframe 避免 fadeIn 把遮罩拉到全黑） ============ */
.layui-layer-shade {
  background: rgba(20,20,30,0.35) !important;
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  animation: shadeIn .35s ease both !important;
}
@keyframes shadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ 动画工具 ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .3s ease; }

/* ============ 抽成预览（任务发布/编辑弹窗，前端仅预览不结算） ============ */
.commission-preview {
  background: linear-gradient(135deg, #f8f9ff, #eef2ff); border: 1px solid #e0e7ff;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.commission-preview .preview-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 3px 0; color: var(--text-2);
}
.commission-preview .preview-row .v { font-weight: 700; color: var(--text); transition: color .2s; }
.commission-preview .preview-tip { font-size: 11px; color: var(--text-2); margin-top: 6px; opacity: .85; }

/* ============ 图片加载渐进淡入（仅内容大图，上传缩略图不参与） ============ */
.task-cover, .detail-cover, .detail-imgs img {
  opacity: 0; transition: opacity .4s ease;
}
.task-cover.loaded, .detail-cover.loaded, .detail-imgs img.loaded { opacity: 1; }

/* ============ 头像 ============ */
.zr-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #5c7cfa, #4c6ef5); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; overflow: hidden; flex-shrink: 0;
}
.zr-avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.zr-avatar.lg { width: 80px; height: 80px; font-size: 30px; }
.zr-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ 聊天会话列表 ============ */
.chat-wrap { display: flex; height: 70vh; min-height: 480px; }
.chat-list {
  width: 220px; border-right: 1px solid rgba(0,0,0,.06); overflow-y: auto;
  background: rgba(255,255,255,.4);
}
.chat-list-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  cursor: pointer; border-bottom: 1px solid rgba(0,0,0,.04); transition: background .15s;
}
.chat-list-item:hover { background: rgba(92,124,250,.08); }
.chat-list-item.active { background: rgba(92,124,250,.12); }
.chat-list-item .ci-info { flex: 1; min-width: 0; }
.chat-list-item .ci-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item .ci-preview { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item .ci-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e03131; color: #fff; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-list-item .ci-badge:empty { display: none; }
.chat-empty { padding: 30px; text-align: center; color: var(--text-2); font-size: 13px; }

/* 聊天窗口 */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-header {
  padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,.06);
  font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.chat-body {
  flex: 1; padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { display: flex; gap: 8px; max-width: 80%; animation: fadeIn .2s ease; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .msg-body {
  background: #f1f3f5; padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5;
  word-break: break-word; position: relative;
}
.chat-msg.me .msg-body { background: linear-gradient(135deg, #5c7cfa, #4c6ef5); color: #fff; }
.chat-msg .msg-meta { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.chat-msg.me .msg-meta { text-align: right; color: rgba(255,255,255,.7); }
.chat-input {
  padding: 10px 14px; border-top: 1px solid rgba(0,0,0,.06);
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid rgba(0,0,0,.1); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; line-height: 1.5; font-family: inherit;
  min-height: 40px; max-height: 120px;
}
.chat-input textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(92,124,250,.1); }
.chat-editor .ct-send { padding: 8px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }

/* ============ 响应式：手机端 ============ */
@media (max-width: 900px) {
  .admin-side { transform: translateX(-100%); }
  .admin-side.open { transform: translateX(0); }
  .side-mask.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150; animation: fadeIn .25s; }
  .admin-main { margin-left: 0; }
  .top-menu-btn { display: block; }
  .admin-content { padding: 14px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  /* 任务卡片自动缩放：单列 */
  .task-grid { grid-template-columns: 1fr; gap: 12px; }
  .task-cover { height: 130px; }
  /* 任务大厅：信息卡改为上下两段，数据块等宽铺开 */
  .hall-hero { padding: 16px; border-radius: 14px; gap: 14px; }
  .hall-hero-name { font-size: 16px; }
  .hall-hero-stats { width: 100%; }
  .hall-stat { flex: 1; min-width: 0; padding: 9px 10px; }
  .hall-stat .num { font-size: 17px; }
  .game-btn { padding: 8px 20px; font-size: 14px; }
  /* 触摸按钮放大 */
  .zr-btn { min-height: 44px; padding: 10px 20px; }
  .zr-btn-sm { min-height: 38px; }
  .zr-btn-xs { min-height: 34px; padding: 4px 12px; }
  /* 打手端 Tab 固定底部 */
  .player-body { padding-bottom: 76px; }
  .player-tabs {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 200;
    border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .p-tab { padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
  .p-tab.active::after { bottom: auto; top: 0; }
  .player-content { padding: 14px 12px; }
  .top-user-info .user-name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 弹窗全屏化 */
  .layui-layer-page { max-width: 94vw !important; }
  .form-grid2 { grid-template-columns: 1fr; }
  .order-info { grid-template-columns: 1fr; }
  .detail-imgs { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 42px; height: 42px; font-size: 19px; }
  .stat-num { font-size: 19px; }
  .wallet-row { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .toolbar input, .toolbar select { flex: 1; min-width: 0; }
  /* 顶栏品牌：窄屏收紧胶囊，避免挤压右侧按钮 */
  .player-top { padding: 14px 12px; }
  .top-actions { gap: 10px; }
  .top-brand { gap: 7px; padding: 5px 10px 5px 5px; border-radius: 12px; }
  .brand-badge { width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }
  .brand-name { font-size: 14px; letter-spacing: .2px; }
  .brand-sub { padding: 2px 7px; font-size: 10px; letter-spacing: .2px; }
  .top-user-info .user-name { max-width: 48px; }
  .top-user-info .level-tag { display: none; } /* 顶栏空间有限，等级在「我的」页查看 */
}
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .game-btn { padding: 8px 15px; font-size: 13px; }
  .hall-stat .num { font-size: 15px; }
}

/* ============================================================
   通讯录 / 在线状态 / 好友（v3）
   ============================================================ */

/* 头像 + 在线状态小圆点 */
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.online-dot {
  position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #fff; background: #adb5bd;
  transition: background .2s;
}
.online-dot.idle { background: #2f9e44; }
.online-dot.busy { background: #f08c00; }
.online-dot.offline { background: #adb5bd; }

/* 在线状态文字（颜色仅由旁边的圆点标识，避免出现两个圆点） */
.online-text { display: inline-block; font-size: 12px; color: var(--text-2); }

/* 聊天左栏（含子标签 + 搜索） */
.chat-side {
  width: 268px; border-right: 1px solid rgba(0,0,0,.06); background: rgba(255,255,255,.45);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-side .cs-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chat-side .chat-list { width: auto; height: auto; border-right: none; background: transparent; overflow: visible; }

/* 子标签（会话 / 通讯录 / 好友） */
.sub-tabs { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.06); flex-wrap: wrap; }
.sb-tab {
  position: relative; padding: 5px 12px; border-radius: 16px; font-size: 13px; cursor: pointer;
  color: var(--text-2); background: rgba(0,0,0,.04); transition: all .2s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.sb-tab:hover { background: rgba(92,124,250,.1); color: var(--primary); }
.sb-tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.sb-tab .sb-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e03131; color: #fff;
  font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
  margin-left: 4px; vertical-align: 1px;
}

/* 搜索框 */
.search-box { padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.05); }
.search-box input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(92,124,250,.1); }

/* 通讯录条目 */
.contact-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background .18s ease, transform .18s ease;
}
.contact-item:hover { background: rgba(92,124,250,.06); }
.contact-item:active { transform: scale(.99); }
.contact-item.active { background: rgba(92,124,250,.12); }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.contact-name .cn-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-sub {
  font-size: 12px; color: var(--text-2); margin-top: 3px; display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
.contact-ops { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
/* 操作按钮加大点击热区，避免误触到条目（打开资料卡） */
.contact-ops .zr-btn { min-height: 34px; padding: 6px 16px; font-size: 13px; border-radius: 8px; }

/* 列表分组小标题 */
.list-sep {
  padding: 8px 12px 4px; font-size: 12px; color: var(--text-2); background: rgba(0,0,0,.015);
}

/* 好友申请卡片 */
.req-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  animation: fadeIn .25s ease;
}
.req-card .req-ops { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }

/* 打手资料卡 */
.profile-card { text-align: center; padding: 8px 0 0; }
.profile-card .pc-name { font-size: 18px; font-weight: 700; margin-top: 10px; }
.profile-card .pc-sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.profile-card .pc-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0 2px; }
.profile-card .pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.profile-card .pc-stat { background: #f8f9ff; border-radius: 10px; padding: 10px 6px; }
.profile-card .pc-num { font-size: 17px; font-weight: 700; }
.profile-card .pc-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 双陪组队状态条 */
.team-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px;
  padding: 8px 10px; border-radius: 8px; background: #f4f1ff; color: #5f3dc4; margin-top: 8px;
}
.team-bar.pending { background: #fff9db; color: #b08c00; }
.team-bar.done { background: #ebfbee; color: #2b8a3e; }
.team-bar.need { background: #fff0f6; color: #c2255c; }  /* 双陪任务：队友未确认，暂不可交付 */

/* 手机端：左栏对话列表横向滚动 */
@media (max-width: 640px) {
  .chat-wrap { flex-direction: column; height: auto; min-height: 0; }
  .chat-side { width: 100%; border-right: none; border-bottom: 1px solid rgba(0,0,0,.06); max-height: 46vh; }
  .chat-side .chat-list { display: flex; overflow-x: auto; }
  .chat-side .chat-list .chat-list-item {
    min-width: 176px; border-bottom: none; border-right: 1px solid rgba(0,0,0,.05);
  }
  .chat-main { min-height: 340px; }
  .profile-card .pc-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* ============ v4 平滑过渡 & 新消息提醒 ============ */
.chat-wrap { transition: height .2s ease; }
.chat-list-item { transition: background .18s ease, transform .18s ease; }
.chat-list-item:active { transform: scale(.99); }
.chat-main { transition: opacity .2s ease; }
.chat-msg { animation: msgIn .22s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cs-body, .chat-body { scroll-behavior: smooth; }
.list-sep + .contact-item { animation: fadeIn .2s ease both; }

/* 新消息浮层提醒（点击可跳转会话） */
.zr-msg-noti {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(30,45,90,.18);
  border-left: 4px solid var(--primary); transition: transform .18s ease, box-shadow .18s ease;
}
.zr-msg-noti:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(30,45,90,.24); }
.zr-msg-noti .mn-body { flex: 1; min-width: 0; }
.zr-msg-noti .mn-title { font-size: 13px; font-weight: 700; color: var(--text); }
.zr-msg-noti .mn-text {
  font-size: 12px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zr-msg-noti .mn-tip { font-size: 11px; color: var(--primary); margin-top: 3px; }
/* 浮层提醒的 layer 外观：去掉默认内边距与白底，仅保留卡片本身 */
.zr-noti-layer { background: transparent; box-shadow: none; }
.zr-noti-layer .layui-layer-content { padding: 0; }

/* ============================================================
   聊天管理 v14：卡通果冻主题（合并重写原 v5~v13 共 9 段聊天样式）
   ------------------------------------------------------------
   设计语言
     · 卡通：饱满大圆角 + 深色墨线描边 + 贴纸式硬投影 + 高饱和柔色
     · 毛玻璃：半透明面板 + backdrop-filter，底层铺高饱和彩色光斑，
       让面板背后有真实颜色过渡可被模糊（纯白对纯白是看不出玻璃的）
     · 果冻：统一弹性曲线 --k-spring，交互元素悬停上浮并轻微过冲
   约束：DOM 与 id 全部未改动，业务逻辑零改动。
   注意：媒体查询不增加优先级，手机端覆盖必须放在本段最末重新声明。
   ============================================================ */
.chat-wrap {
  /* 卡通墨线 */
  --k-ink: #332e52;
  --k-line: rgba(51,46,82,.88);
  --k-line-soft: rgba(51,46,82,.3);
  /* 高饱和柔色（卡通配色） */
  --k-main: #7c5cff;
  --k-main-d: #5b3fd6;
  --k-mint: #34d399;
  --k-sky: #60a5fa;
  --k-peach: #fbbf24;
  --k-pink: #f472b6;
  /* 动效曲线 */
  --k-spring: cubic-bezier(.34,1.56,.64,1);
  --k-ease: cubic-bezier(.4,0,.2,1);

  position: relative; z-index: 0;
  border: 2px solid var(--k-line);
  border-radius: 20px;
  overflow: hidden;
  background: #f1f3ff;
}
/* —— 底层：高饱和彩色光斑（毛玻璃的视觉基底） —— */
.chat-wrap::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-color: #f2f4ff;
  background-image:
    radial-gradient(340px 300px at 6% 4%,   rgba(139,124,255,.62), transparent 68%),
    radial-gradient(300px 260px at 96% 10%, rgba(96,165,250,.58),  transparent 68%),
    radial-gradient(360px 300px at 88% 92%, rgba(244,114,182,.50), transparent 70%),
    radial-gradient(320px 280px at 12% 96%, rgba(52,211,153,.52),  transparent 70%),
    radial-gradient(260px 220px at 50% 50%, rgba(251,191,36,.30),  transparent 72%),
    radial-gradient(240px 200px at 68% 30%, rgba(167,139,250,.44), transparent 70%),
    linear-gradient(160deg, #f7f5ff 0%, #eff2ff 52%, #eaf7ff 100%);
}
.chat-main { position: relative; background: transparent; }

/* —— 三块玻璃面板 —— */
.chat-side, .chat-header, .chat-input {
  background: rgba(255,255,255,.44);
  -webkit-backdrop-filter: blur(22px) saturate(1.85);
  backdrop-filter: blur(22px) saturate(1.85);
}
.chat-side {
  border-right: 2px solid var(--k-line);
  box-shadow: 6px 0 18px rgba(51,46,82,.12);
}
.chat-side .cs-body { overflow-x: hidden; overflow-y: auto; }
.chat-header {
  padding: 13px 18px; min-height: 64px;
  border-bottom: 2px solid var(--k-line);
  box-shadow: 0 6px 18px rgba(51,46,82,.10);
}
.chat-input {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 11px 13px 13px;
  border-top: 2px solid var(--k-line);
  box-shadow: 0 -6px 18px rgba(51,46,82,.10);
}

/* —— 左栏子标签：卡通胶囊 —— */
.chat-side .sub-tabs {
  background: rgba(255,255,255,.3);
  border-bottom: 2px solid var(--k-line);
  padding: 10px; gap: 8px;
}
.sb-tab {
  padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #55507a;
  border: 2px solid var(--k-line);
  background: rgba(255,255,255,.88);
  box-shadow: 0 3px 0 var(--k-line-soft);
}
.sb-tab:hover {
  color: var(--k-main-d);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 5px 0 var(--k-line-soft);
}
.sb-tab:active { transform: translateY(1px) scale(.97); box-shadow: 0 1px 0 var(--k-line-soft); }
.sb-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #9b8bff 0%, #7c5cff 62%, #5b3fd6 100%);
  box-shadow: 0 3px 0 var(--k-main-d), inset 0 2px 0 rgba(255,255,255,.5);
}
.chat-side .sb-badge {
  border: 2px solid var(--k-line); background: #ff6b6b; color: #fff; font-weight: 800;
}

/* —— 搜索框 —— */
.chat-side .search-box {
  background: rgba(255,255,255,.28);
  border-bottom: 2px solid var(--k-line-soft);
  padding: 10px;
}
.chat-side .search-box input {
  border-radius: 999px; border: 2px solid var(--k-line-soft);
  background: rgba(255,255,255,.94); padding: 9px 15px; font-size: 13px;
  box-shadow: inset 0 2px 5px rgba(51,46,82,.08);
}
.chat-side .search-box input:focus {
  border-color: var(--k-main); background: #fff;
  box-shadow: 0 0 0 4px rgba(124,92,255,.2);
}

/* —— 最近联系（管理端） —— */
.ad-recent { padding: 10px; border-bottom: 2px solid var(--k-line-soft); }
.ad-recent-title { font-size: 11px; font-weight: 700; color: #7a7499; letter-spacing: .5px; margin-bottom: 8px; }
.ad-recent-list { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-recent .ar-item {
  width: 54px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; border-radius: 14px; cursor: pointer; border: 2px solid transparent;
}
.ad-recent .ar-item:hover {
  background: #fff; border-color: var(--k-line-soft);
  transform: translateY(-3px); box-shadow: 0 5px 0 var(--k-line-soft);
}
.ad-recent .ar-item.active { background: rgba(124,92,255,.16); border-color: var(--k-main); }
.ad-recent .ar-name {
  max-width: 100%; font-size: 11px; color: #5b5578;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ad-recent .ar-item.active .ar-name { color: var(--k-main-d); font-weight: 700; }

/* —— 会话 / 通讯录条目 —— */
.contact-item, .chat-list-item {
  background: rgba(255,255,255,.2);
  border-bottom: 2px solid var(--k-line-soft);
  box-shadow: inset 0 0 0 rgba(124,92,255,0);
}
.contact-item:hover, .chat-list-item:hover {
  background: rgba(255,255,255,.92);
  transform: none;
  box-shadow: inset 5px 0 0 var(--k-sky);
}
.contact-item.active, .chat-list-item.active {
  background: rgba(124,92,255,.16);
  transform: none;
  box-shadow: inset 5px 0 0 var(--k-main);
}
.chat-list-item .ci-name { color: #2f2a4a; }
.chat-list-item .ci-preview { color: #6e6890; }
.chat-list-item .ci-right {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; margin-left: 4px; padding-top: 2px;
}
.chat-list-item .ci-time { font-size: 11px; color: #8b86a8; white-space: nowrap; }
.chat-list-item .ci-count {
  display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px;
  background: rgba(124,92,255,.16); color: var(--k-main-d);
  font-size: 11px; font-weight: 700; line-height: 17px; vertical-align: 1px;
}
.chat-list-item .ci-badge { background: #ff6b6b; border: 2px solid var(--k-line); }
.chat-list-item .ci-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #ff6b6b;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(255,107,107,.4);
}
.chat-list-item.unread .ci-name { color: #1f1b3a; }
.chat-list-item.unread .ci-preview { color: #4a4468; font-weight: 600; }
.ci-av-icon {
  border: 2px solid var(--k-line);
  background: linear-gradient(135deg, #a78bfa, #7c5cff); color: #fff;
}
.zr-avatar.sq { border-radius: 9px; }
.zr-avatar.xs { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }

/* —— 右栏头部 —— */
.chat-header .ch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-header .ch-name {
  font-size: 15px; font-weight: 800; color: #241f3d;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-header .ch-sub {
  font-size: 12px; color: #6e6890; font-weight: 400;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; white-space: normal; overflow: visible;
}
.chat-header .ch-empty { font-size: 13px; color: #6e6890; font-weight: 400; }
.chat-header .ch-ops { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.chat-header .ch-pill {
  display: inline-block; padding: 2px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  border: 2px solid var(--k-line-soft);
  background: rgba(255,255,255,.9); color: #5b5578;
}
.chat-header .level-tag, .chat-header .tag { font-size: 11px; padding: 1px 9px; border-radius: 999px; }
.ch-stack { display: inline-flex; align-items: center; }
.ch-stack .ch-stack-i + .ch-stack-i { margin-left: -7px; }
.ch-stack .ch-stack-i .zr-avatar { border: 2px solid var(--k-line); box-shadow: 0 0 0 2px #fff; }
.ch-stack .ch-stack-more { margin-left: 6px; font-size: 12px; font-weight: 700; color: #6e6890; }
.ch-stack:empty { display: none; }

/* —— 禁用账号警示条 —— */
.chat-alert {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 9px 18px; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, #fff1f1, #ffe0e0);
  color: #c92a2a; border-bottom: 2px solid rgba(201,42,42,.55);
  animation: kAlertIn .38s var(--k-spring) both;
}
.chat-alert .layui-icon { font-size: 15px; }

/* —— 消息区 —— */
.chat-body {
  background: transparent; padding: 18px 20px; gap: 14px;
  overflow-x: hidden;
}
.msg-time-sep { text-align: center; margin: 2px 0; }
.msg-time-sep span {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: rgba(255,255,255,.84); border: 2px solid var(--k-line-soft);
  color: #7a7499; font-size: 11px; font-weight: 600;
}
.chat-msg { max-width: 78%; align-items: flex-start; animation: kJellyIn .42s var(--k-spring) both; }
.chat-msg .msg-col { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.chat-msg.me .msg-col { align-items: flex-end; }
/* 气泡：卡通贴纸（墨线描边 + 硬投影） */
.chat-msg .msg-body {
  padding: 10px 15px; font-size: 14px; line-height: 1.6;
  border-radius: 18px 18px 18px 6px;
  border: 2px solid var(--k-line);
  background: rgba(255,255,255,.96);
  box-shadow: 0 3px 0 rgba(51,46,82,.18);
}
.chat-msg.me .msg-body {
  border-radius: 18px 18px 6px 18px;
  border-color: var(--k-main-d); color: #fff;
  background: linear-gradient(135deg, #9b8bff 0%, #7c5cff 58%, #5b3fd6 100%);
  box-shadow: 0 3px 0 var(--k-main-d), inset 0 2px 0 rgba(255,255,255,.45);
}
.chat-msg .msg-meta { font-size: 11px; color: #8b86a8; margin-top: 5px; padding: 0 4px; }
/* color 必须显式重置：上方第 454 行的 .chat-msg.me .msg-meta 是白色（当年气泡内文字用），
   但 meta 实际在气泡外、位于浅色消息区上，不重置会看不见 */
.chat-msg.me .msg-meta { text-align: right; color: #8b86a8; }
/* 图片 / 视频：必须带 .chat-msg 前缀才能压过 .chat-msg .msg-body 的内边距 */
.chat-msg .msg-body-media {
  padding: 5px; border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,.96); border-color: var(--k-line);
}
.chat-msg.me .msg-body-media { background: rgba(255,255,255,.22); border-color: var(--k-main-d); }
.msg-img {
  max-width: 220px; max-height: 260px; border-radius: 12px;
  object-fit: cover; cursor: zoom-in;
}
.msg-video { width: 260px; max-width: 58vw; border-radius: 12px; display: block; background: #000; }
/* 语音 */
.chat-msg .msg-body-voice {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  min-width: 96px; user-select: none; -webkit-tap-highlight-color: transparent;
}
.mv-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.mv-bars i { width: 3px; height: 6px; border-radius: 2px; background: currentColor; opacity: .6; transform-origin: bottom; }
.mv-bars i:nth-child(2) { height: 12px; }
.mv-bars i:nth-child(3) { height: 9px; }
.mv-sec { font-size: 12px; opacity: .85; }
.msg-body-voice.playing .mv-bars i { opacity: 1; animation: kVoiceBar .9s ease-in-out infinite; }
.msg-body-voice.playing .mv-bars i:nth-child(2) { animation-delay: .15s; }
.msg-body-voice.playing .mv-bars i:nth-child(3) { animation-delay: .3s; }

/* —— 输入区：工具栏 —— */
.chat-tools { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.ct-btn {
  width: 36px; height: 36px; border-radius: 12px; font-size: 18px; cursor: pointer;
  border: 2px solid var(--k-line-soft);
  background: rgba(255,255,255,.88); color: #5b5578;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--k-line-soft);
  -webkit-tap-highlight-color: transparent;
}
.ct-btn:hover {
  color: var(--k-main-d); border-color: var(--k-main);
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 5px 0 var(--k-main-d);
}
.ct-btn:active { transform: translateY(1px) scale(.94); box-shadow: 0 1px 0 var(--k-line-soft); }
.ct-voice.recording {
  background: linear-gradient(135deg, #ff8787, #e03131); color: #fff;
  border-color: #c92a2a; animation: kRecPulse 1s ease-in-out infinite;
}
.ct-tip {
  font-size: 12px; font-weight: 600; color: #6e6890; margin-left: 4px; opacity: 0;
  transition: opacity .2s var(--k-ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-tip.show { opacity: 1; color: var(--k-main-d); }

/* —— 输入区：输入框 + 发送键 —— */
.chat-editor { display: flex; align-items: flex-end; gap: 10px; }
.chat-editor .chat-textarea {
  flex: 1; resize: none; height: 48px; min-height: 48px; max-height: 140px;
  padding: 11px 16px; border-radius: 16px;
  border: 2px solid var(--k-line-soft);
  background: rgba(255,255,255,.94);
  font-size: 14px; line-height: 1.55; font-family: inherit;
  box-shadow: inset 0 2px 5px rgba(51,46,82,.08);
}
.chat-editor .chat-textarea::placeholder { color: #a09bc0; }
.chat-editor .chat-textarea:focus {
  outline: none; border-color: var(--k-main); background: #fff;
  box-shadow: 0 0 0 4px rgba(124,92,255,.2);
}
.chat-editor .ct-send {
  flex-shrink: 0; height: 48px; min-height: 48px; padding: 0 26px; border-radius: 16px;
  font-size: 14px; font-weight: 800; letter-spacing: 1px; color: #fff;
  border: 2px solid var(--k-main-d);
  background: linear-gradient(135deg, #9b8bff 0%, #7c5cff 58%, #5b3fd6 100%);
  box-shadow: 0 4px 0 var(--k-main-d), inset 0 2px 0 rgba(255,255,255,.45);
}
.chat-editor .ct-send:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 0 var(--k-main-d), inset 0 2px 0 rgba(255,255,255,.55);
}
.chat-editor .ct-send:active {
  transform: translateY(2px) scale(.97);
  box-shadow: 0 1px 0 var(--k-main-d), inset 0 2px 0 rgba(255,255,255,.4);
}

/* —— 表情面板 —— */
.zr-emoji-panel {
  position: absolute; left: 12px; right: 12px; bottom: 100%; margin-bottom: 8px;
  padding: 10px; z-index: 40;
  border: 2px solid var(--k-line); border-radius: 18px;
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 6px 0 var(--k-line-soft), 0 16px 34px rgba(51,46,82,.2);
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  max-height: 208px; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.96);
  transition: opacity .2s var(--k-ease),
              transform .26s var(--k-spring),
              visibility .2s var(--k-ease);
}
.zr-emoji-panel.show { opacity: 1; visibility: visible; transform: none; }
.zr-emoji-panel .ze-item {
  font-size: 20px; line-height: 1; text-align: center; padding: 6px 0;
  cursor: pointer; border-radius: 10px; user-select: none;
}
.zr-emoji-panel .ze-item:hover { background: rgba(124,92,255,.18); transform: scale(1.12); }

/* —— 未选中会话的空状态 —— */
.chat-blank {
  margin: auto; padding: 24px; text-align: center; max-width: 420px;
  animation: kJellyPop .42s var(--k-spring) both;
}
.chat-blank .cb-icon {
  width: 78px; height: 78px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 33px; color: #fff;
  border: 2px solid var(--k-line);
  background: linear-gradient(135deg, #9b8bff, #7c5cff);
  box-shadow: 0 5px 0 var(--k-main-d);
}
.chat-blank .cb-title { font-size: 16px; font-weight: 800; color: #241f3d; }
.chat-blank .cb-sub { font-size: 13px; color: #6e6890; margin-top: 6px; }
.chat-blank .cb-recent { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.chat-blank .cb-r-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px 5px 5px;
  border-radius: 999px; border: 2px solid var(--k-line-soft);
  background: rgba(255,255,255,.92);
  font-size: 12px; font-weight: 600; color: #4a4468; cursor: pointer;
}
.chat-blank .cb-r-item:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--k-main); color: var(--k-main-d);
  box-shadow: 0 5px 0 var(--k-line-soft);
}

/* —— 统一过渡：只用 transform / box-shadow / opacity / 颜色 —— */
.chat-wrap .zr-btn, .chat-wrap .ct-btn, .chat-wrap .sb-tab,
.chat-wrap .contact-item, .chat-wrap .chat-list-item,
.chat-wrap .chat-textarea, .chat-wrap .search-box input,
.chat-wrap .chat-editor .ct-send, .chat-header .ch-pill,
.ad-recent .ar-item, .chat-blank .cb-r-item, .zr-emoji-panel .ze-item {
  transition: background-color .22s var(--k-ease),
              color .22s var(--k-ease),
              border-color .22s var(--k-ease),
              box-shadow .28s var(--k-spring),
              transform .28s var(--k-spring),
              opacity .22s var(--k-ease);
}

/* —— 果冻关键帧 —— */
@keyframes kJellyIn {
  0%   { opacity: 0; transform: translateY(14px) scale(.9); }
  62%  { opacity: 1; transform: translateY(-4px) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes kJellyPop {
  0%   { opacity: 0; transform: scale(.85); }
  60%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes kAlertIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes kVoiceBar {
  0%, 100% { transform: scaleY(.5); }
  50%      { transform: scaleY(1.6); }
}
@keyframes kRecPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,49,49,.5); }
  50%      { box-shadow: 0 0 0 9px rgba(224,49,49,0); }
}

/* —— 通讯录操作按钮：桌面端悬停浮现，避免遮挡姓名 —— */
@media (hover: hover) and (pointer: fine) {
  .chat-wrap .contact-item .contact-ops {
    opacity: 0; pointer-events: none;
    transition: opacity .2s var(--k-ease);
  }
  .chat-wrap .contact-item:hover .contact-ops,
  .chat-wrap .contact-item.active .contact-ops { opacity: 1; pointer-events: auto; }
}

/* —— 不支持 backdrop-filter：退回不透明底色 —— */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .chat-side, .chat-header, .chat-input { background: #fbfaff; }
  .zr-emoji-panel { background: #fff; }
}

/* —— 手机端：关闭毛玻璃与重动效，保留墨线层次（必须放最后重新声明） —— */
@media (max-width: 640px) {
  .chat-wrap { flex-direction: column; height: auto; min-height: 0; border-radius: 16px; }
  .chat-side {
    width: 100%; max-height: 46vh;
    border-right: none; border-bottom: 2px solid var(--k-line);
    box-shadow: 0 6px 16px rgba(51,46,82,.1);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #fdfcff;
  }
  .chat-side .chat-list { display: flex; overflow-x: auto; }
  .chat-side .chat-list .chat-list-item {
    min-width: 176px; border-bottom: none; border-right: 2px solid var(--k-line-soft);
  }
  .chat-main { min-height: 340px; }
  .chat-header, .chat-input {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #fff;
  }
  .chat-wrap::before { opacity: .55; }
  .chat-header { padding: 11px 14px; min-height: 58px; }
  .chat-header .ch-ops .zr-btn { padding: 5px 10px; }
  .chat-body { padding: 13px; gap: 11px; }
  .chat-msg { max-width: 86%; animation-duration: .3s; }
  .msg-img { max-width: 168px; max-height: 200px; }
  .msg-video { width: 200px; }
  .chat-input { padding: 9px 10px 11px; gap: 7px; }
  .chat-tools { gap: 6px; min-height: 44px; }
  .ct-btn { width: 42px; height: 42px; font-size: 20px; border-radius: 13px; }
  .ct-tip { font-size: 12px; }
  /* 手机端与桌面端保持同一基准高度 48px，避免发送键与输入框错位 */
  .chat-editor .chat-textarea { height: 48px; min-height: 48px; padding: 11px 14px; border-radius: 14px; }
  .chat-editor .ct-send { height: 48px; min-height: 48px; padding: 0 20px; border-radius: 14px; letter-spacing: 0; }
  .zr-emoji-panel { grid-template-columns: repeat(7, 1fr); max-height: 176px; }
  .chat-alert { padding: 8px 14px; font-size: 12px; }
  .chat-blank { padding: 16px; }
  .chat-blank .cb-icon { width: 64px; height: 64px; font-size: 26px; margin-bottom: 12px; }
}
