/* ─── Conversation dropdown menu ─── */
.conv-dropdown {
  position: fixed; z-index: 300;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.09);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  padding: 4px; min-width: 130px;
  animation: fadeUp 0.12s ease;
}
.conv-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 11px;
  border: none; background: none; border-radius: 7px;
  font-size: 13px; font-family: var(--font);
  color: var(--text-2); cursor: pointer; text-align: left;
  transition: background 0.1s;
}
.conv-dropdown-item:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.conv-dropdown-item.danger { color: #c0392b; }
.conv-dropdown-item.danger:hover { background: rgba(192,57,43,0.07); }

/* ─── Delete confirm dialog ─── */
#conv-confirm-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.22); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
#conv-confirm-overlay.hidden { display: none; }
.conv-confirm-box {
  background: #fff; border-radius: 16px;
  padding: 26px 28px; width: 320px;
  box-shadow: 0 20px 56px rgba(0,0,0,0.16);
  border: 1px solid rgba(0,0,0,0.07);
}
.conv-confirm-box h3 {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 8px; font-family: var(--font);
}
.conv-confirm-box p {
  font-size: 13px; color: var(--text-2);
  line-height: 1.65; margin-bottom: 22px;
}
.conv-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.conv-confirm-cancel {
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent; color: var(--text-2);
  font-size: 13px; font-family: var(--font);
  cursor: pointer; transition: background 0.15s;
}
.conv-confirm-cancel:hover { background: rgba(0,0,0,0.04); }
.conv-confirm-delete-btn {
  padding: 8px 16px; border-radius: 8px; border: none;
  background: #c0392b; color: #fff;
  font-size: 13px; font-weight: 500; font-family: var(--font);
  cursor: pointer; transition: background 0.15s;
}
.conv-confirm-delete-btn:hover { background: #a93226; }

.conv-rename-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px;
  font-family: var(--font); padding: 0;
}

.conv-empty {
  padding: 12px 10px; font-size: 12px;
  color: var(--text-3); font-style: italic;
}

/* ─── Sidebar footer / user info ─── */
.sidebar-bottom {
  flex-shrink: 0;
  padding: 4px 12px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
}

.user-info-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; transition: background 0.15s; user-select: none;
}
.user-info-wrap:hover { background: rgba(0,0,0,0.05); }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; text-transform: uppercase;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.user-info-text { flex: 1; min-width: 0; }
.user-info-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── User menu dropdown ─── */
#user-menu {
  position: fixed; z-index: 500;
  background: #fff; border: 1px solid rgba(0,0,0,0.09);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  padding: 6px; min-width: 180px;
  display: none;
}
#user-menu.open { display: block; animation: fadeUp 0.12s ease; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border: none; background: none;
  border-radius: 8px; font-family: var(--font); font-size: 13px; color: var(--text);
  cursor: pointer; text-align: left; transition: background 0.1s;
}
.user-menu-item:hover { background: rgba(0,0,0,0.05); }
.user-menu-item.danger { color: #d97060; }
.user-menu-item.danger:hover { background: rgba(217,112,96,0.07); }
.user-menu-sep { height: 1px; background: var(--border); margin: 4px 8px; }
/* 菜单内的小开关（长期记忆） */
.menu-switch {
  margin-left: auto; flex-shrink: 0;
  width: 34px; height: 19px; border-radius: 999px;
  background: rgba(0,0,0,0.18); position: relative; transition: background 0.15s;
}
.menu-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: left 0.15s;
}
.user-menu-item.on .menu-switch { background: var(--accent); }
.user-menu-item.on .menu-switch::after { left: 17px; }
.user-menu-hint { padding: 1px 12px 6px; font-size: 11px; color: var(--text-3); line-height: 1.4; }
/* 菜单项右侧的未读红点（公告；tools/用户菜单通用） */
.menu-dot {
  margin-left: auto; flex-shrink: 0;
  width: 7px; height: 7px; border-radius: 50%; background: #e05050;
}
/* tools 菜单内的小开关（私密模式），视觉同用户菜单的 .menu-switch */
.tools-menu-item.on .menu-switch { background: var(--accent); }
.tools-menu-item.on .menu-switch::after { left: 17px; }
/* 网格按钮上的未读红点：菜单关着时也能看到有新公告 */
#tools-btn-dot {
  position: absolute; top: 5px; right: 5px; display: none;
  width: 7px; height: 7px; border-radius: 50%; background: #e05050;
  box-shadow: 0 0 0 1.5px #fff;
}
body.private-active #tools-btn-dot { box-shadow: 0 0 0 1.5px #0F0E16; }
/* 底部用户信息右侧的上箭头：提示「点这里会向上弹出菜单」（原来零可发现性） */
.user-info-caret { flex-shrink: 0; color: var(--text-3); display: flex; }

