/* ====== ZT局域网共享办公系统 ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --primary:#1a6dd4;
  --primary-dark:#1259b4;
  --primary-light:#e8f1fc;
  --bg:#eef2f7;
  --panel:#ffffff;
  --text:#2c3e50;
  --text-sub:#8a97a5;
  --border:#dfe6ee;
  --bubble-other:#ffffff;
  --bubble-self:#95ec69;        /* 微信默认：自己发出的绿色气泡 */
  --chat-bg:#ededed;            /* 微信默认：聊天区浅灰背景 */
}
body.theme-teal   { --primary:#0e9f8a; --primary-dark:#0b8574; --primary-light:#e2f5f2; }
body.theme-purple { --primary:#7c5cd6; --primary-dark:#6549bd; --primary-light:#efeafc; }
body.theme-red    { --primary:#d64541; --primary-dark:#b93430; --primary-light:#fceaea; }
body.theme-green  { --primary:#2e9e4f; --primary-dark:#238340; --primary-light:#e6f6ea; }
body.theme-navy   { --primary:#34495e; --primary-dark:#2a3b4d; --primary-light:#e9eef4; }

body.theme-dark{
  --bg:#12161d; --panel:#1c2230; --text:#d7dee8; --text-sub:#7f8ba0;
  --border:#2a3345; --primary-light:#22304a; --bubble-other:#252d3d;
  --chat-bg:#12161d; --bubble-self:#2e7d4f;
}

body { font-family:"Microsoft YaHei","PingFang SC",sans-serif; background:var(--bg); color:var(--text); }
.hidden { display:none !important; }
.muted { color:var(--text-sub); font-size:12px; }

/* Logo（ZT立体字母 + 闭环双箭头，深蓝+金色） */
.logo-img { display:block; }
.logo-img.lg { width:120px; height:120px; margin:0 auto 10px;
  filter:drop-shadow(0 6px 16px rgba(0,0,0,.18)); }
.logo-img.sm { width:30px; height:30px; flex:none; background:#fff;
  border-radius:8px; padding:2px; box-shadow:0 1px 4px rgba(0,0,0,.15); }
.gold { background:#c8921a !important; color:#fff !important; }
.btn.gold { background:linear-gradient(135deg,#e8b32a,#c8921a); }
.btn.gold:hover { background:#a87c14; }
/* 拍一拍：整个窗口左右上下抖动（幅度递增再收回，带一点旋转更像“被拍了一下”） */
@keyframes shakeit {
  0%,100% { transform:translate(0,0) rotate(0); }
  8%  { transform:translate(-6px,-4px) rotate(-.3deg); }
  16% { transform:translate(8px,5px) rotate(.35deg); }
  24% { transform:translate(-11px,5px) rotate(-.5deg); }
  32% { transform:translate(12px,-6px) rotate(.5deg); }
  40% { transform:translate(-11px,6px) rotate(-.45deg); }
  48% { transform:translate(10px,-5px) rotate(.4deg); }
  56% { transform:translate(-9px,4px) rotate(-.32deg); }
  64% { transform:translate(7px,-4px) rotate(.26deg); }
  72% { transform:translate(-6px,3px) rotate(-.2deg); }
  80% { transform:translate(4px,-2px) rotate(.13deg); }
  90% { transform:translate(-2px,1px) rotate(-.06deg); }
}
/* 注意：不要写 animation-fill-mode:both —— 结束后会一直留着 transform，
   而 transform 会让 body 变成 fixed 元素的包含块，弹窗/提示位置就全乱了 */
.shakeit { animation:shakeit 1s cubic-bezier(.36,.07,.19,.97); will-change:transform; }
/* 抖动时给 body 补一层底色，位移露出的边缘不至于是大白条（只改颜色，不动用户自定义的背景图） */
body.shakeit { background-color:var(--bg); }
.msg-shake { text-align:center; font-size:12px; color:#c8921a; margin:8px 0; font-weight:bold;
  background:rgba(200,146,26,.10); display:inline-block; padding:4px 14px; border-radius:14px;
  margin-left:50%; transform:translateX(-50%); white-space:nowrap; }
/* 拍一拍里嵌的表情图：比聊天里小一号，跟文字基线对齐 */
.msg-shake img.fe { width:18px; height:18px; vertical-align:-3px; margin:0 1px;
  display:inline-block; border-radius:0; box-shadow:none; }
body.theme-dark .msg-shake { color:#f5c84c; }
body.theme-dark .msg-row.self .msg-bubble { color:#eaf7ee; }

/* 聊天里的文件消息卡片 */
.msg-file-wrap { display:inline-block; }
.msg-file { display:inline-flex; align-items:center; gap:10px; background:var(--bubble-other);
  border:1px solid var(--border); border-radius:12px; padding:10px 14px; min-width:200px; max-width:280px;
  box-shadow:0 1px 3px rgba(0,0,0,.10); text-decoration:none; color:var(--text); transition:transform .1s; }
.msg-file:hover { transform:translateY(-2px); border-color:var(--primary); }
.msg-file .mf-ico { font-size:26px; flex:none; }
.msg-file .mf-info { display:flex; flex-direction:column; min-width:0; }
.msg-file .mf-info b { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg-file .mf-info small { font-size:11px; color:var(--text-sub); margin-top:3px; }
.msg-row.self .msg-file { background:#c8f0b0; border-color:#8fd97a; color:#1a1a1a; }
.msg-file.deleted { background:var(--bg); color:var(--text-sub); font-size:12px; padding:8px 12px;
  border-radius:10px; display:inline-block; }

/* 文字头像（拍一拍点头像） */
.pat-avatar { width:38px; height:38px; flex:none; border-radius:50%; display:inline-flex;
  align-items:center; justify-content:center; color:#fff; font-size:13px; font-weight:bold;
  cursor:pointer; user-select:none; box-shadow:0 1px 3px rgba(0,0,0,.16);
  transition:transform .1s; }
.pat-avatar:hover { transform:scale(1.12); box-shadow:0 2px 8px rgba(0,0,0,.28); }
.pat-avatar:active { transform:scale(.94); }
.chat-avatar-slot { display:inline-flex; align-items:center; }
.chat-avatar-slot .pat-avatar { width:30px; height:30px; font-size:11px; }
.chat-avatar-slot .avatar-self { box-shadow:0 0 0 2px #07c160; }
.avatar-group { font-size:15px; margin-right:2px; }
.contact-item .ci-name { flex:1; display:flex; align-items:center; gap:4px; overflow:hidden;
  white-space:nowrap; text-overflow:ellipsis; }
.contact-item .pat-avatar { width:32px; height:32px; font-size:12px; margin-right:4px; }
.msg-avatar { width:34px; height:34px; font-size:12px; margin:0 8px; }
/* 宽度上限放在 msg-body 上：它直接是 .msg-row（有确定宽度）的子项，
   百分比才能算对。以前把 max-width 放在 .msg-bubble 上，父级是随内容
   撑开的 div，百分比自引用，结果气泡只拿到「内容的 70%」，短句被压成
   两三个字一行。 */
.msg-row .msg-body { display:flex; flex-direction:row-reverse; align-items:flex-start;
  max-width:70%; min-width:0; }
.msg-row .msg-body > div { min-width:0; max-width:100%; }
/* 别人的消息没有 .msg-body 包着（头像后面直接是内容块），给它同样的宽度上限，
   否则超长句会把聊天区撑出横向滚动条 */
.msg-row > div:not(.msg-body) { min-width:0; max-width:70%; }
.msg-row > div:not(.msg-body) .msg-bubble { max-width:100%; }
.msg-row .msg-body .msg-meta { text-align:right; }
.msg-row .msg-body .msg-avatar { margin:0 0 0 8px; }

/* 拍一拍闪屏 */
.pat-flash { position:fixed; inset:0; z-index:500; pointer-events:none; opacity:0;
  background:radial-gradient(circle at center, rgba(7,193,96,.55), rgba(7,193,96,.18) 60%, transparent 80%); }
.pat-flash.on { animation:patFlash .85s ease-out; }
@keyframes patFlash {
  0% { opacity:0; transform:scale(.9); }
  15% { opacity:1; transform:scale(1.04); }
  45% { opacity:.75; transform:scale(1); }
  100% { opacity:0; transform:scale(1); }
}
.pat-toast { position:fixed; top:64px; right:20px; z-index:200; cursor:pointer;
  background:#07c160; color:#fff; padding:12px 18px; border-radius:10px; font-size:14px; font-weight:bold;
  box-shadow:0 6px 24px rgba(0,0,0,.22); animation:patIn .25s ease-out; }
@keyframes patIn { from{opacity:0;transform:translateY(-12px)} to{opacity:1;transform:translateY(0)} }

/* 新消息提醒条 + 侧栏未读红点 */
.msg-toast { position:fixed; top:64px; right:20px; z-index:199; cursor:pointer;
  display:flex; align-items:center; gap:8px; max-width:320px;
  background:var(--panel); color:var(--text); padding:11px 14px; border-radius:10px;
  border-left:4px solid var(--primary); font-size:13px;
  box-shadow:0 8px 26px rgba(15,45,85,.22); animation:patIn .22s ease-out; }
.msg-toast .mt-from { font-weight:bold; color:var(--primary); flex:none; }
.msg-toast .mt-txt { color:var(--text-sub); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.unread-dot { display:inline-block; min-width:18px; height:18px; padding:0 5px; border-radius:9px;
  background:#e5453c; color:#fff; font-size:11px; line-height:18px; text-align:center; font-weight:bold; }
@media (max-width: 760px) {
  .msg-toast { top:auto; bottom:72px; left:12px; right:12px; max-width:none; }
}

/* 任务卡片 */
.task-item { background:var(--panel); border-radius:10px; padding:14px 16px; margin-bottom:10px;
  border-left:5px solid var(--primary); }
.task-item.warn { border-left-color:#e8a013; background:linear-gradient(90deg,rgba(232,160,19,.08),transparent 40%); }
.task-item.timeout { border-left-color:#d64541; background:linear-gradient(90deg,rgba(214,69,65,.08),transparent 40%); }
.task-item .t-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.task-item h4 { font-size:15px; flex:1; min-width:200px; }
.task-item .badge { font-size:11px; padding:2px 8px; border-radius:10px; color:#fff; }
.task-item .badge.待办 { background:#8a97a5; }
.task-item .badge.进行中 { background:var(--primary); }
.task-item .badge.已办结 { background:#2e9e4f; }
.task-item .due-warn { color:#b97a00; font-weight:bold; }
.task-item .due-timeout { color:#d64541; font-weight:bold; }
.task-item .t-meta { font-size:12px; color:var(--text-sub); margin-top:6px; }
.task-item .t-ops { margin-top:8px; display:flex; gap:6px; flex-wrap:wrap; }
.task-log { font-size:12px; color:var(--text-sub); background:var(--bg); border-radius:8px;
  padding:8px 10px; margin-top:8px; line-height:1.7; }
.task-log b { color:var(--primary); }
body.theme-dark .task-log { background:#232b3b; }


/* 登录 */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(160deg,var(--primary) 0%,var(--primary-dark) 55%,#1a2230 100%); }
.login-card { background:var(--panel); padding:40px 36px; border-radius:14px; width:360px;
  box-shadow:0 10px 40px rgba(0,0,0,.25); text-align:center; }
.login-card h1 { font-size:19px; margin:6px 0 4px; color:var(--primary); }
.login-sub { font-size:12px; color:var(--text-sub); margin-bottom:22px; }
.login-card input { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius:8px;
  margin-bottom:12px; font-size:14px; background:var(--panel); color:var(--text); }
.login-err { color:#d64541; font-size:13px; min-height:18px; margin-top:6px; }

/* 登录页底部：手机访问地址 + 扫码入口 */
.login-qr { display:flex; align-items:center; gap:12px; margin-top:14px; padding-top:14px;
  border-top:1px dashed var(--border); text-align:left; }
.login-qr img { width:92px; height:92px; flex:none; border-radius:8px; background:#fff;
  padding:4px; border:1px solid var(--border); }
.login-qr img[hidden] { display:none; }
.login-qr-txt { display:flex; flex-direction:column; gap:3px; font-size:12px;
  color:var(--text-sub); line-height:1.55; min-width:0; }
.login-qr-txt b { font-size:13px; color:var(--primary); font-family:Consolas,Menlo,monospace;
  word-break:break-all; letter-spacing:.2px; }
.login-qr-hint { font-size:11px; opacity:.72; }
/* 直连地址很长，必须允许在任意字符处断行，否则会顶出卡片 */
#login-ext-hint { font-size:10px; line-height:1.5; word-break:break-all; opacity:.62; }
#login-ext-alt { font-size:10px; line-height:1.45; word-break:break-all; opacity:.5; margin-top:2px; }

/* 外网（手机流量）入口：只有服务器有公网 IPv6 时才出现 */
.login-qr.ext { border-top:none; margin-top:10px; padding:10px 12px;
  border:1px dashed rgba(45,140,240,.45); border-radius:10px; background:rgba(45,140,240,.06); }
.login-qr.ext b { color:#1f6fd0; }

/* 按钮 */
.btn { border:none; border-radius:8px; padding:10px 18px; font-size:14px; cursor:pointer;
  background:var(--border); color:var(--text); }
.btn.primary { background:var(--primary); color:#fff; }
.btn.primary:hover { background:var(--primary-dark); }
.btn.ghost { background:transparent; color:inherit; opacity:.85; border:1px solid var(--border); }
.btn.sm { padding:5px 12px; font-size:12px; }
.btn.danger { background:#e74c3c; color:#fff; }
.btn.block { width:100%; }

/* 顶部 */
.topbar { background:linear-gradient(90deg,var(--primary),var(--primary-dark)); color:#fff;
  padding:12px 20px; display:flex; justify-content:space-between; align-items:center; }
.brand { display:flex; align-items:center; gap:10px; font-size:16px; }
/* 顶栏版本号小徽标 */
.brand-ver { font-size:11px; font-weight:normal; color:rgba(255,255,255,.9);
  background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.28);
  padding:1px 7px; border-radius:9px; letter-spacing:.2px; }

.topbar-right { display:flex; align-items:center; gap:8px; font-size:13px; }
.topbar .btn.ghost { color:#fff; border-color:rgba(255,255,255,.45); }

/* 标签页 */
.tabs { background:var(--panel); display:flex; padding:0 16px; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.tab { border:none; background:none; padding:14px 18px; font-size:14px; cursor:pointer;
  color:var(--text-sub); border-bottom:3px solid transparent; }
.tab.active { color:var(--primary); border-bottom-color:var(--primary); font-weight:bold; }

.panel { display:none; padding:14px 18px; width:100%; }
.panel.active { display:block; }

.card { background:var(--panel); border-radius:10px; padding:14px; margin-bottom:14px;
  display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.card input[type=text], .card input:not([type]), .card input[type=date], .card input[type=file] {
  padding:9px 10px; border:1px solid var(--border); border-radius:8px; font-size:14px;
  background:var(--panel); color:var(--text); }
.card input#notice-title, .card input#task-title { flex:1 1 200px; }
.card textarea { width:100%; padding:9px 10px; border:1px solid var(--border); border-radius:8px;
  font-size:14px; font-family:inherit; background:var(--panel); color:var(--text); }
.inline { font-size:13px; display:flex; align-items:center; gap:4px; }

/* 表格 */
.tbl { width:100%; background:var(--panel); border-radius:10px; border-collapse:collapse; overflow:hidden; }
.tbl th { background:var(--primary-light); text-align:left; padding:10px 12px; font-size:13px; color:var(--text); }
.tbl td { padding:10px 12px; border-top:1px solid var(--border); font-size:13px; }
.tbl button { margin-right:6px; }

/* ---------- 用户管理：表单铺满 + 表格列宽舒展 ---------- */
/* 添加用户：四个输入框按比例撑满整行，右侧不再留一大块空白 */
#tab-admin .user-add input:not([type]) { flex:1 1 140px; min-width:0; }
#tab-admin .user-add .inline { flex:0 0 auto; }
#tab-admin .user-add .btn { flex:0 0 auto; margin-left:auto; }
/* 列表：固定列宽，前四列拉开呼吸感，操作列刚好放下四个按钮 */
.tbl-wrap { width:100%; overflow-x:auto; }
.tbl-users { table-layout:fixed; }
.tbl-users th, .tbl-users td { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tbl-users .col-user { width:22%; }
.tbl-users .col-name { width:17%; }
.tbl-users .col-dept { width:18%; }
.tbl-users .col-admin { width:10%; }
.tbl-users .col-acts { width:33%; }
.tbl-users td { padding:12px 14px; }
.tbl-users .row-acts { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.tbl-users .row-acts .btn { margin-right:0; padding:6px 14px; }
.tbl-users .row-acts .btn.edit-btn { border:1px solid var(--border); background:transparent; color:var(--text); }
.tbl-users .row-acts .btn.edit-btn:hover { border-color:var(--primary); color:var(--primary); }
/* 登录名单元格本身也能点开编辑（"单独选择进行修改"） */
.tbl-users .cell-edit { cursor:pointer; }
.tbl-users .cell-edit:hover { color:var(--primary); text-decoration:underline; }
/* 整表居中：登录名 / 姓名 / 部门 / 管理员 / 操作 全部居中 */
.tbl-users th, .tbl-users td { text-align:center; }
.tbl-users .row-acts { justify-content:center; }

/* 个人文件传输表：六列全部居中，操作按钮成组居中 */
#p2p-table th, #p2p-table td { text-align:center; }
#p2p-table .p2p-acts { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
#p2p-table .p2p-acts .btn { margin-right:0; }

/* 文件共享表：五列全部居中，操作按钮成组居中 */
#file-table th, #file-table td { text-align:center; }
#file-table .file-acts { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
#file-table .file-acts .btn { margin-right:0; }
@media (max-width: 760px) {
  .tbl-users { table-layout:auto; }
  .tbl-users col { width:auto !important; }
  #tab-admin .user-add input:not([type]) { flex:1 1 40%; }
  #tab-admin .user-add .btn { margin-left:0; }
}

/* 聊天 */
.chat-layout { display:flex; background:var(--panel); border-radius:10px;
  height:calc(100vh - 132px); min-height:460px; overflow:hidden; }
.contact-list { width:250px; border-right:1px solid var(--border); overflow-y:auto; padding:10px; }
.contact-group-title { font-size:12px; color:var(--text-sub); margin:10px 4px 4px; }
.contact-item { padding:9px 10px; border-radius:8px; cursor:pointer; font-size:14px;
  display:flex; justify-content:space-between; align-items:center; gap:6px; }
.contact-item:hover { background:var(--primary-light); }
.contact-item.active { background:var(--primary); color:#fff; }
.contact-item .dot { width:8px; height:8px; border-radius:50%; background:#b4bec9; flex:none; }
.contact-item .dot.on { background:#2ecc71; box-shadow:0 0 4px #2ecc71; }
.contact-item .last { font-size:11px; color:var(--text-sub); max-width:90px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.contact-item.active .last { color:rgba(255,255,255,.85); }
.chat-main { flex:1; display:flex; flex-direction:column; min-width:0; position:relative; }
.chat-title { padding:10px 16px; border-bottom:1px solid var(--border); font-size:15px; font-weight:bold;
  display:flex; align-items:center; gap:10px; }
.chat-title input { margin-left:auto; width:180px; padding:6px 10px; border:1px solid var(--border);
  border-radius:16px; font-size:12px; background:var(--panel); color:var(--text); }
.chat-msgs { flex:1 1 0; min-height:0; overflow-y:auto; padding:16px; background:var(--chat-bg); }
.msg-row { margin-bottom:14px; display:flex; }
.msg-row.self { justify-content:flex-end; }
.msg-bubble { display:block; width:-webkit-fit-content; width:-moz-fit-content; width:fit-content;
  max-width:100%; background:var(--bubble-other); border-radius:12px; padding:8px 12px;
  font-size:15px; box-shadow:0 1px 3px rgba(0,0,0,.10);
  overflow-wrap:break-word; word-break:normal; white-space:pre-wrap; }
body.bubble-square .msg-bubble { border-radius:4px; }
.msg-row.self .msg-bubble { background:var(--bubble-self); color:#1a1a1a; margin-left:auto; }
.msg-bubble img { max-width:320px; max-height:260px; border-radius:8px; cursor:zoom-in; display:block;
  box-shadow:0 1px 3px rgba(0,0,0,.12); }
/* 图片消息：气泡只当容器用，去掉底色/内边距/阴影，图片外面不再套一圈白框 */
.msg-row .msg-bubble.is-img, .msg-row.self .msg-bubble.is-img {
  padding:0; background:none; box-shadow:none; border-radius:0; line-height:0; }
.msg-row .msg-bubble.is-img img { border-radius:10px; max-width:100%; box-shadow:0 1px 4px rgba(0,0,0,.16); }
.msg-meta { font-size:11px; color:var(--text-sub); margin-bottom:3px; }
.msg-row.self .msg-meta { text-align:right; }
.chat-input { border-top:1px solid var(--border); padding:10px; display:flex; gap:8px; align-items:flex-end;
  flex-wrap:nowrap; min-width:0; flex:0 0 auto; }
.chat-input textarea, .chat-input .msg-input { flex:1 1 0; min-width:0; resize:none; border:1px solid var(--border); border-radius:8px;
  padding:9px; font-size:14px; font-family:inherit; background:var(--panel); color:var(--text); }
#btn-send { flex:none; white-space:nowrap; }
/* 待发送窗口：可编辑 div，能内嵌表情图；空的时候用 data-placeholder 显示提示语
   min-width:0 必不可少：flex 子项默认 min-width:auto，contenteditable 里那句长提示
   的 min-content 宽度会把整行撑出屏幕，导致「发送」按钮跑到屏幕外、输入框被拉成 3 行高 */
.chat-input .msg-input { min-height:40px; max-height:min(40vh,220px); overflow-y:auto; line-height:1.55;
  outline:none; white-space:pre-wrap; overflow-wrap:break-word; word-break:break-word; }
.chat-input .msg-input:focus { border-color:var(--primary); box-shadow:0 0 0 2px var(--primary-light); }
.chat-input .msg-input.is-empty:before { content:attr(data-placeholder); color:#9aa4b0; pointer-events:none;
  display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* 输入框里的表情：与消息气泡同尺寸，行内对齐，不带圆角阴影 */
.chat-input .msg-input img.fe { width:26px; height:26px; vertical-align:-6px; margin:0 1px;
  display:inline-block; border-radius:0; box-shadow:none; cursor:default; }
.chat-input .msg-input .emoji-big { font-size:1.45em; }
.icon-btn { border:none; background:none; font-size:22px; cursor:pointer; line-height:1; padding:4px; color:#8a97a5; }
.icon-btn svg { width:21px; height:21px; display:block; }
.icon-btn:hover { color:var(--primary); }
/* QQ 式工具栏：矢量图标，任意缩放/高分屏都锋利 */
.tool-icons { display:flex; align-items:center; gap:4px; flex:none; padding-bottom:3px; }
.tool-icons .icon-btn { width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  padding:0; border-radius:8px; color:#77828f; transition:background .12s, color .12s; }
.tool-icons .icon-btn svg { width:21px; height:21px; }
.tool-icons .icon-btn:hover { background:var(--primary-light); color:var(--primary); }
.tool-icons .icon-btn:active { background:#e3ebf7; }

/* 表情面板 */
.emoji-panel { position:absolute; bottom:62px; left:10px; right:10px; z-index:20;
  border:1px solid var(--border); border-radius:10px; background:var(--panel);
  box-shadow:0 4px 18px rgba(0,0,0,.14); }
.emoji-tabs { display:flex; gap:0; border-bottom:1px solid var(--border); padding:4px 6px 0; }
.emoji-tab { border:none; background:none; padding:7px 12px; cursor:pointer; font-size:12px;
  color:var(--text-sub); border-bottom:2px solid transparent; }
.emoji-tab.active { color:var(--primary); border-bottom-color:var(--primary); font-weight:bold; }
.emoji-grid { display:grid; grid-template-columns:repeat(12,1fr); gap:1px; padding:8px;
  max-height:312px; overflow-y:auto; }
.emoji-panel button.face-btn { border:none; background:none; cursor:pointer; padding:2px; border-radius:6px; line-height:0; }
.emoji-panel button.face-btn:hover { background:var(--primary-light); }
/* 高清表情：源图 96x96 透明 PNG，显示 28px，高分屏也不虚；不再有白底方框 */
.emoji-panel button.face-btn img { width:28px; height:28px; display:block; }
/* 系统表情是矢量彩色字体（Segoe UI Emoji），放到 26px 依旧锐利 */
.emoji-panel button.face-btn.face-emoji { line-height:1; font-size:26px; padding:5px 0;
  font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",system-ui,sans-serif;
  font-variant-emoji:emoji; }
/* 表情图：行内排列，去掉图片气泡的圆角/阴影，否则会在表情外圈出现一圈灰边 */
.msg-bubble img.fe { width:26px; height:26px; vertical-align:middle; margin:0 1px;
  display:inline-block; border-radius:0; box-shadow:none; cursor:inherit; }
.emoji-big { font-size:1.5em; vertical-align:middle; line-height:1;
  font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",system-ui,sans-serif; }

/* 消息右键菜单 */
.msg-context-menu { position:fixed; z-index:120; min-width:150px; background:var(--panel);
  border:1px solid var(--border); border-radius:8px; padding:5px; box-shadow:0 6px 22px rgba(0,0,0,.18); }
.msg-context-menu button { display:flex; align-items:center; gap:8px; width:100%; border:none;
  background:none; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px;
  color:var(--text); text-align:left; }
.msg-context-menu button:hover { background:var(--primary-light); }
.msg-context-menu button svg { width:16px; height:16px; color:#8a97a5; }

/* 弹窗 */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.4); display:flex; align-items:center;
  justify-content:center; z-index:99; }
.modal-card { background:var(--panel); border-radius:12px; padding:24px; width:340px; color:var(--text); }
.modal-card h3 { margin-bottom:14px; }
.modal-card input { width:100%; padding:10px; border:1px solid var(--border); border-radius:8px;
  margin-bottom:10px; background:var(--panel); color:var(--text); }
.modal-btns { display:flex; justify-content:flex-end; gap:8px; margin-top:6px; }
.modal-card select { padding:8px; border:1px solid var(--border); border-radius:8px;
  background:var(--panel); color:var(--text); }

/* 图片查看器：整屏大图 + 底部提示条（右键复制图片 / 下载） */
#img-viewer { flex-direction:column; background:rgba(0,0,0,.74); z-index:120; }
#img-viewer .iv-main { flex:1 1 auto; width:100%; min-height:0; display:flex;
  align-items:center; justify-content:center; padding:18px 16px 6px; }
#img-viewer-src { max-width:94%; max-height:100%; border-radius:10px; background:#fff;
  box-shadow:0 14px 44px rgba(0,0,0,.45); }
#img-viewer .iv-bar { flex:0 0 auto; display:flex; align-items:center; justify-content:center;
  gap:10px; flex-wrap:wrap; padding:12px 16px 18px; }
#img-viewer .iv-tip { font-size:12px; color:rgba(255,255,255,.8); }
#img-viewer .iv-bar .btn { background:rgba(255,255,255,.92); color:#1b2330; border-color:transparent; }
#img-viewer .iv-bar .btn:hover { background:#fff; }
#img-viewer .iv-bar .btn.ghost { background:rgba(255,255,255,.12); color:#fff;
  border:1px solid rgba(255,255,255,.38); }
#img-viewer .iv-bar .btn.ghost:hover { background:rgba(255,255,255,.2); }
@media (max-width:760px) { #img-viewer .iv-tip { display:none; } }

/* 编辑用户弹窗 */
#user-edit-modal { z-index:102; }
.ue-card { width:420px; max-width:92vw; }
.ue-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.ue-head h3 { margin:0; }
.ue-field { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.ue-field label { width:56px; flex:none; font-size:13px; color:var(--text-sub); }
.ue-field input { flex:1; min-width:0; margin-bottom:0; }
.ue-admin { margin-bottom:12px; gap:6px; }
.ue-admin input[type=checkbox] { width:15px; height:15px; margin:0; flex:none; }
#user-edit-modal .ue-admin input[type=checkbox] { width:15px; margin:0; }
.ue-hint { font-size:12px; line-height:1.6; color:var(--text-sub); margin:0 0 14px; }

/* 设置 */
.setting-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:10px; }
.setting-row > label:first-child { font-size:14px; }
.setting-tip { margin:4px 0 0; }
/* 拍一拍话语：输入框 + 表情按钮 + 内嵌表情面板 */
.pat-input-row { display:flex; align-items:center; gap:6px; }
.pat-input-row input { flex:1; min-width:0; }
.pat-emoji-btn { width:34px; height:34px; flex:none; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); border-radius:8px; background:var(--panel); color:#77828f; }
.pat-emoji-btn svg { width:20px; height:20px; }
.pat-emoji-btn:hover { color:var(--primary); border-color:var(--primary); background:var(--primary-light); }
/* 面板改成随内容排版（不用绝对定位），嵌在设置页里不会被裁掉 */
.pat-emoji-panel { position:static; left:auto; right:auto; bottom:auto; margin-top:8px;
  box-shadow:none; }
.pat-emoji-panel .emoji-grid { max-height:200px; grid-template-columns:repeat(10,1fr); }
/* 拍一拍提示里的表情图：和文字同高，不能让它按原图 96px 撑爆一行 */
.pat-toast img.fe { width:18px; height:18px; vertical-align:-3px;
  margin:0 1px; display:inline-block; border-radius:0; box-shadow:none; }
.pat-toast .emoji-big { font-size:1.2em; }
.theme-swatches { display:flex; gap:8px; }
.swatch { width:26px; height:26px; border-radius:50%; cursor:pointer; border:2px solid transparent; }
.swatch.sel { border-color:var(--text); transform:scale(1.12); }
.swatch[data-t=""] { background:#1a6dd4; }
.swatch[data-t="teal"] { background:#0e9f8a; }
.swatch[data-t="purple"] { background:#7c5cd6; }
.swatch[data-t="red"] { background:#d64541; }
.swatch[data-t="green"] { background:#2e9e4f; }
.swatch[data-t="navy"] { background:#34495e; }
.switch { font-size:13px; display:flex; align-items:center; gap:6px; }

/* ===== 飞秋式设置窗口 ===== */
.settings-card { width:min(860px,94vw); max-height:90vh; padding:0; overflow:hidden;
  display:flex; flex-direction:column; }
.settings-titlebar { display:flex; align-items:center; justify-content:space-between;
  padding:12px 18px; font-weight:bold; font-size:15px;
  background:linear-gradient(90deg,#3a8fb7,#5bb3c9); color:#fff; }
.settings-x { border:none; background:rgba(255,255,255,.18); color:#fff; width:26px; height:26px;
  border-radius:6px; cursor:pointer; font-size:14px; line-height:1; }
.settings-x:hover { background:rgba(255,255,255,.35); }
.settings-body { display:flex; min-height:0; flex:1; }
.settings-side { width:190px; flex:none; background:#eef6f5; border-right:1px solid var(--border);
  overflow-y:auto; padding:8px 0; display:flex; flex-direction:column; }
body.theme-dark .settings-side { background:#22313a; }
/* 侧栏底部版本信息 */
.set-version { margin-top:auto; padding:10px 14px 12px; border-top:1px solid rgba(0,0,0,.07);
  font-size:11px; line-height:1.6; color:var(--text-sub); }
.set-version b { display:block; font-size:11px; font-weight:600; color:var(--text); }
body.theme-dark .set-version { border-top-color:rgba(255,255,255,.12); }
/* 功能设置里的版本说明 */
.set-ver-note, .set-ver-env { display:block; font-size:12px; line-height:1.7; }
.set-ver-env { color:var(--text-sub); opacity:.85; }
.set-cat { display:block; width:100%; text-align:left; border:none; background:none; cursor:pointer;
  padding:9px 14px; font-size:13px; color:var(--text); border-left:3px solid transparent; }
.set-cat:hover { background:rgba(91,179,201,.15); }
.set-cat.active { background:#d8eee9; border-left-color:#2e9e8f; font-weight:bold; }
body.theme-dark .set-cat.active { background:#2c4a4a; }
.settings-main { flex:1; min-width:0; overflow-y:auto; padding:16px 20px; }
.set-page { display:none; }
.set-page.active { display:block; }
.set-page-title { font-size:15px; font-weight:bold; color:#1a7f96; margin-bottom:14px;
  padding-bottom:8px; border-bottom:2px solid #cfe8e3; }
body.theme-dark .set-page-title { color:#6fd0c4; border-bottom-color:#345; }
.set-empty { padding:30px 10px; text-align:center; line-height:1.8; }
.set-hint { font-size:12px; line-height:1.5; margin-top:8px; }

/* 聊天背景（皮肤/风格） */
.bg-preset-block { margin:16px 0; padding:14px; border:1px solid var(--border); border-radius:10px; }
.bg-label { font-size:13px; font-weight:bold; margin-bottom:10px; color:var(--text); }
.bg-colors { display:grid; grid-template-columns:repeat(8,1fr); grid-auto-rows:max-content;
  align-items:start; gap:6px; }
.bg-color { width:100%; aspect-ratio:1; border:2px solid transparent; border-radius:6px; cursor:pointer;
  box-shadow:0 0 0 1px rgba(0,0,0,.08); transition:transform .1s; }
.bg-color:hover { transform:scale(1.12); }
.bg-color.sel { border-color:#1a6dd4; box-shadow:0 0 0 2px rgba(26,109,212,.35); transform:scale(1.08); }
.bg-upload-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.bg-preview { height:110px; border-radius:8px; border:1px dashed var(--border);
  display:flex; align-items:center; justify-content:center; background-size:cover;
  background-position:center center; background-repeat:no-repeat; overflow:hidden; }
.bg-preview.empty { background:var(--bg); }

/* 个人资料布局 */
.profile-layout { display:flex; gap:22px; }
.profile-left { width:170px; flex:none; text-align:center; }
.profile-avatar { width:120px; height:120px; border-radius:50%; overflow:hidden; cursor:pointer;
  margin:0 auto 10px; border:3px solid #cfe8e3; background:#e7eff0;
  display:flex; align-items:center; justify-content:center; font-size:40px; color:#fff; font-weight:bold; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-left .btn { margin:3px; }
.profile-right { flex:1; min-width:0; }

/* 系统头像选择面板（飞秋式） */
.avatar-picker { width:300px; flex:none; border:1px solid var(--border); border-radius:8px;
  background:var(--panel); padding:10px; display:flex; flex-direction:column; max-height:430px; }
.avatar-picker.hidden { display:none; }
.ap-tabs { display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:8px; }
.ap-tab { border:0; background:transparent; padding:6px 8px; font-size:12px; color:var(--muted);
  cursor:pointer; border-bottom:2px solid transparent; }
.ap-tab.active { color:var(--accent); border-bottom-color:var(--accent); font-weight:bold; }
/* 行高必须按内容(max-content)算：网格被塞进有高度上限的滚动容器时，
   auto 行会被压成十几像素，头像方块就会互相压在一起（手机端尤其明显）。 */
.ap-grid { display:grid; grid-template-columns:repeat(6,1fr);
  grid-auto-rows:max-content; align-items:start; gap:5px; overflow-y:auto;
  padding:2px; min-height:120px; align-content:start; }
.ap-grid.hidden { display:none; }
.ap-item { width:100%; aspect-ratio:1; padding:2px; border:2px solid transparent; border-radius:6px;
  background:var(--bg); cursor:pointer; overflow:hidden; }
.ap-item:hover { border-color:var(--accent); }
.ap-item.sel { border-color:#07c160; box-shadow:0 0 0 2px rgba(7,193,96,.25); }
.ap-item img { width:100%; height:100%; object-fit:cover; image-rendering:pixelated; display:block; }
.ap-custom { padding:14px 6px; text-align:center; font-size:13px; }
.ap-custom.hidden { display:none; }
.ap-foot { display:flex; align-items:center; justify-content:space-between; margin-top:8px;
  padding-top:6px; border-top:1px solid var(--border); font-size:11px; }
.av-hint { margin:6px 0 0; font-size:11px; line-height:1.5; }
/* 选头像时：右侧资料表单先收起来，把宽度让给头像面板；点「确定」或「收起」后自动恢复 */
.profile-layout.picking .profile-right { display:none; }
.profile-layout.picking .avatar-picker { flex:1; width:auto; max-height:min(460px,58vh); }
.profile-layout.picking .ap-grid { grid-template-columns:repeat(auto-fill,minmax(54px,1fr)); }
.profile-field { display:flex; align-items:center; gap:8px; margin-bottom:9px; }
.profile-field > label { width:78px; flex:none; font-size:13px; color:var(--text); text-align:right; }
.profile-field input, .profile-field textarea { flex:1; min-width:0; margin:0; padding:7px 10px;
  font-size:13px; resize:vertical; }
.profile-field input:disabled { opacity:.6; }
.share-check { display:flex; align-items:center; gap:6px; font-size:13px; margin:6px 0 2px 86px; cursor:pointer; }
.share-check input { width:auto; margin:0; }
/* 头像图片在联系人/消息中的显示 */
.pat-avatar.avatar-img { object-fit:cover; padding:0; background:#eee; }
.ci-line { display:flex; align-items:center; gap:4px; min-width:0; }
.ci-sign { display:block; font-size:11px; color:#9aa5ad; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; max-width:100%; }
.contact-item .ci-name { flex-direction:column; align-items:flex-start; gap:0; }

/* 个人资料卡 */
.profile-card { width:380px; }
.pc-head { display:flex; gap:14px; align-items:center; margin-bottom:14px; }
.pc-avatar { width:72px; height:72px; flex:none; border-radius:50%; overflow:hidden; background:#e7eff0;
  display:flex; align-items:center; justify-content:center; font-size:26px; color:#fff; font-weight:bold; }
.pc-avatar img { width:100%; height:100%; object-fit:cover; }
.pc-base { min-width:0; }
.pc-name { font-size:17px; font-weight:bold; margin-bottom:3px; }
.pc-sign { font-size:12px; color:#c8921a; margin-top:5px; line-height:1.4; }
.pc-contact { border-top:1px solid var(--border); padding-top:10px; font-size:13px; }
.pc-contact-row { display:flex; gap:8px; padding:4px 0; }
.pc-contact-row label { width:72px; flex:none; color:#8a97a0; text-align:right; }
.pc-contact-row span { word-break:break-all; }

/* 手机端设置窗口适配 */
@media (max-width:640px){
  .settings-card { width:96vw; }
  .settings-side { width:130px; }
  .set-cat { padding:8px 10px; font-size:12px; }
  .profile-layout { flex-direction:column; }
  .profile-left { width:auto; }
  .profile-field > label { width:66px; }
  .share-check { margin-left:0; }
}

/* 公告 */
.notice-item { background:var(--panel); border-radius:10px; padding:14px 16px; margin-bottom:10px; }
.notice-item h4 { font-size:15px; margin-bottom:6px; }
.notice-item .top-tag { background:#f39c12; color:#fff; font-size:11px; padding:1px 6px; border-radius:4px; margin-left:6px; }
.notice-item p { font-size:14px; color:var(--text); opacity:.9; white-space:pre-wrap; }
.notice-meta { font-size:12px; color:var(--text-sub); margin-top:8px; }

/* 手机APP式底部导航 */
.bottom-nav { display:none; position:fixed; left:0; right:0; bottom:0; z-index:60;
  background:var(--panel); border-top:1px solid var(--border);
  box-shadow:0 -2px 12px rgba(0,0,0,.08);
  padding-bottom:env(safe-area-inset-bottom); }
.bottom-nav .bnav { flex:1; display:flex; flex-direction:column; align-items:center;
  gap:2px; font-size:11px; color:var(--text-sub); padding:7px 0 5px; border:none; background:none; }
.bottom-nav .bnav .ico { font-size:20px; line-height:1; }
.bottom-nav .bnav.active { color:var(--primary); font-weight:bold; }
body.theme-dark .bottom-nav { background:#1c2230; }

/* ====== 微信式任务提醒侧栏 & 快捷筛选 ====== */
.task-panel-btn { position:relative; font-size:18px; padding:2px 6px; }
.task-badge { position:absolute; top:-4px; right:-6px; min-width:16px; height:16px; line-height:16px;
  padding:0 4px; border-radius:9px; background:#f76260; color:#fff; font-size:10px; font-weight:bold;
  text-align:center; box-shadow:0 0 0 2px var(--panel); }
.task-panel { width:300px; flex:none; display:none; flex-direction:column;
  border-left:1px solid var(--border); background:var(--panel); }
.chat-layout.show-task .task-panel { display:flex; }
.tp-head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px;
  border-bottom:1px solid var(--border); font-size:15px; }
.tp-close { font-size:16px; padding:2px 4px; }
.tp-sub { font-size:11px; color:var(--text-sub); padding:8px 14px 4px; }
.tp-list { flex:1; overflow-y:auto; padding:6px 10px 10px; }
.mini-task { background:var(--bg); border-radius:10px; padding:10px 12px; margin-bottom:8px;
  border-left:4px solid #07c160; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.mini-task.warn { border-left-color:#fa9d3b; background:linear-gradient(90deg,rgba(250,157,59,.10),transparent 60%); }
.mini-task.timeout { border-left-color:#f76260; background:linear-gradient(90deg,rgba(247,98,96,.10),transparent 60%); }
.mini-task-title { font-size:13px; font-weight:bold; line-height:1.4; }
.mini-task-meta { font-size:11px; color:var(--text-sub); margin:5px 0 7px; }
.mini-task-ops { display:flex; gap:6px; }
.mini-status { color:#fff; font-size:10px; padding:2px 8px; border-radius:9px; font-weight:bold; }
.btn.xs { padding:3px 9px; font-size:11px; border-radius:6px; }
.tp-foot { padding:10px; border-top:1px solid var(--border); }
body.theme-dark .mini-task { background:#232b3b; }

.task-quick { display:flex; gap:6px; flex-wrap:wrap; width:100%; margin-bottom:4px; }
.chip { border:1px solid var(--border); background:var(--panel); color:var(--text-sub);
  border-radius:16px; padding:5px 13px; font-size:12px; cursor:pointer; }
.chip:hover { border-color:var(--primary); color:var(--primary); }
.chip.active { background:#07c160; border-color:#07c160; color:#fff; font-weight:bold; }
body.theme-dark .chip.active { background:var(--primary); border-color:var(--primary); }

/* 手机端适配 */
.back-btn { display:none; border:none; background:none; color:var(--primary); font-size:22px; cursor:pointer; padding:0 6px; }
@media (max-width: 640px){
  .topbar { padding:8px 10px; gap:6px; flex-wrap:nowrap; }
  .brand { gap:6px; min-width:0; flex:1 1 auto; }
  .brand b { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .brand-ver, #me-name { display:none; }
  .topbar-right { flex:0 0 auto; gap:6px; }
  .topbar-right .btn.ghost { padding:5px 8px; font-size:12px; white-space:nowrap; }
  .topbar-right #btn-changepwd { display:none; }
  .tabs { display:none; }
  .bottom-nav { display:flex; }
  #main-view { padding-bottom:66px; }
  .panel { padding:8px; }
  .card { gap:6px; }
  .card input:not([type]), .card input[type=text], .card input[type=date] { width:100%; font-size:15px; }
  .card .btn { width:100%; }
  .tbl { font-size:12px; }
  .tbl th, .tbl td { padding:8px 6px; }
  .chat-layout { position:relative; height:calc(100vh - 146px); }
  .contact-list { width:100%; position:absolute; inset:0; z-index:5; background:var(--panel); }
  .chat-main { display:none; }
  .chat-layout.in-chat .contact-list { display:none; }
  .chat-layout.in-chat .chat-main { display:flex; }
  .in-chat .back-btn { display:inline-block; }
  .chat-title input { width:110px; }
  /* 表情面板改为文档流中的正常块：排在消息区与输入栏之间，
     不再用 absolute 悬浮盖住输入栏/发送按钮（原来 bottom:58px 会压到输入区）。
     面板高度收缩，保证输入栏和底部导航始终可见可点。 */
  .emoji-panel { position:static; left:auto; right:auto; bottom:auto; z-index:auto;
    flex:0 0 auto; margin:0; border-radius:10px 10px 0 0; border-left:none; border-right:none; border-bottom:none; }
  .emoji-panel .emoji-grid { max-height:150px; grid-template-columns:repeat(8,1fr); }
  /* 手机输入区：表情/图片/文件三个图标、输入框、发送按钮挤在同一行平行排列，
     输入框吃满剩余宽度，内容长了自动往上长（最多 40vh），不再把按钮挤到屏幕外 */
  .chat-input { padding:8px; gap:6px; }
  .tool-icons { gap:1px; padding-bottom:0; }
  .tool-icons .icon-btn { width:28px; height:28px; border-radius:7px; }
  .tool-icons .icon-btn svg { width:19px; height:19px; }
  .chat-input .msg-input { min-height:38px; padding:6px 9px; font-size:16px; line-height:1.5; border-radius:9px; }
  .chat-input .msg-input.is-empty:before { content:attr(data-ph-mobile); }
  #btn-send { padding:0 13px; height:38px; font-size:13.5px; border-radius:9px; }
  .msg-row .msg-body { max-width:86%; }
  .msg-row > div:not(.msg-body) { max-width:86%; }   /* 别人的消息同样用满 86% 宽度 */
  .msg-bubble img { max-width:240px; max-height:300px; }
  .login-card { width:92%; padding:32px 22px; }
  .task-panel { display:none; position:absolute; right:0; top:0; bottom:0; width:86%;
    z-index:12; box-shadow:-4px 0 18px rgba(0,0,0,.18); }
  .chat-layout.show-task .task-panel { display:flex; }
  .task-panel-btn { font-size:16px; }
  .task-quick { gap:4px; }
  .chip { padding:4px 10px; font-size:11px; }
}

/* ---------- 内网地图（奥维互动地图瓦片服务） ---------- */
.panel-map { padding:0; position:relative; height:calc(100vh - 132px); min-height:420px; }
#map-frame { width:100%; height:100%; border:0; display:block; background:#eef2f7; }
.map-fallback { position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  padding:20px; background:var(--bg); }
.mf-card { background:var(--panel); border:1px solid var(--border); border-radius:14px;
  padding:26px 30px; max-width:480px; text-align:center; box-shadow:0 10px 30px rgba(0,0,0,.10); }
.mf-title { font-size:17px; font-weight:bold; color:var(--text); margin-bottom:8px; }
.mf-text { color:var(--text-sub); font-size:13.5px; line-height:1.7; margin-bottom:16px; }
.mf-btns { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
@media (max-width: 640px){
  .panel-map { height:calc(100vh - 146px); }
}

/* ---------- 网络设置：局域网 / 互联网 一键切换 ---------- */
.net-modes { display:flex; gap:10px; }
.net-opt { flex:1 1 0; min-width:0; text-align:center; padding:11px 12px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:12px; line-height:1.4;
  border:1.5px solid var(--border); border-radius:12px; background:var(--panel); color:var(--text);
  transition:border-color .15s, background .15s, box-shadow .15s; }
.net-opt b { font-size:15px; }
.net-opt:hover:not(.readonly) { border-color:rgba(45,140,240,.55); }
.net-opt.readonly { cursor:default; }
.net-opt.readonly:hover { border-color:var(--border); }
.net-opt.active { border-color:var(--primary); background:rgba(45,140,240,.08);
  box-shadow:0 4px 14px rgba(45,140,240,.14); }
.net-opt.active:hover { border-color:var(--primary); }
.net-opt.active b { color:var(--primary); }
.net-opt:disabled { opacity:.6; cursor:not-allowed; }
/* 非管理员只读提示条 */
.net-readonly-tip { display:flex; align-items:center; gap:6px; margin-bottom:10px;
  padding:8px 11px; font-size:12px; line-height:1.5; color:#8a5a12;
  background:rgba(245,166,35,.1); border:1px solid rgba(245,166,35,.35); border-radius:9px; }
.net-addr { display:flex; gap:12px; align-items:center; margin-top:12px; padding:12px;
  border:1px dashed rgba(45,140,240,.45); border-radius:12px; background:rgba(45,140,240,.05); }
.net-addr-img img { width:104px; height:104px; display:block; border-radius:8px; background:#fff; }
.net-addr-txt { display:flex; flex-direction:column; gap:4px; min-width:0; flex:1 1 auto; }
.net-addr-label { font-size:11px; color:var(--text-sub); }
.net-addr-txt b { font-size:13px; color:var(--primary); font-family:Consolas,Menlo,monospace;
  word-break:break-all; line-height:1.5; }
@media (max-width: 640px) { .net-modes { gap:8px; } .net-opt { padding:10px 8px; } }

/* 网络设置·外网连通测试指示灯 */
.net-live { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:12px;
  color:var(--text-sub); line-height:1.5; }
.net-live i { width:8px; height:8px; border-radius:50%; background:#c9d2e0; flex:none;
  transition:background .2s, box-shadow .2s; }
.net-live.on i { background:#22a06b; box-shadow:0 0 0 3px rgba(34,160,107,.16); }
.net-live.on span { color:#1a7f52; }

/* 网络设置·外网隧道状态 */
.net-tunnel { display:flex; gap:10px; align-items:flex-start; margin-top:10px; padding:11px 13px;
  border:1px dashed rgba(140,150,170,.55); border-radius:12px; font-size:12px; line-height:1.6;
  color:var(--text-sub); background:rgba(140,150,170,.05); }
.net-tunnel i { width:8px; height:8px; border-radius:50%; background:#c9d2e0; flex:none;
  margin-top:5px; transition:background .2s, box-shadow .2s; }
.net-tunnel b { display:block; color:var(--text); font-size:12.5px; margin-bottom:2px; }
.net-tunnel span { word-break:break-all; }
.net-tunnel.on { border-color:rgba(34,160,107,.55); background:rgba(34,160,107,.06); }
.net-tunnel.on i { background:#22a06b; box-shadow:0 0 0 3px rgba(34,160,107,.16); }
.net-tunnel.on b { color:#1a7f52; }
.net-tunnel.on span { color:var(--primary); font-family:Consolas,Menlo,monospace; font-size:12px; }

/* ---------------- 自定义群聊：建群选人 / 群成员面板 ---------------- */
.contact-group-title { display:flex; align-items:center; justify-content:space-between; }
.cg-add { width:20px; height:20px; padding:0; flex:none; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); border-radius:50%; background:var(--panel); color:var(--text-sub);
  font-size:14px; line-height:1; cursor:pointer; }
.cg-add:hover { color:var(--primary); border-color:var(--primary); background:var(--primary-light); }
.contact-item .ci-count { flex:none; font-size:11px; color:var(--text-sub); }
.contact-item.active .ci-count { color:rgba(255,255,255,.85); }

/* 「群聊」分组：点标题收起 / 展开，收起后只留这一行，个人聊天照常显示 */
.fold-head { margin:8px 2px 2px; padding:5px 6px; border-radius:8px; cursor:pointer;
  user-select:none; -webkit-user-select:none; transition:background .15s, color .15s; }
.fold-head:hover { background:var(--primary-light); color:var(--primary); }
.fold-label { display:flex; align-items:center; gap:6px; min-width:0; }
.fold-caret { width:0; height:0; flex:none; border-left:5px solid currentColor;
  border-top:4px solid transparent; border-bottom:4px solid transparent;
  transform:rotate(90deg); transform-origin:40% 50%; transition:transform .18s; }
#contact-list.fold-groups .fold-caret { transform:rotate(0deg); }
.fold-count { font-size:11px; color:var(--text-sub); background:var(--bg);
  border-radius:9px; padding:0 6px; line-height:16px; }
.fold-head:hover .fold-count { color:var(--primary); background:rgba(45,140,240,.12); }
#contact-list.fold-groups .contact-item.group-row { display:none; }
.contact-item.group-row { animation:none; }

.gm-card { width:440px; max-width:calc(100vw - 28px); }
.gm-card h3 { margin-bottom:12px; font-size:16px; }
.gm-card input { margin-bottom:9px; }
.gm-picked { font-size:12px; color:var(--text-sub); margin:0 0 6px; display:flex; align-items:center; gap:8px; }
.gm-picked b { color:var(--primary); }
.gm-picked .gm-clear { margin-left:auto; border:0; background:none; color:var(--text-sub);
  font-size:12px; cursor:pointer; padding:2px 4px; }
.gm-picked .gm-clear:hover { color:var(--primary); }
.gm-list { max-height:44vh; overflow-y:auto; border:1px solid var(--border); border-radius:10px; padding:6px; }
.gm-dept { font-size:11.5px; color:var(--text-sub); margin:8px 6px 2px; }
.gm-dept:first-child { margin-top:2px; }
.gm-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px;
  font-size:14px; cursor:pointer; user-select:none; }
.gm-row:hover { background:var(--primary-light); }
.gm-row.on { background:var(--primary-light); }
.gm-row input[type="checkbox"] { width:15px; height:15px; margin:0; flex:none; cursor:pointer; }
.gm-row .gm-sub { font-size:11.5px; color:var(--text-sub); }
.gm-row .gm-tag { margin-left:auto; flex:none; font-size:11px; padding:1px 7px; border-radius:9px;
  background:var(--primary); color:#fff; }
.gm-row .gi-kick { margin-left:auto; flex:none; border:1px solid var(--border); background:var(--panel);
  color:var(--text-sub); border-radius:6px; font-size:11px; padding:2px 7px; cursor:pointer; }
.gm-row .gi-kick:hover { color:#d94a3d; border-color:#f0c4bf; }
.gm-empty { padding:24px 10px; text-align:center; color:var(--text-sub); font-size:13px; }
.gi-head { display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.gi-head h3 { flex:1; margin:0; font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gi-x { flex:none; }
.gi-sub { font-size:12px; color:var(--text-sub); margin-bottom:8px; }
.gi-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.gi-danger { color:#d94a3d !important; border-color:#f0c4bf !important; }
.gi-danger:hover { background:#fdeceb !important; }
body.theme-dark .gm-list { background:rgba(255,255,255,.02); }
body.theme-dark .gm-row:hover, body.theme-dark .gm-row.on { background:rgba(90,160,255,.14); }

@media (max-width:760px){
  .gm-card { width:100%; }
  .gm-list { max-height:40vh; }
  .gm-row { padding:8px; }
}

/* 自定义群：会话标题可点开群成员 */
.chat-title #chat-title-text.clickable { cursor:pointer; }
.chat-title #chat-title-text.clickable:hover { color:var(--primary); text-decoration:underline dotted; }
.gm-row .pat-avatar { width:30px; height:30px; font-size:11px; flex:none; }

/* 邀请成员时选人弹窗要浮在群成员面板之上 */
#group-info-modal { z-index:100; }
#group-modal { z-index:101; }

/* 全员群成员面板：每个人都能看到群里有哪些人 */
.sg-card { width:460px; max-width:calc(100vw - 28px); display:flex; flex-direction:column;
  max-height:calc(100vh - 80px); }
.sg-members { margin-top:8px; border:1px solid var(--border); border-radius:8px; overflow:auto;
  max-height:min(56vh, 420px); background:var(--panel); }
.sg-member { display:flex; align-items:center; gap:8px; padding:7px 10px; }
.sg-member + .sg-member { border-top:1px solid var(--border); }
.sg-member .dot { width:7px; height:7px; flex:none; }
.sg-member .pat-avatar { width:28px; height:28px; font-size:11px; flex:none; }
.sg-mname { display:flex; align-items:center; gap:5px; font-size:13.5px; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sg-me, .sg-flag { flex:none; font-size:10.5px; line-height:1.6; padding:0 5px; border-radius:8px; }
.sg-me { background:var(--primary); color:#fff; }
.sg-flag { background:rgba(0,0,0,.06); color:var(--text-sub); }
body.theme-dark .sg-flag { background:rgba(255,255,255,.12); }
.sg-mdept { margin-left:auto; flex:none; font-size:11.5px; color:var(--text-sub); }
.sg-tip { font-size:12px; line-height:1.7; color:var(--text-sub); background:var(--bg);
  border:1px dashed var(--border); border-radius:8px; padding:8px 10px; margin:10px 0 0; }
#contact-list.fold-groups .fold-left { display:none; }

/* ================= 手机端精简：列表卡片化 + 表单紧凑 ================= */
/* 折叠按钮（只在手机 + 有权限时由 JS 显示） */
.m-fold-btn { display:none; width:100%; margin:0 0 10px; padding:9px 12px; font-size:13.5px; }
/* 任务预警：带文字说明，不再是孤零零一个数字框 */
.task-warn-field { display:flex; align-items:center; gap:6px; font-size:13px;
  color:var(--text-sub); white-space:nowrap; }
.task-warn-field input { width:56px; padding:6px 8px; text-align:center; }

@media (max-width:640px){
  .m-fold-btn { display:block; }

  /* ---- 表单：控件铺满、高度收敛 ---- */
  .card { padding:10px; gap:8px; }
  .card input:not([type]), .card input[type=text], .card input[type=date],
  .card input[type=number], .card input[type=file], .card textarea {
    width:100%; font-size:15px; padding:8px 10px; }
  .card .btn { width:100%; }

  /* ---- 个人文件传输：接收人一行、文件+发送一行 ---- */
  #tab-p2p .card { display:flex; flex-wrap:wrap; align-items:center; }
  #p2p-to { flex:1 1 100% !important; }
  #p2p-file { flex:1 1 55% !important; width:auto !important; min-width:0; font-size:12.5px; padding:7px 8px; }
  #btn-p2p-send { flex:1 1 auto; width:auto !important; padding:9px 10px; font-size:13px; white-space:nowrap; }
  #p2p-status { flex:1 1 100%; font-size:12px; line-height:1.5; }
  #tab-p2p > p.muted { font-size:11.5px; line-height:1.6; margin:-2px 2px 10px !important; }

  /* ---- 文件共享：选择框与按钮同宽 ---- */
  #tab-file .card { display:flex; flex-wrap:wrap; }
  #file-input { flex:1 1 100% !important; font-size:12.5px; padding:8px; }
  #upload-status { flex:1 1 100%; }

  /* ---- 任务页 ---- */
  #task-form-box { display:flex; flex-wrap:wrap; }
  #task-due { flex:1 1 52% !important; }
  .task-warn-field { flex:1 1 40%; justify-content:center; padding:8px 6px;
    border:1px solid var(--border); border-radius:8px; background:var(--panel); font-size:12.5px; }
  .task-warn-field input { width:48px; padding:4px 4px; margin:0; }
  #task-file { flex:1 1 100% !important; font-size:12.5px; padding:8px; }
  #btn-task-add { flex:1 1 100%; }
  .task-quick { flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; gap:5px;
    -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .task-quick::-webkit-scrollbar { display:none; }
  .task-quick .chip { flex:none; }
  #task-filter { flex:1 1 100%; }
  #btn-export { margin-left:0 !important; flex:1 1 100%; }
  .task-item { padding:11px 12px; border-radius:10px; }
  .task-item h4 { font-size:14.5px; min-width:0; }
  .task-item .t-meta { font-size:11.5px; line-height:1.65; }
  .task-item .t-ops { gap:6px; }
  .task-item .t-ops .btn { padding:5px 11px; font-size:12px; }

  /* ---- 用户管理：添加表单两列、按钮铺满 ---- */
  #tab-admin .user-add { display:flex; flex-wrap:wrap; }
  #tab-admin .user-add input:not([type]) { flex:1 1 45%; font-size:14px; }
  #tab-admin .user-add .inline { flex:1 1 100%; }
  #tab-admin .user-add .btn { flex:1 1 100%; }

  /* ---- 三个列表：手机上变卡片，彻底告别横向滚动 ---- */
  #p2p-table, #file-table, .tbl-users { background:transparent; table-layout:auto; }
  #p2p-table thead, #file-table thead, .tbl-users thead { display:none; }
  #p2p-table tbody, #file-table tbody, .tbl-users tbody { display:block; }
  #p2p-table tr, #file-table tr, .tbl-users tr {
    display:block; background:var(--panel); border:1px solid var(--border);
    border-radius:10px; padding:9px 12px; margin-bottom:8px;
    box-shadow:0 1px 2px rgba(0,0,0,.04); }
  #p2p-table td, #file-table td, .tbl-users td {
    display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
    border:0; padding:3px 0; text-align:right; font-size:13px; line-height:1.55;
    white-space:normal; overflow:visible; text-overflow:clip; word-break:break-all; }
  #p2p-table td::before, #file-table td::before, .tbl-users td::before {
    content:attr(data-label); flex:none; color:var(--text-sub); font-size:12px; padding-top:1px; }
  /* 首行当标题：文件名 / 登录名 */
  #p2p-table td[data-label="名称"], #file-table td[data-label="文件名"],
  .tbl-users td[data-label="登录名"] {
    display:block; text-align:left; font-size:14px; font-weight:bold;
    padding:0 0 6px; margin-bottom:3px; border-bottom:1px dashed var(--border);
    overflow-wrap:anywhere; }
  #p2p-table td[data-label="名称"]::before, #file-table td[data-label="文件名"]::before,
  .tbl-users td[data-label="登录名"]::before { display:none; }
  .tbl-users td[data-label="登录名"] { color:var(--primary); }
  .tbl-users td[data-label="登录名"]::before {
    content:'登录名'; display:inline-block; margin-right:8px; padding:1px 6px; border-radius:6px;
    background:var(--primary-light); color:var(--primary); font-size:11px; font-weight:normal; vertical-align:2px; }
  /* 操作行：按钮横排 */
  #p2p-table td[data-label="操作"], #file-table td[data-label="操作"],
  .tbl-users td[data-label="操作"] {
    display:block; text-align:left; padding:8px 0 0; margin-top:5px;
    border-top:1px dashed var(--border); }
  #p2p-table td[data-label="操作"]::before, #file-table td[data-label="操作"]::before,
  .tbl-users td[data-label="操作"]::before { display:none; }
  #p2p-table .p2p-acts, #file-table .file-acts, .tbl-users .row-acts {
    justify-content:flex-start; gap:6px; }
  #p2p-table .p2p-acts .btn, #file-table .file-acts .btn, .tbl-users .row-acts .btn {
    margin-right:0; padding:5px 12px; font-size:12.5px; }
  /* 空列表提示 */
  #p2p-table td.empty-cell, #file-table td.empty-cell, .tbl-users td.empty-cell {
    display:block; text-align:center; color:var(--text-sub); font-size:12.5px;
    line-height:1.7; padding:16px 8px; }
  #p2p-table td.empty-cell::before, #file-table td.empty-cell::before,
  .tbl-users td.empty-cell::before { display:none; }

  /* ---- 聊天联系人：行高收紧 ---- */
  .contact-item { padding:8px 10px; }
  .contact-group-title { margin:6px 4px 2px; }
  .chat-layout { border-radius:8px; }

  /* ---- 聊天会话页：标题栏不再挤成一团 ---- */  .chat-title { padding:8px 10px; gap:6px; font-size:14.5px; }
  .chat-title input { display:none; }          /* 搜聊天记录：手机上让位给标题 */
  .chat-title #chat-title-text { flex:1; min-width:0; overflow:hidden;
    text-overflow:ellipsis; white-space:nowrap; }
  #me-avatar-slot { display:none; }            /* 自己的头像不占标题栏 */
  .chat-title .chat-avatar-slot .pat-avatar { width:28px; height:28px; font-size:11px; }
  .chat-msgs { padding:10px 8px; }
  .msg-avatar { width:30px; height:30px; font-size:11px; margin:0 6px; }
  .msg-row { margin-bottom:12px; }
  .msg-bubble { font-size:16px; padding:8px 11px; }
  .msg-bubble img { max-width:66vw; max-height:44vh; }
  .msg-row .msg-bubble.is-img img { max-width:74vw; }
}


/* ---- 手机端设置窗口：全屏 + 顶部横向分类，内容不再被 130px 侧栏挤窄 ---- */
@media (max-width:640px){
  .settings-card { width:100vw; height:100vh; max-height:100vh; border-radius:0; }
  .settings-body { flex-direction:column; }
  .settings-side { width:100%; flex:none; flex-direction:row; overflow-x:auto; overflow-y:hidden;
    border-right:0; border-bottom:1px solid var(--border); padding:0; scrollbar-width:none; }
  .settings-side::-webkit-scrollbar { display:none; }
  .set-cat { width:auto; flex:none; white-space:nowrap; border-left:0;
    border-bottom:3px solid transparent; padding:11px 10px; font-size:12.5px; }
  .set-cat.active { border-left-color:transparent; border-bottom-color:#2e9e8f; background:transparent; }
  body.theme-dark .set-cat.active { background:transparent; }
  .set-version { display:none; }
  .settings-main { padding:12px 14px; }
  .set-page-title { font-size:14.5px; margin-bottom:12px; }
  .profile-avatar { width:96px; height:96px; font-size:32px; }
  .profile-field > label { width:78px; font-size:12.5px; white-space:nowrap; }
  .profile-field input, .profile-field textarea { font-size:14px; }
  .bg-preset-block { padding:10px; margin:12px 0; }
  .bg-colors { grid-template-columns:repeat(8,1fr); gap:5px; }
  .avatar-picker { width:100%; }
  .set-empty { padding:20px 6px; }
}

/* 手机端设置项：左侧名称与右侧开关/下拉都不换行 */
@media (max-width:640px){
  .setting-row > label:first-child { white-space:nowrap; font-size:13.5px; }
  .setting-row .switch { white-space:nowrap; flex:none; }
  .setting-row select { max-width:56vw; }
}

/* 手机端聊天搜索：默认收成放大镜，点开覆盖标题栏，不占常驻宽度 */
.chat-search-btn { display:none; }
@media (max-width:640px){
  .chat-title { position:relative; }
  .chat-search-btn { display:flex; color:#77828f; font-size:16px; padding:2px 4px; }
  #chat-search { display:none; }
  #chat-search.show { display:block; position:absolute; left:8px; right:8px; top:6px; z-index:6;
    width:auto; margin:0; padding:8px 12px; font-size:14px; background:var(--panel);
    box-shadow:0 6px 18px rgba(0,0,0,.16); }
}

/* 手机端列表再紧凑一点：次要字段两列并排（类型|大小、方向|时间） */
@media (max-width:640px){
  #p2p-table tr, #file-table tr, .tbl-users tr {
    display:grid; grid-template-columns:1fr 1fr; column-gap:18px; }
  #p2p-table td[data-label="名称"], #file-table td[data-label="文件名"],
  .tbl-users td[data-label="登录名"], #p2p-table td[data-label="操作"],
  #file-table td[data-label="操作"], .tbl-users td[data-label="操作"] { grid-column:1 / -1; }
  #file-table td[data-label="时间"] { grid-column:1 / -1; }
}
