/* 网恋模式：角色列表、创建面板与微信式聊天 */
.agent-row{
  display:flex;align-items:center;gap:12px;width:100%;
  padding:10px 12px;border:0;border-radius:14px;
  background:transparent;color:var(--color-foreground);
  text-align:left;cursor:pointer;font:inherit;
}
.agent-row:hover{background:var(--color-surface-2)}
.agent-avatar{
  width:48px;height:48px;border-radius:10px;overflow:hidden;flex:0 0 auto;
  background:var(--color-surface-3);display:flex;align-items:center;justify-content:center;
}
.agent-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.agent-avatar i{font-style:normal;font-weight:600;color:var(--color-muted-foreground)}
.agent-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.agent-main b{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.agent-last{font-size:12.5px;color:var(--color-subtle-foreground);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.agent-side{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex:0 0 auto}
.agent-time{font-size:11.5px;color:var(--color-faint)}
.agent-badge{
  min-width:18px;height:18px;padding:0 5px;border-radius:9px;
  background:var(--color-destructive);color:#fff;font-size:11px;
  display:flex;align-items:center;justify-content:center;
}
.mine-empty .sub{display:block;margin-top:6px;font-size:12.5px;color:var(--color-faint)}

/* 新建角色面板 */
.agent-sheet-mask{
  position:fixed;inset:0;z-index:120;background:rgba(4,7,16,.62);
  display:flex;align-items:flex-end;justify-content:center;
}
.agent-sheet{
  width:100%;max-width:520px;max-height:88vh;overflow:auto;
  background:var(--color-surface);border-radius:20px 20px 0 0;
  border-top:1px solid var(--color-border);
  display:flex;flex-direction:column;
}
.agent-sheet-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 18px 10px;font-size:16px;
}
.agent-sheet-close{background:transparent;border:0;color:var(--color-muted-foreground);font-size:22px;cursor:pointer}
.agent-sheet-body{padding:4px 18px 8px;display:flex;flex-direction:column;gap:14px}
.agent-field{display:flex;flex-direction:column;gap:6px;font-size:12.5px;color:var(--color-subtle-foreground)}
.agent-field input,.agent-field textarea{
  width:100%;padding:11px 13px;border-radius:12px;
  border:1px solid var(--color-border);background:var(--color-surface-2);
  color:var(--color-foreground);font:inherit;font-size:14px;resize:vertical;
}
.agent-field input:focus,.agent-field textarea:focus{outline:none;border-color:var(--color-primary)}
.agent-avatar-pick{
  display:flex;align-items:center;gap:12px;cursor:pointer;
}
.agent-avatar-preview{
  width:68px;height:68px;border-radius:50%;overflow:hidden;flex:0 0 auto;
  background:var(--color-surface-3);display:flex;align-items:center;justify-content:center;
  font-size:12px;color:var(--color-faint);
}
.agent-avatar-preview img{width:100%;height:100%;object-fit:cover}
.agent-gender{display:flex;gap:8px}
.agent-gender button{
  padding:8px 16px;border-radius:12px;border:1px solid var(--color-border);
  background:var(--color-surface-2);color:var(--color-muted-foreground);
  font:inherit;font-size:13px;cursor:pointer;
}
.agent-gender button.is-on{
  background:var(--color-primary-soft);border-color:var(--color-primary);color:var(--color-primary);
}
.agent-sheet-foot{padding:12px 18px 20px;position:sticky;bottom:0;background:var(--color-surface)}
.agent-btn-primary{
  width:100%;padding:13px;border-radius:14px;border:0;
  background:var(--color-primary);color:#0b1020;font:inherit;font-size:15px;font-weight:600;cursor:pointer;
}
.agent-btn-primary:disabled{opacity:.6;cursor:default}

/* 聊天页 */
.agent-chat{
  position:fixed;inset:0;z-index:130;display:flex;flex-direction:column;
  background:var(--color-background);
}
.agent-chat-head{
  display:flex;align-items:center;gap:8px;padding:10px 12px;
  background:var(--color-surface);border-bottom:1px solid var(--color-border);
}
.agent-chat-back,.agent-chat-menu{
  width:36px;height:36px;border:0;border-radius:12px;background:transparent;
  color:var(--color-foreground);font-size:22px;line-height:1;cursor:pointer;
}
.agent-chat-title{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px}
.agent-chat-title b{font-size:15px}
.agent-chat-title span{font-size:11.5px;color:var(--color-faint)}
.agent-chat-body{
  flex:1;overflow-y:auto;padding:14px 12px;display:flex;flex-direction:column;gap:10px;
}
.agent-msg{display:flex;align-items:flex-start;gap:8px;max-width:100%}
.agent-msg.mine{flex-direction:row-reverse}
.agent-chat-av{
  width:38px;height:38px;border-radius:8px;overflow:hidden;flex:0 0 auto;
  background:var(--color-surface-3);display:flex;align-items:center;justify-content:center;
  font-size:14px;color:var(--color-muted-foreground);
}
.agent-chat-av img{width:100%;height:100%;object-fit:cover}
.agent-chat-av i{font-style:normal}
.agent-chat-text{
  max-width:min(74%,420px);padding:9px 12px;border-radius:10px;
  background:var(--color-surface-2);color:var(--color-foreground);
  font-size:14.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word;
}
.agent-msg.mine .agent-chat-text{background:#3eb575;color:#fff}
.agent-chat-text.typing{color:var(--color-faint)}
.agent-chat-img{max-width:200px;max-height:240px;border-radius:10px;display:block}
.agent-chat-input{
  display:flex;align-items:flex-end;gap:8px;padding:8px 10px 12px;
  background:var(--color-surface);border-top:1px solid var(--color-border);
}
.agent-chat-input textarea{
  flex:1;min-height:38px;max-height:96px;padding:9px 12px;border-radius:18px;
  border:1px solid var(--color-border);background:var(--color-surface-2);
  color:var(--color-foreground);font:inherit;font-size:14.5px;resize:none;
}
.agent-chat-input textarea:focus{outline:none;border-color:var(--color-primary)}
.agent-emoji-btn,.agent-img-btn{
  width:38px;height:38px;border:0;border-radius:12px;background:var(--color-surface-2);
  color:var(--color-foreground);font-size:17px;cursor:pointer;flex:0 0 auto;
}
.agent-send{
  height:38px;padding:0 16px;border:0;border-radius:19px;
  background:var(--color-primary);color:#0b1020;font:inherit;font-size:14px;font-weight:600;cursor:pointer;
}
.agent-send:disabled{background:var(--color-surface-3);color:var(--color-faint);cursor:default}
.agent-chat-emoji{
  display:grid;grid-template-columns:repeat(10,1fr);gap:4px;
  padding:8px 10px;background:var(--color-surface);border-top:1px solid var(--color-border);
}
.agent-chat-emoji button{
  border:0;background:transparent;font-size:20px;padding:4px;cursor:pointer;border-radius:8px;
}
.agent-chat-emoji button:hover{background:var(--color-surface-2)}