:root{
  --canvas:#f4f4f6;
  --white:#ffffff;
  --accent:#6d5ae6;
  --accent-2:#8b5cf6;
  --accent-soft:#efedfb;
  --text:#24242a;
  --text-2:#6a6a74;
  --text-3:#9a9aa4;
  --border:#ededf0;
  --hover:#eeeef1;
  --active:#e9e9ef;
  --agent-avatar:#26262c;
  --shadow:0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(20,20,40,.05);
  font-size:14px;
}

*{box-sizing:border-box;margin:0;padding:0;}
[hidden]{display:none !important;}
html,body{height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:var(--canvas);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
a{color:inherit;text-decoration:none;}
::-webkit-scrollbar{width:8px;height:8px;}
::-webkit-scrollbar-thumb{background:#d7d7dd;border-radius:8px;}
::-webkit-scrollbar-thumb:hover{background:#c3c3cc;}

.app{
  display:flex;
  height:100vh;
  overflow:hidden;
  background:var(--canvas);
}

/* ============ 通用图标按钮 ============ */
.icon-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:8px;color:var(--text-2);
  transition:background .15s,color .15s;
}
.icon-btn:hover{background:var(--hover);color:var(--text);}
.icon-btn svg path,.icon-btn svg circle,.icon-btn svg rect{}

/* ============ 左侧导航 ============ */
.sidebar{
  width:212px;min-width:212px;
  display:flex;flex-direction:column;
  padding:14px 12px 12px;
  background:var(--canvas);
}
.brand{
  display:flex;align-items:center;justify-content:space-between;
  padding:2px 6px 14px;
}
.brand-left{display:flex;align-items:center;gap:8px;}
.brand-name{font-size:20px;font-weight:800;letter-spacing:.5px;}
.brand-logo{
  width:22px;height:22px;border-radius:50%;
  background:
    radial-gradient(circle at 30% 30%, #a78bfa, transparent 60%),
    radial-gradient(circle at 70% 65%, #6d5ae6, #4f46e5);
  box-shadow:0 0 0 3px #fff, 0 2px 6px rgba(109,90,230,.4);
  position:relative;
}
.brand-logo::after{
  content:"";position:absolute;right:-3px;bottom:-3px;
  width:9px;height:9px;border-radius:50%;
  background:#6d5ae6;border:2px solid var(--canvas);
}

.nav{display:flex;flex-direction:column;gap:2px;}
.nav-item{
  display:flex;align-items:center;gap:11px;
  padding:9px 11px;border-radius:10px;color:var(--text-2);
  font-size:14.5px;font-weight:500;transition:background .15s,color .15s;
}
.nav-item .ic{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.nav-item:hover{background:var(--hover);color:var(--text);}
.nav-item.active{background:var(--active);color:var(--text);font-weight:600;}
.nav-item.active .ic{stroke:var(--accent);}
.nav-sep{height:1px;background:var(--border);margin:9px 8px;}

.sidebar-bottom{margin-top:auto;display:flex;flex-direction:column;gap:1px;padding-top:8px;}
.mini-item{
  display:flex;align-items:center;gap:9px;
  padding:7px 11px;border-radius:9px;color:var(--text-2);font-size:13px;
  transition:background .15s;
}
.mini-item:hover{background:var(--hover);}
.mini-ic{width:17px;height:17px;display:inline-flex;align-items:center;justify-content:center;font-size:14px;}
.foot-icons{display:flex;gap:2px;padding:8px 4px 2px;}

/* ============ 中间会话列表 ============ */
.list-col{
  width:262px;min-width:262px;
  display:flex;flex-direction:column;
  background:var(--white);
  border-left:1px solid var(--border);
  border-right:1px solid var(--border);
}
.list-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 14px 10px;
}
.list-title{font-size:18px;font-weight:700;}
.list-actions{display:flex;gap:2px;}
.new-chat{
  display:flex;align-items:center;justify-content:center;gap:7px;
  margin:2px 14px 10px;padding:11px;border-radius:11px;
  border:1px solid var(--border);color:var(--text);font-size:14px;font-weight:500;
  transition:background .15s,border-color .15s;
}
.new-chat:hover{background:var(--hover);border-color:#e0e0e5;}

.bot-list{flex:1;overflow-y:auto;padding:0 8px 14px;}
.bot-item{
  display:flex;align-items:center;gap:11px;
  padding:9px 8px;border-radius:11px;cursor:pointer;
  transition:background .12s;position:relative;
}
.bot-item:hover{background:var(--hover);}
.bot-item.active{background:var(--active);}
.bot-item .pin{
  margin-left:auto;color:var(--accent);opacity:.85;
  width:16px;height:16px;flex:0 0 auto;
}
.bot-item.model .pin{display:none;}
.bot-name{font-size:14.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* 头像 */
.avatar{
  width:30px;height:30px;border-radius:50%;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  background:var(--agent-avatar);color:#fff;
}
.avatar svg{width:17px;height:17px;}
.avatar.a-claude{background:#fbeee6;}
.avatar.a-gemini{background:#eef2ff;}
.avatar.a-gpt{background:#0f0f10;}
.avatar.a-grok{background:#0f0f10;}
.avatar.sm{width:20px;height:20px;}
.avatar.sm svg{width:12px;height:12px;}

/* ============ 右侧对话区 ============ */
.chat-col{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--white);}
.view{flex:1;min-height:0;display:flex;flex-direction:column;}
.chat-head{
  display:flex;align-items:center;gap:6px;
  padding:14px 18px;border-bottom:1px solid var(--border);
}
.chat-head .back{margin-left:-6px;}
.chat-title{font-size:16px;font-weight:600;}
.chat-head .icon-btn:last-child{margin-left:auto;}

.messages{
  flex:1;overflow-y:auto;padding:26px 0 20px;
  scroll-behavior:smooth;
}
.msg{max-width:760px;margin:0 auto;padding:0 40px 26px;}
.msg-role{
  display:flex;align-items:center;gap:8px;
  font-size:14px;font-weight:600;color:var(--text-2);margin-bottom:12px;
}
.msg.user .msg-role{color:var(--text);}
.msg-body{font-size:15px;line-height:1.9;color:var(--text);word-wrap:break-word;}
.msg.user{display:flex;flex-direction:column;align-items:flex-end;}
.msg.user .msg-body{
  background:var(--accent-soft);
  padding:11px 15px;border-radius:16px 16px 4px 16px;line-height:1.7;
  max-width:82%;text-align:left;
}
.msg-body h1{font-size:22px;font-weight:800;margin:6px 0 14px;line-height:1.4;}
.msg-body h2{font-size:18px;font-weight:700;margin:14px 0 8px;}
.msg-body h3{font-size:16px;font-weight:700;margin:12px 0 6px;}
.msg-body p{margin:0 0 14px;}
.msg-body p:last-child{margin-bottom:0;}
.msg-body strong{font-weight:700;}
.msg-body em{font-style:italic;}
.msg-body code{background:#f2f2f5;padding:1px 6px;border-radius:5px;font-size:13px;
  font-family:"SF Mono",Consolas,Monaco,monospace;}
.msg-body ul,.msg-body ol{margin:0 0 14px;padding-left:22px;}
.msg-body li{margin:4px 0;}
.msg-body ul li{list-style:disc;}
.msg-body ol li{list-style:decimal;}
.cursor-blink::after{content:"▍";color:var(--accent);animation:blink 1s steps(2) infinite;margin-left:1px;}
@keyframes blink{0%,50%{opacity:1;}50.01%,100%{opacity:0;}}

/* ============ 输入区 ============ */
.composer{
  max-width:760px;width:100%;margin:0 auto;
  padding:10px 40px 22px;
}
.composer-inner{}
.composer-top{display:flex;align-items:center;gap:6px;margin-bottom:8px;}
.bot-pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 10px 5px 6px;border-radius:20px;background:#f2f2f5;
  font-size:13px;font-weight:500;color:var(--text);
}
.pill-avatar{width:20px;height:20px;border-radius:50%;background:var(--agent-avatar);
  display:inline-flex;align-items:center;justify-content:center;color:#fff;}
.pill-avatar svg{width:12px;height:12px;}

.composer-input{
  width:100%;border:1px solid var(--border);border-radius:16px;
  padding:15px 16px;font-size:15px;line-height:1.6;resize:none;
  background:var(--white);color:var(--text);
  max-height:200px;transition:border-color .15s,box-shadow .15s;
  outline:none;
}
.composer-input:focus{border-color:#cfc9f5;box-shadow:0 0 0 3px rgba(109,90,230,.10);}
.composer-input::placeholder{color:var(--text-3);}

.composer-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:10px;}
.web-toggle{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 12px;border-radius:20px;border:1px solid var(--border);
  font-size:13px;color:var(--text-2);
}
.switch{width:32px;height:18px;border-radius:20px;background:#d4d4da;position:relative;transition:background .18s;flex:0 0 auto;}
.switch .knob{position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left .18s;box-shadow:0 1px 2px rgba(0,0,0,.2);}
.switch.on{background:var(--accent);}
.switch.on .knob{left:16px;}

.send-btn{
  width:38px;height:38px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--accent);color:#fff;transition:opacity .15s,transform .1s;
}
.send-btn:hover{opacity:.9;}
.send-btn:active{transform:scale(.94);}
.send-btn:disabled{background:#d7d5ea;cursor:not-allowed;}

/* ============ 占位视图 ============ */
.view-placeholder{align-items:center;justify-content:center;}
.placeholder-box{text-align:center;color:var(--text-3);}
.ph-icon{
  width:72px;height:72px;margin:0 auto 20px;border-radius:20px;
  background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;
}
.ph-icon svg{width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;}
.placeholder-box h2{font-size:22px;color:var(--text);margin-bottom:8px;font-weight:700;}
.placeholder-box p{font-size:14px;}

/* 空对话欢迎 */
.empty-hero{max-width:640px;margin:6vh auto 0;text-align:center;padding:0 40px;}
.empty-hero .hero-avatar{width:64px;height:64px;border-radius:50%;margin:0 auto 16px;background:var(--agent-avatar);display:flex;align-items:center;justify-content:center;color:#fff;}
.empty-hero .hero-avatar svg{width:34px;height:34px;}
.empty-hero h1{font-size:24px;font-weight:800;margin-bottom:10px;}
.empty-hero p{color:var(--text-2);font-size:14.5px;line-height:1.7;}
.suggest{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:22px;}
.suggest button{
  padding:9px 15px;border:1px solid var(--border);border-radius:22px;
  font-size:13.5px;color:var(--text);background:var(--white);transition:.15s;
}
.suggest button:hover{border-color:#cfc9f5;background:var(--accent-soft);}

/* ============ 新增功能组件 ============ */
.web-toggle{cursor:pointer;user-select:none;}
.only-mobile{display:none;}

/* 搜索 */
.search-wrap{padding:0 14px 8px;}
.search-input{width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:10px;font-size:13.5px;outline:none;background:var(--white);color:var(--text);}
.search-input:focus{border-color:#cfc9f5;box-shadow:0 0 0 3px rgba(109,90,230,.08);}
.list-empty{padding:22px 14px;color:var(--text-3);font-size:13px;text-align:center;}

/* 图钉 */
.bot-item .pin{margin-left:0;width:15px;height:15px;color:var(--text-3);}
.pin-btn{margin-left:auto;flex:0 0 auto;width:26px;height:26px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;opacity:0;transition:opacity .12s,background .12s;}
.bot-item:hover .pin-btn{opacity:1;}
.pin-btn:hover{background:rgba(0,0,0,.06);}
.pin-btn:has(.pin.on){opacity:1;}
.pin.on{color:var(--accent);}

/* 下拉菜单 */
.menu-anchor{position:relative;display:inline-flex;}
.menu{position:absolute;top:calc(100% + 6px);right:0;z-index:50;min-width:184px;
  background:var(--white);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:6px;}
.menu.menu-up{top:auto;bottom:calc(100% + 8px);left:0;right:auto;max-height:340px;overflow-y:auto;}
.menu button{display:flex;align-items:center;gap:9px;width:100%;padding:9px 10px;border-radius:8px;
  font-size:13.5px;text-align:left;color:var(--text);white-space:nowrap;}
.menu button:hover{background:var(--hover);}

/* 图片上传预览 + 消息里的图片 */
.attach-preview{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 0;}
.thumb{position:relative;width:56px;height:56px;border-radius:10px;overflow:hidden;border:1px solid var(--border);}
.thumb img{width:100%;height:100%;object-fit:cover;}
.thumb button{position:absolute;top:2px;right:2px;width:18px;height:18px;border-radius:50%;
  background:rgba(0,0,0,.6);color:#fff;font-size:13px;line-height:1;display:flex;align-items:center;justify-content:center;}
.msg-imgs{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-bottom:8px;}
.msg-imgs img{max-width:200px;max-height:200px;border-radius:12px;border:1px solid var(--border);}

/* 表格（分镜脚本用）*/
.tbl-wrap{overflow-x:auto;margin:0 0 14px;}
.msg-body table{border-collapse:collapse;font-size:13px;min-width:640px;}
.msg-body th,.msg-body td{border:1px solid var(--border);padding:6px 10px;text-align:left;vertical-align:top;line-height:1.5;}
.msg-body th{background:var(--canvas);font-weight:600;white-space:nowrap;}

/* toast */
.toast{position:fixed;bottom:34px;left:50%;transform:translateX(-50%) translateY(10px);
  background:#26262c;color:#fff;padding:9px 16px;border-radius:20px;font-size:13px;
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:100;}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}

/* 折叠 */
.app.sidebar-collapsed .sidebar{display:none;}
.app.list-collapsed .list-col{display:none;}

/* 窄屏：列表 ↔ 对话 单栏切换 */
@media (max-width:760px){
  .sidebar{display:none;}
  .list-col{width:100%;min-width:0;border:none;}
  .chat-col{display:none;}
  .app.show-chat-mobile .list-col{display:none;}
  .app.show-chat-mobile .chat-col{display:flex;}
  .only-mobile{display:inline-flex;}
  .msg{padding:0 18px 22px;}
  .composer{padding:10px 18px 18px;}
}

/* ---------- 深度思考过程区 ---------- */
.think-box{
  border:1px solid var(--line,#e6e6ea); border-radius:10px;
  background:#fafafa; margin:0 0 10px; overflow:hidden; font-size:13px;
}
.think-head{
  display:flex; align-items:center; gap:6px; cursor:pointer; user-select:none;
  padding:8px 12px; color:#8a8a94; font-size:12.5px;
}
.think-head .caret{transition:transform .18s; flex:0 0 auto;}
.think-box.collapsed .caret{transform:rotate(-90deg);}
.think-body{
  padding:0 12px 10px; color:#7a7a85; line-height:1.75; white-space:pre-wrap;
  max-height:220px; overflow-y:auto; border-top:1px solid #eee; padding-top:8px;
}
.think-box.collapsed .think-body{display:none;}
.think-dot{
  width:6px;height:6px;border-radius:50%;background:var(--accent,#6b5bff);
  flex:0 0 auto; animation:thinkPulse 1s ease-in-out infinite;
}
@keyframes thinkPulse{0%,100%{opacity:.3;}50%{opacity:1;}}

/* ---------- 上传的文档 ---------- */
.doc-chip{
  display:inline-flex; align-items:center; gap:6px; max-width:220px;
  padding:6px 8px 6px 9px; margin:0 6px 6px 0; border:1px solid var(--line,#e6e6ea);
  border-radius:8px; background:#fff; font-size:12.5px; color:#4a4a55; vertical-align:top;
}
.doc-chip .doc-name{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.doc-chip button{
  border:0; background:transparent; cursor:pointer; color:#9a9aa4;
  font-size:15px; line-height:1; padding:0 2px; flex:0 0 auto;
}
.doc-chip button:hover{color:#e5484d;}
.msg-docs{display:flex; flex-wrap:wrap; justify-content:flex-end; margin-bottom:6px;}
.msg.user .msg-docs .doc-chip{background:rgba(255,255,255,.9);}

/* ---------- 移动端修正（必须放在文件最后，否则被前面的 @media 覆盖）---------- */
@media (max-width:760px){
  /* iOS 上输入框字号 <16px 会在聚焦时自动放大整页，必须 ≥16px */
  .composer-input{
    font-size:16px;
    min-height:88px;   /* 容得下两行 placeholder（实测 16px 字号下需 81px，留余量）*/
  }
  /* 开关和按钮在窄屏别挤成一团 */
  .composer-bottom{gap:8px;}
  .web-toggle{padding:5px 10px;font-size:12.5px;}
}

/* ---------- 平板档（761—1024px）----------
   原来只有 760px 一个断点，iPad 竖屏 768 会掉进桌面三栏，
   实测三栏挤成 212+260+294，聊天区比手机还窄、表格容器只剩 206px。
   这一档收起左侧导航，把宽度让给列表+聊天两栏。 */
@media (min-width:761px) and (max-width:1024px){
  .sidebar{display:none;}
  .list-col{width:232px;min-width:232px;border-left:none;}
  .composer-input{
    font-size:16px;
    min-height:88px;   /* 同移动端：长 placeholder 不被切 */
  }
  .composer-bottom{gap:8px;}
  .web-toggle{padding:5px 10px;font-size:12.5px;}
}

/* ---------- 每条回复下方的操作按钮 ---------- */
.msg-acts{
  display:flex; gap:8px; margin-top:10px; opacity:0; transition:opacity .15s;
}
.msg.assistant:hover .msg-acts{opacity:1;}
.msg-acts button{
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 10px; border:1px solid var(--line,#e6e6ea); border-radius:7px;
  background:#fff; color:#6a6a74; font-size:12.5px; cursor:pointer;
  transition:background .15s,color .15s,border-color .15s;
}
.msg-acts button:hover{background:var(--accent-soft,#efedfb); color:var(--accent,#6d5ae6); border-color:var(--accent,#6d5ae6);}
.msg-acts button:disabled{opacity:.55; cursor:default;}
/* 手机上没有 hover，直接常显 */
@media (max-width:760px){ .msg-acts{opacity:1;} }

/* ---------- 引用（划词引用 / 引用整条） ---------- */
.quote-bar{
  display:flex; align-items:flex-start; gap:8px;
  margin:0 0 8px; padding:8px 10px 8px 12px;
  background:#f7f6fd; border-left:3px solid var(--accent,#6d5ae6); border-radius:0 8px 8px 0;
}
.quote-text{
  flex:1; font-size:13px; color:#6a6a74; line-height:1.6;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.quote-x{
  flex:0 0 auto; border:0; background:transparent; color:#9a9aa4;
  font-size:17px; line-height:1; cursor:pointer; padding:0 2px;
}
.quote-x:hover{color:#e5484d;}
.quick-asks{display:flex; gap:8px; flex-wrap:wrap; margin:0 0 8px;}
.quick-asks button{
  padding:6px 12px; border:1px solid var(--line,#e6e6ea); border-radius:16px;
  background:#fff; color:#4a4a55; font-size:12.5px; cursor:pointer;
}
.quick-asks button:hover{background:var(--accent-soft,#efedfb); color:var(--accent,#6d5ae6); border-color:var(--accent,#6d5ae6);}
/* 划词后浮出的「引用」按钮 */
#quotePop{
  position:absolute; z-index:60; display:none;
  padding:6px 12px; border-radius:8px; border:0;
  background:#2b2b33; color:#fff; font-size:12.5px; cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.22);
}
#quotePop:hover{background:var(--accent,#6d5ae6);}
/* 用户气泡里的引用块 */
.msg.user .msg-quote{
  border-left:3px solid rgba(255,255,255,.5); padding:4px 0 4px 8px;
  margin-bottom:6px; font-size:12.5px; opacity:.85; text-align:left;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}

/* ---------- 左侧历史对话列表 ---------- */
.sess-head{
  display:flex; align-items:center; justify-content:space-between;
  margin:14px 6px 6px; padding:0 4px;
  font-size:12px; color:#9a9aa4; letter-spacing:.5px;
}
.sess-head .sess-clear{width:22px;height:22px;opacity:.6;}
.sess-head .sess-clear:hover{opacity:1;color:#e5484d;}
.sess-list{flex:1 1 auto; overflow-y:auto; margin:0 -2px; padding:0 2px;}
.sess-item{
  display:flex; align-items:center; gap:6px;
  padding:8px 8px; margin-bottom:2px; border-radius:8px;
  cursor:pointer; color:var(--text-2,#6a6a74); font-size:13px;
  transition:background .14s;
}
.sess-item:hover{background:var(--hover,#f1f0f6);}
.sess-item.active{background:var(--active,#e9e7f5); color:var(--text,#1f2430); font-weight:600;}
.sess-main{flex:1; min-width:0;}
.sess-title{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.35;
}
.sess-meta{font-size:11px; color:#a8a8b2; margin-top:2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.sess-del{
  flex:0 0 auto; border:0; background:transparent; color:#b8b8c2;
  font-size:15px; line-height:1; cursor:pointer; padding:0 2px; opacity:0;
}
.sess-item:hover .sess-del{opacity:1;}
.sess-del:hover{color:#e5484d;}
.sess-empty{padding:10px 8px; font-size:12px; color:#b0b0ba; line-height:1.6;}
/* 侧栏要能纵向撑开给列表滚动 */
.sidebar{overflow:hidden;}
@media (max-width:760px){
  .sess-list{max-height:38vh;}
}

/* ---------- 移动端：侧栏改成滑出抽屉，否则手机上看不到历史对话 ---------- */
.drawer-mask{display:none;}
@media (max-width:760px){
  .sidebar{
    display:flex !important;
    position:fixed; left:0; top:0; bottom:0; z-index:80;
    width:78vw; max-width:300px;
    transform:translateX(-100%) !important;
    transition:transform .22s ease;
    background:var(--canvas,#f7f7fa);
    box-shadow:2px 0 18px rgba(0,0,0,.18);
  }
  .app.drawer-open .sidebar{transform:translateX(0) !important;}
  .app.drawer-open .drawer-mask{
    display:block; position:fixed; inset:0; z-index:70;
    background:rgba(0,0,0,.35);
  }
  .sess-list{max-height:none; flex:1 1 auto;}
}

/* ---------- 登录页 ---------- */
.login-mask{position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(140deg,#f4f3fb,#eceafa);}
.login-box{width:340px; max-width:88vw; background:#fff; border-radius:16px; padding:34px 28px 26px;
  box-shadow:0 12px 44px rgba(60,50,120,.16);}
.login-brand{font-size:21px; font-weight:700; color:var(--accent,#6d5ae6); text-align:center;}
.login-sub{font-size:13px; color:#9a9aa4; text-align:center; margin:6px 0 22px;}
.login-input{width:100%; box-sizing:border-box; height:44px; padding:0 14px; margin-bottom:12px;
  border:1px solid var(--line,#e6e6ea); border-radius:10px; font-size:15px; outline:none;
  background:#fbfbfd; transition:border-color .15s;}
.login-input:focus{border-color:var(--accent,#6d5ae6); background:#fff;}
.login-btn{width:100%; height:44px; border:0; border-radius:10px; cursor:pointer;
  background:var(--accent,#6d5ae6); color:#fff; font-size:15px; font-weight:600; letter-spacing:2px;}
.login-btn:hover{filter:brightness(1.06);} .login-btn:disabled{opacity:.6; cursor:default;}
.login-err{background:#fdecec; color:#c0392b; font-size:13px; padding:8px 10px; border-radius:8px; margin-bottom:10px;}
.login-tip{font-size:12px; color:#a8a8b2; text-align:center; margin-top:14px; line-height:1.6;}

/* ---------- 侧栏底部：当前用户 ---------- */
.side-foot{margin-top:auto; padding:10px 6px 4px; border-top:1px solid var(--line,#e6e6ea);}
.me-row{display:flex; align-items:center; gap:6px; padding:0 4px;}
.me-name{font-size:13px; font-weight:600; color:var(--text,#1f2430);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.me-role{font-size:11px; color:#fff; background:var(--accent,#6d5ae6); border-radius:4px; padding:1px 5px;}
.me-role.user{background:#a8a8b2;}
.me-acts{display:flex; gap:10px; padding:6px 4px 0;}
.mini-link{border:0; background:transparent; color:#8a8a94; font-size:12px; cursor:pointer; padding:0;}
.mini-link:hover{color:var(--accent,#6d5ae6); text-decoration:underline;}

/* ---------- 用户管理弹窗 ---------- */
.modal-mask{position:fixed; inset:0; z-index:190; background:rgba(20,18,40,.42);
  display:flex; align-items:center; justify-content:center;}
.modal-box{width:660px; max-width:94vw; max-height:82vh; background:#fff; border-radius:14px;
  display:flex; flex-direction:column; box-shadow:0 14px 44px rgba(0,0,0,.24);}
.modal-head{display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--line,#e6e6ea); font-weight:700;}
.modal-body{padding:16px 20px 20px; overflow-y:auto;}
.add-row{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px;}
.mini-input{height:34px; padding:0 10px; border:1px solid var(--line,#e6e6ea); border-radius:8px;
  font-size:13px; outline:none; flex:1 1 120px; min-width:0;}
.mini-input:focus{border-color:var(--accent,#6d5ae6);}
.mini-btn{height:34px; padding:0 16px; border:0; border-radius:8px; cursor:pointer;
  background:var(--accent,#6d5ae6); color:#fff; font-size:13px; flex:0 0 auto;}
.user-list{border:1px solid var(--line,#e6e6ea); border-radius:10px; overflow:hidden;}
.u-row{display:flex; align-items:center; gap:10px; padding:10px 12px; font-size:13px;
  border-bottom:1px solid #f0f0f4;}
.u-row:last-child{border-bottom:0;}
.u-row.off{background:#fafafa; color:#a8a8b2;}
.u-name{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.u-tag{font-size:11px; padding:1px 6px; border-radius:4px; background:#eee; color:#666;}
.u-tag.admin{background:var(--accent-soft,#efedfb); color:var(--accent,#6d5ae6);}
.u-tag.off{background:#fdecec; color:#c0392b;}
.u-acts{display:flex; gap:8px; flex:0 0 auto;}
@media (max-width:760px){ .add-row .mini-input{flex:1 1 100%;} }

/* ---------- 用户管理：设备与授权 ---------- */
.u-row{flex-direction:column; align-items:stretch; gap:6px;}
.u-line1{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.u-tag.on{background:#e6f6ee; color:#0f6e56;}
.u-exp{font-size:11px; color:#a8a8b2; margin-left:auto;}
.u-devs{display:flex; flex-wrap:wrap; gap:6px;}
.dev-chip{display:inline-flex; align-items:center; gap:5px; font-size:11px;
  background:#f5f5f8; border-radius:6px; padding:3px 6px 3px 8px; color:#6a6a74;}
.dev-x{border:0; background:transparent; color:#b8b8c2; cursor:pointer; font-size:13px; line-height:1; padding:0 1px;}
.dev-x:hover{color:#e5484d;}
.u-acts{display:flex; gap:10px; flex-wrap:wrap;}
.mini-link:disabled{opacity:.4; cursor:default; text-decoration:none;}

/* ---------- 客户 LOGO ---------- */
.login-logo{
  display:block; width:150px; height:auto; margin:0 auto 10px;
  /* 金色 logo 在浅色卡片上加一点点投影，边缘更立体 */
  filter:drop-shadow(0 2px 6px rgba(180,140,40,.22));
}
.login-brand{font-size:18px; letter-spacing:3px; color:#8a6a1e; font-weight:700;}
.brand-mark{
  /* 客户品牌横版 logo（金色 D 标 + 鼎流传媒），由 logo.png 竖版重排合成，@2x 出图 */
  height:32px; width:auto; max-width:100%; flex:0 1 auto; margin-right:2px;
  object-fit:contain;
  filter:drop-shadow(0 1px 2px rgba(180,140,40,.25));
}
.brand-left{display:flex; align-items:center; gap:6px;}
.app.sidebar-collapsed .brand-mark{margin-right:0;}

/* 移动端忽略桌面端的「收起列表」状态：
   移动端 chat-col 默认就是 none，若 list-col 再被 list-collapsed 隐藏，两栏全没 → 白屏。
   （审计实测：桌面收起列表后把窗口缩到手机宽度，整页空白） */
@media (max-width:760px){
  .app.list-collapsed .list-col{display:flex;}
  .app.list-collapsed.show-chat-mobile .list-col{display:none;}
}

/* ---------- 登录页：客户品牌海报 ---------- */
.login-mask{
  background:linear-gradient(150deg,#f6f1e6,#efe6d4 60%,#f7f3ea);
  overflow-y:auto; padding:18px;
}
.login-box{
  width:auto; max-width:min(760px,94vw); padding:0; overflow:hidden;
  background:linear-gradient(168deg,#fffdf8,#faf3e4);
  border:1px solid #f0e6cf; border-radius:16px;
  display:flex; align-items:stretch;
}
.brand-poster-img{display:block; width:330px; height:auto; object-fit:contain; flex:0 0 auto;}
.login-form{
  flex:1 1 300px; min-width:288px; align-self:center;
  padding:34px 34px 30px; box-sizing:border-box;
}
.login-input{width:100%; box-sizing:border-box; background:#fffdf9; border-color:#ecdfc4;}
.login-input:focus{border-color:#d4a94a; background:#fff;}
.login-btn{
  width:100%;
  background:linear-gradient(180deg,#e0b859,#c1902f);
  box-shadow:0 3px 10px rgba(180,140,45,.32);
}
.login-btn:hover{filter:brightness(1.07);}
.login-tip{color:#b3a184;}
.login-sub, .login-brand{display:none;}

/* 窄屏：改成上下排，海报缩小只保留品牌感 */
@media (max-width:720px){
  .login-box{flex-direction:column; max-width:min(400px,92vw);}
  .brand-poster-img{width:100%; max-height:44vh; object-fit:contain; padding-top:10px;}
  .login-form{padding:16px 22px 22px; min-width:0; width:100%;}
}

/* ── 历史搬家弹窗（旧 IP 入口 → 新域名，过渡期功能）── */
.sess-move{margin-left:auto;}
.sess-head .sess-clear{margin-left:6px;}
.move-tip{margin:0 0 10px; font-size:13px; line-height:1.7; color:var(--ink-2,#555);}
.move-code{
  font-size:30px; font-weight:800; letter-spacing:6px; text-align:center;
  padding:14px 0; margin:6px 0 12px; border-radius:10px;
  background:#f5f3ff; color:#5b4ae0; user-select:all;
}
.move-acts{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px;}
.mini-btn.primary{background:#6d5ae6; color:#fff; border-color:#6d5ae6;}
#moveBody .login-input{width:100%; text-align:center; letter-spacing:6px; font-size:20px;}
