*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff;
  color: #0d0d0d;
  height: 100vh;
  height: var(--vvh, 100dvh);
  overflow: hidden;
}

/* ── 布局 ── */
.layout {
  display: flex;
  height: 100vh;
  height: var(--vvh, 100dvh);
}

/* ── 左侧栏 ── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: #f9f9f9;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

.sidebar-nav-group {
  margin: 4px 8px;
  background: #f5f5f5;
  border-radius: 10px;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.logo-icon {
  color: #c96442;
  font-size: 20px;
  line-height: 1;
}

.logo-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: #0d0d0d;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #0d0d0d;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.new-chat-btn:hover { background: #f0f0f0; }

.new-chat-btn .icon {
  font-size: 16px;
  color: #6b6b6b;
}

/* ── 历史列表 ── */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-history::-webkit-scrollbar { width: 4px; }
.sidebar-history::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

.history-label {
  font-size: 12px;
  color: #6b6b6b;
  padding: 0 10px;
  margin-bottom: 2px;
}

/* ── 侧边栏历史区头部 ── */
.sidebar-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 8px;
  margin-bottom: 2px;
}
.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border-radius: 5px;
  transition: background .15s, color .15s;
}
.sidebar-collapse-btn:hover { background: #f0f0f0; color: #333; }
.sidebar-filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 4px 6px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}
.sidebar-filter-btn:hover { background: #f0f0f0; color: #555; }

/* ── 文件夹 ── */
.folder-item { margin-bottom: 2px; }
.folder-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  position: relative;
}
.folder-header:hover { background: #f0f0f0; }
.folder-header .history-menu-btn { visibility: hidden; margin-left: auto; }
.folder-header:hover .history-menu-btn { visibility: visible; }
.folder-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.folder-count {
  font-size: 11px;
  color: #bbb;
  flex-shrink: 0;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 1px 6px;
  line-height: 1.5;
}
.folder-header:hover .folder-count { visibility: hidden; }
.folder-body { padding-left: 8px; }
.history-item.in-folder { font-size: 13px; }
.folder-separator { height: 1px; background: #f0f0f0; margin: 6px 8px; }

.history-item {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #0d0d0d;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.history-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 图标层：绝对定位在右侧，平时隐藏 */
.history-actions {
  display: none;
  position: absolute;
  right: 0;
  top: 0; bottom: 0;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  background: inherit;
}
.history-item:hover .history-actions,
.history-item.active .history-actions { display: flex; }
/* hover/active 时标题右侧留出图标空间，文字不再重叠 */
.history-item:hover .history-title,
.history-item.active .history-title { padding-right: var(--sidebar-actions-width, 50px); }

.task-badge { font-size: 12px; }
.conv-unread-badge { font-size: 11px; font-weight: 700; color: #fff; background: #c96442; border-radius: 10px; padding: 1px 6px; margin-left: 4px; flex-shrink: 0; line-height: 1.5; }

/* 话题分裂通知 */
.tool-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tool-bar::-webkit-scrollbar { display: none; }

.tool-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px;
  border: none; background: none;
  font-size: 12px; color: #666; font-family: inherit;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.tool-btn:hover { background: #f5f5f5; color: #0d0d0d; }
.tool-btn.active { background: #fff3ee; color: #c96442; font-weight: 500; }

/* 人格下拉 & 投票下拉 */
.persona-dropdown-wrap, .vote-dropdown-wrap { position: relative; flex-shrink: 0; }
.vote-dropdown-wrap { display: flex; }
.vote-main-btn { border-radius: 6px 0 0 6px !important; padding-right: 6px !important; }
.vote-arrow-btn { border-radius: 0 6px 6px 0 !important; padding: 4px 6px !important; border-left: 1px solid #e8e8e8 !important; outline: none !important; }
.persona-menu {
  position: fixed;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); z-index: 9999;
  min-width: 140px; padding: 4px 0; overflow: hidden;
}
.persona-menu-item {
  padding: 8px 14px; font-size: 13px; color: #333; cursor: pointer; white-space: nowrap;
}
.persona-menu-item:hover { background: #f5f5f5; }
.persona-menu-item.active { color: #c96442; font-weight: 600; }

.gather-tip {
  margin: 8px 16px; padding: 8px 14px;
  background: #fff8f5; border: 1px solid #f0d0c0;
  border-radius: 8px; font-size: 12px; color: #a05030;
  text-align: center;
}
.topic-split-notice {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 16px; padding: 10px 14px;
  background: #f0f4ff; border: 1px solid #c7d4f5;
  border-radius: 10px; font-size: 13px;
}
.topic-split-icon { font-size: 16px; flex-shrink: 0; }
.topic-split-text { flex: 1; color: #444; }
.topic-split-btn {
  padding: 4px 12px; background: #3b5bdb; color: #fff;
  border: none; border-radius: 6px; font-size: 12px;
  font-family: inherit; cursor: pointer; flex-shrink: 0;
}

/* 任务确认卡片 */
.task-confirm-card {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 12px 16px; padding: 14px 16px;
  background: #fff9f0; border: 1px solid #f5ddb0;
  border-radius: 12px;
}
.task-confirm-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.task-confirm-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.task-confirm-title { font-size: 14px; font-weight: 600; color: #0d0d0d; }
.task-confirm-goal { font-size: 13px; color: #c96442; }
.task-confirm-btns { display: flex; gap: 8px; margin-top: 4px; }
.task-confirm-yes {
  padding: 6px 14px; background: #c96442; color: #fff;
  border: none; border-radius: 7px; font-size: 13px; font-family: inherit; cursor: pointer;
}
.task-confirm-no {
  padding: 6px 14px; background: #f0f0f0; color: #666;
  border: none; border-radius: 7px; font-size: 13px; font-family: inherit; cursor: pointer;
}
.pin-icon { font-size: 11px; margin-right: 3px; flex-shrink: 0; }
.history-menu-btn {
  border: none;
  background: none;
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.history-menu-btn:hover { background: #e0e0e0; color: #333; }
.history-item:hover { background: #f0f0f0; }
.history-item.active { background: #ececec; }

/* 对话下拉菜单 */
.conv-dropdown {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 120px;
  padding: 4px 0;
  font-size: 14px;
}
.conv-dropdown-item {
  padding: 9px 16px;
  cursor: pointer;
  color: #0d0d0d;
  transition: background 0.1s;
}
.conv-dropdown-item:hover { background: #f5f5f5; }
.conv-dropdown-item.danger { color: #d93025; }
.conv-dropdown-item.danger:hover { background: #fff0ef; }
.conv-dropdown-back { color: #888; font-size: 13px; border-bottom: 1px solid #f0f0f0; margin-bottom: 2px; }

/* ── 底部用户区 ── */
.sidebar-profiles-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #0d0d0d;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.15s;
}
.sidebar-profiles-link:hover { background: #f0f0f0; }
.sidebar-profiles-link.active { background: #fff5f2; color: #c96442; font-weight: 500; }

.sidebar-reminder-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-top: 8px;
}

.guest-btn-kb {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #f9f9f9;
  border: 1px solid #efefef; border-radius: 10px;
  font-size: 13px; color: #555; text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.guest-btn-kb:hover { background: #f0f0f0; border-color: #e0e0e0; }

.guest-btn-register {
  display: block; text-align: center;
  padding: 11px 0; background: #c96442;
  color: #fff; border-radius: 10px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.guest-btn-register:hover { background: #b5583a; transform: translateY(-1px); }

.guest-btn-login {
  display: block; text-align: center;
  padding: 11px 0; background: #f0f0f0;
  color: #333; border-radius: 10px;
  font-size: 14px; text-decoration: none;
  transition: background 0.15s;
}
.guest-btn-login:hover { background: #e4e4e4; }

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0d0d0d;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 14px;
  color: #0d0d0d;
}

.settings-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #6b6b6b;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.settings-btn:hover { background: #f0f0f0; }

/* ── 用户菜单 ── */
.user-menu {
  position: absolute;
  bottom: 64px;
  left: 8px;
  width: 180px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 6px;
  z-index: 100;
}

.user-menu-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-menu-item:hover { background: #f5f5f5; }

.user-menu-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 4px 0;
}

/* ── 侧边栏折叠 ── */
.sidebar {
  transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
}

/* ── 顶部工具栏 ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  flex-shrink: 0;
}
#topbarTitle {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.toggle-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: #6b6b6b;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.toggle-btn:hover {
  background: #f0f0f0;
  color: #0d0d0d;
}

/* ── 右侧主区 ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

/* ── 首页 ── */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px;
  padding-top: clamp(40px, 12vh, 120px);
}

.home-content {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 跑马灯 */
.marquee-wrap { width: 100vw; overflow: hidden; padding: 8px 0 2px; user-select: none; position: relative; left: 50%; transform: translateX(-50%); }
/* 横向滚动 */
.mq-scroll-inner { display: flex; white-space: nowrap; width: max-content; animation: mqScroll linear infinite; }
.mq-scroll-text { padding-right: 60px; }
@keyframes mqScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* 单条（fade / slide / typewriter 共用） */
.mq-slide-wrap { overflow: hidden; height: 1.6em; }
.mq-single { display: block; transition: opacity .4s ease; }
.mq-slide-in { animation: mqSlideIn .35s ease forwards; }
.mq-slide-out { animation: mqSlideOut .35s ease forwards; }
@keyframes mqSlideIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes mqSlideOut { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(-12px); } }
.mq-cursor { animation: mqBlink .7s step-end infinite; }
@keyframes mqBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* 访客宣传语 */
.hero-section { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.hero-row { font-weight: 700; color: #1a1a1a; line-height: 1.3; }
.hero-btn {
  display: inline-block; padding: 11px 0;
  background: #c96442; color: #fff; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  text-align: center; box-sizing: border-box;
  transition: background .15s, transform .1s;
}
.hero-btn:hover { background: #b5583a; transform: translateY(-1px); }
/* 动画 */
@keyframes heroFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-anim-fadein .hero-row, .hero-anim-fadein .hero-btn {
  opacity: 0; animation: heroFadeIn .6s ease forwards;
}
.hero-anim-slideup .hero-row, .hero-anim-slideup .hero-btn {
  opacity: 0; animation: heroSlideUp .6s ease forwards;
}
.hero-anim-stagger .hero-row, .hero-anim-stagger .hero-btn {
  opacity: 0; animation: heroSlideUp .5s ease forwards;
}
@media (max-width: 600px) {
  .hero-row { font-size: 85% !important; }
  .hero-btn { font-size: 13px; padding: 8px 18px; }
}

.input-stack {
  display: flex;
  flex-direction: column;
}

.announcement-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* 公告条叠放样式：外层灰底容器，内层白色输入框 */
.input-stack.has-announcement {
  background: #f0f0ed;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.input-stack.has-announcement .announcement-bar {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 12px 14px 6px;
}
.input-stack.has-announcement .input-wrap {
  margin: 0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.announcement-text {
  flex: 1;
  font-weight: 600;
  color: #0d0d0d;
}
.announcement-link {
  color: #6b6b6b;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
a.announcement-link:hover { color: #0d0d0d; }
.announcement-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #aaa;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.announcement-close:hover { color: #0d0d0d; }

.welcome {
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-icon {
  color: #c96442;
  font-size: 28px;
  line-height: 1;
}

.welcome-title {
  font-size: 32px;
  font-weight: 500;
  color: #0d0d0d;
}

/* ── 输入框 ── */
.input-wrap {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}

.input-wrap:focus-within {
  border-color: #aaa;
}

.input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  color: #0d0d0d;
  line-height: 1.6;
  background: transparent;
  max-height: 200px;
  overflow-y: auto;
}

/* 首页输入框保持较大初始高度 */
#input.input { min-height: 96px; }

.input::placeholder { color: #aaa; }

.input-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attach-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: #6b6b6b;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}

.attach-btn:hover { background: #f0f0f0; }

.send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #e0e0e0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.send-btn:not(:disabled) {
  background: #0d0d0d;
  cursor: pointer;
}

.send-btn:not(:disabled):hover { background: #333; }
.send-btn:disabled { cursor: default; }

/* ── 场景芯片 ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  color: #0d0d0d;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.chip:hover { background: #f5f5f5; }

/* ── 对话页 ── */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 群聊参与者头像栏 */
/* ── 对话提醒条 ── */
.chat-reminder-bar {
  padding: 6px 16px;
  border-top: 1px solid #f5ddd0;
  background: #fef3ec;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-reminder-bar::-webkit-scrollbar { display: none; }
.chat-reminder-list {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
}
.chat-reminder-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  border: 1px solid #e8d8cc;
  background: #fff;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.chat-reminder-pill:hover { border-color: #c96442; background: #fff8f5; }
.chat-reminder-pill.pending { border-color: #f59e0b; background: #fffbeb; }
.chat-reminder-pill .pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #c96442; flex-shrink: 0;
}
.chat-reminder-pill.pending .pill-dot { background: #f59e0b; }
.chat-reminder-pill-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 200;
  min-width: 130px;
  padding: 4px 0;
}
.chat-reminder-pill-menu-item {
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
}
.chat-reminder-pill-menu-item:hover { background: #f5f5f5; }
.chat-reminder-pill-menu-item.danger { color: #dc2626; }

.participants-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 24px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  flex-shrink: 0;
}
.participants-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}
.participant-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 3px 8px 3px 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 12px;
  color: #333;
}
.participant-chip:hover { border-color: #c96442; }
.participant-chip.active { border-color: #c96442; box-shadow: 0 0 0 2px rgba(201,100,66,0.15); }
.participant-chip-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; background: var(--avatar-bg, #e8e8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #666; flex-shrink: 0;
}
.participant-chip-name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-chip-remove {
  width: 14px; height: 14px; border-radius: 50%;
  background: #ddd; border: none; cursor: pointer;
  font-size: 10px; color: #666; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1; flex-shrink: 0;
}
.participant-chip-remove:hover { background: #e53e3e; color: #fff; }
.participants-add, .participants-random {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px dashed #ccc; background: #fff;
  cursor: pointer; font-size: 14px; color: #aaa;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.participants-add:hover { border-color: #c96442; color: #c96442; }
.participants-random { font-size: 13px; border-style: solid; }
.participants-random:hover { border-color: #c96442; }
.participants-gather {
  height: 28px; padding: 0 10px; border-radius: 14px;
  border: 1.5px solid #c96442; background: #fff;
  cursor: pointer; font-size: 12px; color: #c96442; font-weight: 500;
  display: flex; align-items: center; white-space: nowrap;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.participants-gather:hover { background: #c96442; color: #fff; }
.participants-gather:disabled { opacity: 0.5; cursor: not-allowed; }

/* 添加人物弹窗 */
.add-participant-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.add-participant-box {
  background: #fff; border-radius: 14px; padding: 20px;
  width: 320px; max-height: 480px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.add-participant-title { font-size: 15px; font-weight: 600; color: #0d0d0d; }
.add-participant-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.add-participant-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s;
}
.add-participant-item:hover { background: #f5f5f5; }
.add-participant-item.already { opacity: 0.4; pointer-events: none; }
/* 人物发言格式 */
.persona-content { line-height: 1.8; }
.persona-aside { color: #b0a090; font-size: 12px; font-style: italic; display: inline; }
.persona-speech { color: #0d0d0d; font-size: inherit; display: inline; }


.ap-search { margin-bottom: 2px; }
.ap-search:focus { border-color: #c96442 !important; }
.ap-group { display: flex; flex-direction: column; }
.ap-group-header {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 4px; cursor: pointer; border-radius: 6px;
  user-select: none;
}
.ap-group-header:hover { background: #f5f5f5; }
.ap-group-body { display: flex; flex-direction: column; gap: 4px; padding-left: 4px; margin-bottom: 4px; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

/* ── 投票面板 ── */
.vote-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: #fafafa;
}
.vote-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.vote-topic { font-size: 14px; font-weight: 600; color: #0d0d0d; flex: 1; }
.vote-close {
  font-size: 12px; color: #aaa; background: none; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
}
.vote-close:hover { background: #f0f0f0; color: #555; }
.vote-body {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.vote-zone {
  flex: 1; display: flex; flex-direction: column;
  padding: 12px 16px; overflow-y: auto; min-height: 80px;
}
.vote-zone-label {
  font-size: 13px; font-weight: 600; margin-bottom: 8px; flex-shrink: 0;
}
.vote-zone-label.support { color: #16a34a; }
.vote-zone-label.oppose  { color: #dc2626; }
.vote-zone-cards {
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
}
.vote-divider { height: 1px; background: #ececec; flex-shrink: 0; margin: 0 16px; }
.vote-hint {
  padding: 8px 16px; font-size: 11px; color: #bbb; text-align: center;
  flex-shrink: 0;
}
.vote-card {
  background: #fff; border: 1px solid #e8e8e8; border-radius: 10px;
  padding: 8px 10px; cursor: pointer; max-width: 180px;
  transition: box-shadow 0.15s; animation: voteCardIn 0.3s ease;
}
.vote-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.vote-card.support { border-color: #bbf7d0; background: #f0fdf4; }
.vote-card.oppose  { border-color: #fecaca; background: #fef2f2; }
.vote-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.vote-card-name { font-size: 12px; font-weight: 600; color: #0d0d0d; }
.vote-card-speech { font-size: 12px; color: #444; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.vote-card-inner { font-size: 11px; color: #b0a090; font-style: italic;
  margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden; }
.vote-speaking { opacity: 0.6; pointer-events: none; }
@keyframes voteCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 投票摘要卡片（聊天记录里） */
.vote-summary-card {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 24px; padding: 12px 14px;
  background: #fff8f0; border: 1px solid #f0d8b0;
  border-radius: 10px; font-size: 13px;
}
.vote-summary-icon { font-size: 18px; flex-shrink: 0; }
.vote-summary-topic { font-weight: 600; color: #0d0d0d; margin-bottom: 4px; }
.vote-summary-counts { display: flex; gap: 16px; flex-wrap: wrap; }
.vote-summary-counts .support { color: #16a34a; }
.vote-summary-counts .oppose  { color: #dc2626; }

/* 投票历史列表 */
.vote-history-item {
  padding: 12px 0; border-bottom: 1px solid #f5f5f5;
  cursor: pointer; transition: background 0.1s;
}
.vote-history-item:last-child { border-bottom: none; }
.vote-history-item:hover { background: #fafafa; border-radius: 6px; }
.vote-history-time { font-size: 11px; color: #aaa; margin-bottom: 3px; }
.vote-history-topic { font-size: 13px; font-weight: 500; color: #0d0d0d; margin-bottom: 4px; }
.vote-history-counts { font-size: 12px; }

/* 投票详情弹窗 */
.vote-detail-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.vote-detail-box {
  background: #fff; border-radius: 14px; padding: 24px;
  width: 320px; max-width: calc(100vw - 32px);
}
.vote-detail-name { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.vote-detail-speech { font-size: 14px; color: #333; line-height: 1.7; }
.vote-detail-inner {
  margin-top: 10px; font-size: 12px; color: #b0a090;
  font-style: italic; border-top: 1px solid #f0f0f0; padding-top: 10px;
}
.vote-detail-close {
  margin-top: 16px; width: 100%; padding: 9px; background: #f0f0f0;
  border: none; border-radius: 8px; cursor: pointer; font-size: 13px; color: #555;
}

.message {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.message.user {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
}

.message.user .bubble {
  background: #f4f4f4;
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 80%;
}

.message.ai {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message.ai .ai-body {
  flex: 1;
  min-width: 0;
}

.message.ai .ai-name {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.message.ai .content {
  font-size: 16px;
  line-height: 1.8;
  color: #0d0d0d;
}

.user-msg-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: fit-content;
  max-width: 80%;
}
.message.user .user-msg-wrap .bubble {
  width: max-content;
  max-width: 100%;
}
.msg-actions {
  display: flex;
  flex-direction: row;
  gap: 2px;
  padding: 1px 0;
  margin-top: 1px;
  visibility: hidden;
  min-height: 20px;
}
.message:hover .msg-actions {
  visibility: visible;
}
.msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 3px 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.msg-action-btn:hover {
  color: #c96442;
  background: #fff3ee;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  color: #fff;
  margin-top: 2px;
}

.msg-avatar.ai-avatar {
  background: #e8611a;
}

.msg-avatar.user-avatar {
  background: #0d0d0d;
}

.msg-avatar.img-avatar {
  background: transparent;
  object-fit: cover;
  padding: 0;
}

/* ── 对话页输入框 ── */
.chat-input-wrap {
  padding: 16px 24px 24px;
  max-width: 728px;
  width: 100%;
  margin: 0 auto;
}

.chat-input-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}

.chat-input-box:focus-within { border-color: #aaa; }

/* ══════════════════════════════════════════
   移动端适配  @media (max-width: 768px)
   ══════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── 侧边栏：默认隐藏，滑出式抽屉 ── */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: var(--vvh, 100dvh);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
    width: 280px !important;
    min-width: 280px !important;
    padding: 12px 8px calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    opacity: 1;
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    width: 280px !important;
  }

  /* ── 遮罩层 ── */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
  }

  .sidebar-overlay.active { display: block; }

  /* ── 主区域占满全屏 ── */
  .main { width: 100%; }

  /* ── 顶部栏 ── */
  .topbar { padding: 8px 12px; }
  .toggle-btn { padding: 8px; width: 40px; height: 40px; }

  /* ── 首页欢迎区 ── */
  .home { padding: 16px 16px; align-items: flex-start; justify-content: flex-start; flex: 0 0 auto; }
  .home-content { gap: 20px; }
  .welcome-title { font-size: 24px; }

  /* ── 输入框 ── */
  .input-wrap { border-radius: 12px; padding: 12px 14px 8px; }
  .input { font-size: 14px; }

  /* ── 场景芯片 ── */
  .chips { gap: 6px; }
  .chip { padding: 6px 12px; font-size: 13px; }

  /* ── 对话页消息 ── */
  .message { padding: 0 12px; max-width: 100%; }
  .message.user .bubble { font-size: 17px; padding: 8px 14px; max-width: 85%; }
  .message.ai .content { font-size: 17px; }
  .message.ai { max-width: 100%; }

  /* ── 对话输入框 ── */
  .chat-input-wrap { padding: 8px 12px 8px; }

  /* ── 参与者栏 ── */
  .participants-bar { padding: 6px 12px; }

}

/* ── 手机底部导航栏 ── */
.mobile-tabbar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    z-index: 300;
    justify-content: space-around;
    align-items: center;
  }

  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    text-decoration: none;
    color: #aaa;
    font-size: 11px;
    padding: 6px 0;
    transition: color 0.15s;
  }

  .mobile-tab.active { color: #c96442; }
  .mobile-tab:hover { color: #0d0d0d; }

  /* 底部导航占位，防止内容被遮住 */
  .main { padding-bottom: 56px; }
  .kb-layout { padding-bottom: 56px; }
}

/* ── 手机「我」底部抽屉 ── */
.mobile-me-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.3);
}
.mobile-me-drawer.open { display: block; }
.mobile-me-panel {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 8px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.mobile-me-name {
  font-size: 13px;
  color: #aaa;
  padding: 10px 18px 6px;
}
.mobile-me-item {
  padding: 13px 18px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.mobile-me-item:hover { background: #f5f5f5; }
.mobile-me-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }

/* ── 手机顶部返回按钮 ── */
.mobile-back-btn { display: none; }
.mobile-nav-bar { display: none; }
.mobile-nav-title { display: none; }

@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #f0f0f0;
    z-index: 500;
    padding: 0 12px;
  }
  .mobile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(240,240,240,0.9);
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .mobile-nav-title {
    display: block;
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #0d0d0d;
  }
  .mobile-nav-right {
    min-width: 34px;
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .main-content,
  main.main,
  main.kb-main {
    padding-top: 48px;
  }
  .page-chat main.main,
  .page-me main.main-content {
    padding-top: 0;
  }
}

/* ── 提醒确认弹窗 ── */
.reminder-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
}
.reminder-modal {
  background: #fff; border-radius: 16px; padding: 24px 24px 20px;
  width: 320px; max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.reminder-modal h3 {
  font-size: 15px; font-weight: 600; color: #0d0d0d; margin-bottom: 16px;
}
.reminder-modal label {
  display: block; font-size: 12px; color: #888; margin-bottom: 4px; margin-top: 12px;
}
.reminder-modal input[type=text],
.reminder-modal input[type=time] {
  width: 100%; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 8px 10px; font-size: 14px; color: #0d0d0d; outline: none;
}
.reminder-modal input:focus { border-color: #b07a5a; }
.reminder-modal .rm-type-row {
  display: flex; gap: 8px; margin-top: 4px;
}
.reminder-modal .rm-type-btn {
  flex: 1; padding: 7px 0; border: 1px solid #e0e0e0; border-radius: 8px;
  font-size: 13px; color: #555; background: #fff; cursor: pointer; text-align: center;
}
.reminder-modal .rm-type-btn.active {
  border-color: #b07a5a; background: #fdf4ee; color: #b07a5a; font-weight: 500;
}
.reminder-modal .rm-actions {
  display: flex; gap: 8px; margin-top: 20px;
}
.reminder-modal .rm-btn-confirm {
  flex: 1; padding: 10px 0; background: #b07a5a; color: #fff;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.reminder-modal .rm-btn-cancel {
  flex: 1; padding: 10px 0; background: #f5f5f5; color: #555;
  border: none; border-radius: 10px; font-size: 14px; cursor: pointer;
}

/* ── 提醒完成弹窗 ── */
.reminder-done-modal { text-align: center; padding: 32px 24px 24px; }
.reminder-done-icon { font-size: 40px; margin-bottom: 12px; }
.reminder-done-content { font-size: 17px; font-weight: 600; color: #0d0d0d; line-height: 1.4; }
.rm-btn-snooze {
  flex: 1; padding: 10px 0; background: #f5f5f5; color: #555;
  border: none; border-radius: 10px; font-size: 14px; cursor: pointer;
}
.rm-btn-snooze:hover { background: #ebebeb; }
.snooze-options {
  margin-top: 10px; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.snooze-options button {
  padding: 6px 14px; border: 1px solid #e0e0e0; border-radius: 20px;
  font-size: 13px; color: #555; background: #fff; cursor: pointer;
}
.snooze-options button:hover { background: #f5f5f5; }
.snooze-custom {
  margin-top: 8px; gap: 6px; align-items: center; justify-content: center;
}
.snooze-custom input {
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 5px 8px;
  font-size: 13px; outline: none; text-align: center;
}
.snooze-custom input:focus { border-color: #b07a5a; }
.snooze-custom button {
  padding: 5px 12px; border: none; border-radius: 8px;
  background: #b07a5a; color: #fff; font-size: 13px; cursor: pointer;
}

/* ── 任务里程碑进度条 ── */
.milestone-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fafaf8;
  border-bottom: 1px solid #f0ede8;
  min-height: 48px;
  position: relative;
}
.milestone-bar-label {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}
.milestone-track {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  min-width: 0;
}
.milestone-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e8e4df;
  transform: translateY(-50%);
  z-index: 0;
}
.milestone-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #c96442, #e8a882);
  transition: width 0.5s ease;
}
.milestone-nodes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
  z-index: 1;
}
.milestone-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.milestone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #d0cbc4;
  background: #fff;
  transition: all 0.25s;
  box-sizing: border-box;
}
.milestone-node.done .milestone-dot {
  background: #c96442;
  border-color: #c96442;
  box-shadow: 0 0 0 3px rgba(201,100,66,0.15);
}
.milestone-node-label {
  font-size: 10px;
  color: #aaa;
  margin-top: 4px;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.milestone-node.done .milestone-node-label { color: #c96442; }
.milestone-bar-manage {
  font-size: 18px;
  color: #c96442;
  cursor: pointer;
  flex-shrink: 0;
  padding: 6px;
  border: none;
  background: none;
  line-height: 1;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.milestone-bar-manage:hover { color: #b8553a; }

/* 里程碑详情浮层 */
.milestone-popup {
  position: fixed;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  padding: 16px;
  width: 220px;
  z-index: 800;
  font-size: 13px;
}
.milestone-popup-title {
  font-weight: 600;
  color: #0d0d0d;
  margin-bottom: 6px;
  font-size: 14px;
}
.milestone-popup-desc {
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
}
.milestone-popup-btns {
  display: flex;
  gap: 6px;
}
.milestone-popup-btns button {
  flex: 1;
  padding: 7px 0;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.milestone-popup-done-btn {
  background: #c96442;
  color: #fff;
}
.milestone-popup-undo-btn {
  background: #f5f5f5;
  color: #888;
}
.milestone-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 16px;
  color: #bbb;
  cursor: pointer;
  line-height: 1;
}

/* 里程碑设置弹窗 */
.milestone-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 9100; display: flex; align-items: center; justify-content: center;
}
.milestone-modal {
  background: #fff; border-radius: 18px;
  padding: 24px 20px 20px;
  width: min(480px, 95vw);
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.16);
}
.milestone-modal h3 {
  font-size: 16px; font-weight: 600; color: #0d0d0d; margin-bottom: 4px;
}
.milestone-modal-sub {
  font-size: 12px; color: #aaa; margin-bottom: 14px;
}
.milestone-modal-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px;
}
.milestone-edit-item {
  display: flex; gap: 8px; align-items: flex-start;
  background: #f9f7f5; border-radius: 10px; padding: 10px 12px;
}
.milestone-edit-item .mi-idx {
  font-size: 12px; color: #c96442; font-weight: 600; padding-top: 3px; min-width: 18px;
}
.milestone-edit-item .mi-fields { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.milestone-edit-item input, .milestone-edit-item textarea {
  width: 100%; border: 1px solid #e8e4df; border-radius: 7px;
  padding: 6px 8px; font-size: 13px; font-family: inherit;
  color: #0d0d0d; outline: none; box-sizing: border-box; background: #fff;
}
.milestone-edit-item input:focus, .milestone-edit-item textarea:focus { border-color: #c96442; }
.milestone-edit-item textarea { resize: none; height: 44px; }
.milestone-edit-item .mi-del {
  background: none; border: none; color: #ccc; font-size: 16px; cursor: pointer; padding: 2px;
  flex-shrink: 0;
}
.milestone-edit-item .mi-del:hover { color: #e74c3c; }
.milestone-modal-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.milestone-modal-add-btn {
  flex: 1; padding: 9px 0; border: 1.5px dashed #e0dbd5; border-radius: 9px;
  background: none; font-size: 13px; color: #aaa; cursor: pointer;
}
.milestone-modal-add-btn:hover { border-color: #c96442; color: #c96442; }
.milestone-modal-save-btn {
  flex: 2; padding: 10px 0; background: #c96442; color: #fff;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.milestone-modal-ai-btn {
  flex: 1.5; padding: 9px 0; background: #f5f0eb; color: #c96442;
  border: none; border-radius: 10px; font-size: 13px; cursor: pointer;
}

/* 里程碑 AI 确认卡片 */
.milestone-confirm-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: linear-gradient(135deg, #fff9f6, #fff3ec);
  border: 1px solid #f0d8c8; border-radius: 14px;
  padding: 14px 16px; margin: 6px 0;
}
.milestone-confirm-icon { font-size: 22px; flex-shrink: 0; }
.milestone-confirm-body { flex: 1; }
.milestone-confirm-title {
  font-size: 13px; font-weight: 600; color: #0d0d0d; margin-bottom: 4px;
}
.milestone-confirm-name {
  font-size: 13px; color: #c96442; margin-bottom: 10px;
}
.milestone-confirm-btns { display: flex; gap: 8px; }
.milestone-confirm-yes {
  padding: 7px 16px; background: #c96442; color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.milestone-confirm-no {
  padding: 7px 14px; background: #f5f5f5; color: #888;
  border: none; border-radius: 8px; font-size: 13px; cursor: pointer;
}

/* ── 任务面板折叠 ── */
.task-panel-wrap {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 300px;
  opacity: 1;
}
.task-panel-wrap.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.task-panel-collapse-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid #f0ede8;
  padding: 4px 0;
  font-size: 11px;
  color: #ccc;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.5px;
}
.task-panel-collapse-btn:hover { color: #aaa; background: #fafaf8; }

/* 摘要条（收起时显示） */
.task-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 14px;
  border-top: 1px solid #f0ede8;
  background: #fafaf8;
  cursor: pointer;
  gap: 10px;
  min-height: 30px;
}
.task-panel-summary:hover { background: #f5f2ee; }
.tps-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #888;
  flex-wrap: wrap;
}
.tps-chip {
  display: flex;
  align-items: center;
  gap: 3px;
}
.tps-chip.orange { color: #c96442; }
.tps-expand {
  font-size: 11px;
  color: #bbb;
  white-space: nowrap;
  flex-shrink: 0;
}