/* ── 2026-07-30 顶栏收敛：锁（私密模式）与铃铛（公告）收进底部用户菜单 ──
   按钮本体保留在 DOM（JS 状态与事件都挂在上面），仅视觉隐藏；
   菜单项通过 .click() 转发，状态类由 JS 同步。 */
#private-btn, #ann-btn { display: none !important; }

/* ─── Profile modal ─── */
#profile-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18,16,26,0.40);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
  display: flex; align-items: center; justify-content: center;
  animation: modalOverlayIn 0.18s ease;
}
#profile-overlay.hidden { display: none; }
.profile-box {
  background: #fff; border-radius: 18px; padding: 24px 26px 22px;
  width: min(440px, 92vw); display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 32px 80px -16px rgba(18,14,36,0.35), 0 4px 18px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
  animation: modalIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.profile-modal-title { display: flex; align-items: center; gap: 12px; }
.profile-modal-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #F4F4F6; border: 1px solid rgba(0,0,0,0.05);
  color: #52525B; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.profile-box h2 {
  font-size: 17px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text); margin: 0;
}
.profile-modal-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin: -4px -6px 0 0;
  transition: background 0.15s, color 0.15s;
}
.profile-modal-close:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.profile-avatar-wrap {
  display: flex; justify-content: center;
  position: relative; width: fit-content; margin: 0 auto;
  cursor: pointer;
}
.profile-avatar-circle {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: #fff; text-transform: uppercase;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 4px 14px rgba(18,14,36,0.12);
}
.profile-avatar-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* hover 时的「更换头像」遮罩：比紫色相机按钮更明确的可点提示 */
.profile-avatar-hover {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(18,16,26,0.48); color: #fff;
  font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.profile-avatar-wrap:hover .profile-avatar-hover { opacity: 1; }
.profile-avatar-camera {
  position: absolute; bottom: 2px; right: 2px; z-index: 1;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: #52525B;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
  pointer-events: none;
}
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-field label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.profile-field input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; font-size: 14px; font-family: var(--font);
  color: var(--text); background: #FAFAFA;
  border: 1px solid rgba(0,0,0,0.10); border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.profile-field input::placeholder { color: var(--text-3); }
.profile-field input:hover { border-color: rgba(0,0,0,0.18); }
.profile-field input:focus {
  background: #fff; border-color: rgba(26,26,24,0.50);
  box-shadow: 0 0 0 3.5px rgba(26,26,24,0.07);
}
.profile-field input[readonly] { background: #F4F4F6; color: var(--text-2); cursor: default; }
.profile-field input[readonly]:hover { border-color: rgba(0,0,0,0.10); }
.profile-readonly-wrap { position: relative; }
.profile-readonly-wrap input { padding-right: 36px; }
.profile-readonly-wrap svg {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.profile-field-note { font-size: 11px; color: var(--text-3); }
#profile-err { margin: -6px 0 -4px; }
.profile-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.profile-chpwd-link {
  background: none; border: none; color: var(--text-3); font-size: 12.5px;
  cursor: pointer; padding: 0; font-family: var(--font);
  transition: color 0.15s; text-decoration: underline; text-underline-offset: 3px;
}
.profile-chpwd-link:hover { color: var(--text); }
.profile-btn-group { display: flex; gap: 10px; }
.profile-btn {
  padding: 9px 18px; border-radius: 10px; font-size: 13.5px;
  font-family: var(--font); cursor: pointer; border: none;
  font-weight: 500; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.06s;
}
.profile-btn.primary {
  background: #7C3AED; color: #fff; font-weight: 600; padding: 9px 20px;
  box-shadow: 0 1px 3px rgba(124,58,237,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
}
.profile-btn.primary:hover:not(:disabled) { background: #6D28D9; }
.profile-btn.primary:active:not(:disabled) { transform: scale(0.975); }
.profile-btn.primary:disabled { background: #EFEFF1; color: #A1A1AA; box-shadow: none; cursor: not-allowed; }
.profile-btn.secondary {
  background: #fff; border: 1px solid rgba(0,0,0,0.12); color: var(--text-2);
}
.profile-btn.secondary:hover { background: #F5F5F6; border-color: rgba(0,0,0,0.16); }

/* ─── Model bar below input ─── */
#model-bar {
  max-width: var(--content-w);
  margin: 0 auto; padding: 5px 4px 0;
  display: flex; align-items: center; gap: 4px;
}
#main.welcome-mode #model-bar {
  max-width: min(860px, calc(100vw - var(--sidebar-w) - 48px));
}
#model-picker-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none;
  color: var(--text-3); font-size: 12px; font-family: var(--font);
  cursor: pointer; padding: 3px 8px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
#model-picker-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-2); }
#model-picker-btn svg { opacity: 0.6; }
.model-bar-hint {
  flex: 1; text-align: right;
  font-size: 11px; color: var(--text-3); padding-right: 2px;
}

/* Model dropdown */
#model-dropdown {
  position: fixed; z-index: 400;
  background: #fff; border: 1px solid rgba(0,0,0,0.09);
  border-radius: 14px; box-shadow: 0 10px 32px rgba(0,0,0,0.14);
  padding: 6px; width: 256px;
  display: none;
}
#model-dropdown.open { display: block; animation: fadeUp 0.12s ease; }
.model-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 11px; border: none; background: none;
  border-radius: 9px; font-family: var(--font); cursor: pointer; text-align: left;
  color: var(--text); transition: background 0.1s; position: relative;
}
.model-option:hover { background: rgba(0,0,0,0.045); }
.model-option.selected { background: rgba(0,0,0,0.05); }
.mo-text { display: flex; flex-direction: column; min-width: 0; }
.mo-name { font-size: 13px; font-weight: 500; line-height: 1.25; }
.mo-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.model-option.selected .mo-name { color: var(--text); }
.mo-check { color: var(--accent); flex-shrink: 0; opacity: 0; }
.model-option.selected .mo-check { opacity: 1; }
/* 禁用模型（如 Fable 5 测试中）：整行置灰、不可点 */
.model-option.disabled { color: #b8b8bf; cursor: not-allowed; opacity: 0.6; }
.model-option.disabled:hover { background: none; }
.model-soon {
  margin-left: 8px; font-size: 11px; font-weight: 500;
  color: #9a8fb0; background: rgba(0,0,0,0.05);
  padding: 1px 7px; border-radius: 999px;
}
/* 模型推理设置：主面板内的触发行 + 右侧弹出子菜单 */
.md-divider { height: 1px; background: rgba(0,0,0,0.07); margin: 5px 7px; }
.md-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: 9px; cursor: pointer; transition: background 0.1s;
}
.md-trigger:hover, .md-trigger.open { background: rgba(0,0,0,0.045); }
.md-trigger-label { font-size: 13px; color: var(--text); }
.md-trigger-val { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.md-trigger-val svg { opacity: 0.55; }
.md-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px;
}
.md-row-label { font-size: 13px; color: var(--text); }
/* 右侧弹出子菜单（effort 选项 + thinking 开关 + 帮助文案） */
#md-flyout {
  position: fixed; z-index: 401; display: none;
  background: #fff; border: 1px solid rgba(0,0,0,0.09);
  border-radius: 13px; box-shadow: 0 10px 32px rgba(0,0,0,0.15);
  padding: 8px; width: 234px;
}
#md-flyout.open { display: block; animation: fadeUp 0.12s ease; }
.md-fly-help { padding: 6px 9px 9px; font-size: 11.5px; line-height: 1.55; color: var(--text-3); }
.md-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.1s;
}
.md-opt:hover { background: rgba(0,0,0,0.045); }
.md-opt-name { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.md-opt-tag { font-size: 10.5px; color: var(--text-3); background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 999px; }
.md-opt-check { color: var(--accent); opacity: 0; flex-shrink: 0; }
.md-opt.active .md-opt-check { opacity: 1; }
.md-opt.active .md-opt-name { color: var(--text); font-weight: 500; }
/* Thinking 开关 */
.md-toggle {
  position: relative; width: 36px; height: 20px; border: none; cursor: pointer;
  border-radius: 999px; background: rgba(0,0,0,0.18); transition: background 0.15s; padding: 0; flex-shrink: 0;
}
.md-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}
.md-toggle.on { background: var(--accent); }
.md-toggle.on::after { transform: translateX(16px); }

/* Private mode button */
#private-btn {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 60;
}
#private-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-2); }
#private-btn.active { background: rgba(139,92,246,0.1); color: var(--accent); }

/* Announcement button */
#ann-btn {
  position: absolute; top: 12px; right: 52px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 60;
}
#ann-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-2); }
#ann-btn.has-unread { color: #e05050; }
#ann-btn.has-unread:hover { background: rgba(224,80,80,0.08); color: #c03030; }
#ann-badge { display: none; }
#share-btn {
  /* 2026-07-30 锁/铃铛收进网格菜单后右移补齐：88 → 14（原 private-btn 位） */
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 60;
}
#share-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-2); }
#oah-btn {
  position: absolute; top: 12px; right: 124px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 60;
}
#oah-btn:hover { background: rgba(156,122,60,0.10); color: #9C7A3C; }

/* 右上角「更多工具」折叠菜单：收纳低频面板类功能 */
#tools-btn {
  /* 2026-07-30 锁/铃铛收进网格菜单后右移补齐：124 → 52（原 ann-btn 位） */
  position: absolute; top: 12px; right: 52px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 60;
}
#tools-btn:hover, #tools-btn.open { background: rgba(0,0,0,0.06); color: var(--text-2); }
/* 这三个功能已收进「更多工具」菜单，从顶栏隐藏（保留 DOM，菜单项转触发它们） */
#oah-btn, #legal-btn, #redact-btn { display: none !important; }
#tools-menu {
  position: fixed; z-index: 500;
  background: #fff; border: 1px solid rgba(0,0,0,0.09);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  padding: 6px; min-width: 176px; display: none;
}
#tools-menu.open { display: block; animation: fadeUp 0.12s ease; }
.tools-menu-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 12px; border: none; background: none;
  border-radius: 8px; font-family: var(--font); font-size: 13px; color: var(--text);
  cursor: pointer; text-align: left; transition: background 0.1s;
}
.tools-menu-item:hover { background: rgba(0,0,0,0.05); }
.tools-menu-item svg { flex-shrink: 0; color: var(--text-3); }
.tools-menu-item:hover svg { color: var(--text-2); }

/* Legal ledger button (same row as share/private/announcement) */
#legal-btn {
  position: absolute; top: 12px; right: 160px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 60;
}
#legal-btn:hover { background: rgba(0,0,0,0.06); color: var(--accent); }
#legal-btn.active { background: rgba(139,92,246,0.12); color: var(--accent); }

