* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font: 13px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: #1f2329; background: #f2f3f5; overflow: hidden;
}
button { font: inherit; cursor: pointer; border: none; background: none; }
b { font-weight: 600; }
.muted { color: #8f959e; font-size: 12px; }

/* ---------- 顶栏 ---------- */
#topbar {
  height: 52px; background: #fff; border-bottom: 1px solid #e5e6eb;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
}
#brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
#brand .logo {
  width: 28px; height: 28px; border-radius: 7px; background: #3370ff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
#brand b { font-size: 14px; }
#brand .sub { color: #8f959e; font-size: 11px; }
#roles { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.roles-label { color: #8f959e; font-size: 11px; margin-right: 2px; }
.role {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid transparent; position: relative; color: #1f2329;
}
.role:hover { background: #f2f3f5; }
.role.on { background: #e8f0ff; border-color: #a3c2ff; color: #245bdb; font-weight: 600; }
.role-tag { font-size: 10px; color: #8f959e; background: #f2f3f5; border-radius: 4px; padding: 0 4px; }
.role.on .role-tag { background: #d6e2ff; color: #245bdb; }
#scenarios { margin-left: auto; display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.scn {
  padding: 5px 9px; border-radius: 7px; border: 1px solid #d0d3d6; background: #fff;
  font-size: 12px; white-space: nowrap; color: #1f2329;
}
.scn:hover:not(:disabled) { border-color: #3370ff; color: #3370ff; }
.scn:disabled { opacity: .45; cursor: default; }
.scn.on { background: #3370ff; color: #fff; border-color: #3370ff; }
.scn.stop { color: #f54a45; }

/* ---------- 主体三栏 ---------- */
#main { display: flex; height: calc(100vh - 52px); }

#sidebar { width: 268px; background: #fcfcfd; border-right: 1px solid #e5e6eb; display: flex; flex-direction: column; }
#me-line { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid #eee; }
#sidebar-list { flex: 1; overflow-y: auto; padding: 6px; }
.conv { display: flex; gap: 8px; padding: 9px 8px; border-radius: 8px; cursor: pointer; align-items: center; }
.conv:hover { background: #f2f3f5; }
.conv.on { background: #e8f0ff; }
.conv-icon { font-size: 20px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: #f2f3f5; border-radius: 8px; flex-shrink: 0; }
.conv.on .conv-icon { background: #d6e2ff; }
.conv-mid { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.conv-preview { color: #8f959e; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.conv-time { color: #b0b3b8; font-size: 10.5px; }

/* ---------- 聊天 ---------- */
#chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
#chat-head {
  padding: 10px 16px; border-bottom: 1px solid #e5e6eb; display: flex; align-items: center; justify-content: space-between;
}
.chat-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chat-members { display: flex; align-items: center; gap: 3px; }
#chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px 8px; background: #f7f8fa; }
.msg { display: flex; gap: 8px; margin-bottom: 12px; max-width: 82%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-side { flex-shrink: 0; }
.msg-body { min-width: 0; }
.msg.mine .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.msg-meta { font-size: 11px; color: #8f959e; margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.bot-tag { background: #e8f0ff; color: #245bdb; border-radius: 4px; padding: 0 4px; font-size: 10px; }
.bubble {
  background: #fff; border: 1px solid #e5e6eb; border-radius: 4px 12px 12px 12px;
  padding: 8px 12px; font-size: 13px; width: fit-content; max-width: 100%; word-break: break-word; white-space: pre-wrap;
}
.msg.mine .bubble { border-radius: 12px 4px 12px 12px; }
.bubble.blue { background: #d9e8ff; border-color: #c2d8ff; }
.bubble.typing { color: #8f959e; }
.dots { display: inline-flex; gap: 3px; margin-left: 6px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: #8f959e; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.sys { text-align: center; color: #8f959e; font-size: 11.5px; margin: 10px 0; }

/* ---------- 卡片（IM 互动卡片风） ---------- */
.card { background: #fff; border: 1px solid #e5e6eb; border-radius: 10px; width: 360px; max-width: 100%; overflow: hidden; box-shadow: 0 1px 2px rgba(31,35,41,.04); }
.card.wide { width: 420px; }
.card-head { padding: 8px 14px; color: #fff; font-weight: 600; font-size: 13px; }
.card-head.blue { background: #3370ff; } .card-head.red { background: #f54a45; }
.card-head.amber { background: #ff8800; } .card-head.green { background: #2ea121; }
.card-head.purple { background: #7f56d9; } .card-head.teal { background: #0f9d8f; }
.card-body { padding: 10px 14px 12px; }
.card-body p { margin: 4px 0; }
.fields { display: flex; flex-direction: column; gap: 5px; margin: 6px 0; }
.field { display: flex; gap: 8px; font-size: 12.5px; }
.field > span { color: #8f959e; flex-shrink: 0; width: 58px; }
.field > div { min-width: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tag { background: #f2f3f5; border-radius: 4px; padding: 0 6px; font-size: 11px; color: #51565d; white-space: nowrap; }
.foot { color: #8f959e; font-size: 11px; border-top: 1px dashed #e5e6eb; margin-top: 8px; padding-top: 7px; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cbtn { padding: 5px 12px; border-radius: 7px; border: 1px solid #d0d3d6; background: #fff; font-size: 12.5px; color: #1f2329; }
.cbtn:hover:not(:disabled) { border-color: #3370ff; color: #3370ff; }
.cbtn.primary { background: #3370ff; border-color: #3370ff; color: #fff; }
.cbtn.primary:hover:not(:disabled) { background: #245bdb; color: #fff; }
.cbtn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 输入区 ---------- */
#composer { border-top: 1px solid #e5e6eb; padding: 8px 14px 10px; background: #fff; }
#chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 7px; scrollbar-width: none; }
#chips::-webkit-scrollbar { display: none; }
.chip-btn {
  flex-shrink: 0; padding: 4px 10px; border-radius: 20px; border: 1px solid #e0e2e6;
  background: #f7f8fa; font-size: 12px; color: #51565d; white-space: nowrap;
}
.chip-btn:hover { border-color: #3370ff; color: #3370ff; background: #fff; }
#input-row { display: flex; gap: 8px; align-items: flex-end; }
#msg-input {
  flex: 1; resize: none; border: 1px solid #e0e2e6; border-radius: 8px; padding: 8px 10px;
  font: inherit; height: 40px; outline: none; background: #fff;
}
#msg-input:focus { border-color: #3370ff; }
#send-btn { background: #3370ff; color: #fff; border-radius: 8px; padding: 9px 16px; font-size: 13px; flex-shrink: 0; }
#send-btn:hover { background: #245bdb; }
#input-hint { color: #b0b3b8; font-size: 10.5px; margin-top: 5px; }

/* ---------- 塔台看板 ---------- */
#board { width: 316px; border-left: 1px solid #e5e6eb; background: #fcfcfd; overflow-y: auto; padding: 12px; flex-shrink: 0; }
.board-head { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.board-head .mini { margin-left: auto; }
.mini { padding: 3px 8px; border-radius: 6px; border: 1px solid #d0d3d6; background: #fff; font-size: 11px; color: #51565d; }
.mini:hover { border-color: #3370ff; color: #3370ff; }
.bsec { background: #fff; border: 1px solid #e9eaee; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.bsec-t { font-weight: 600; font-size: 12.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.bsec-t b { color: #3370ff; }
.empty { color: #b0b3b8; font-size: 12px; padding: 4px 0; }
.qitem { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed #f0f1f3; }
.qitem:first-of-type { border-top: none; }
.qpos { width: 20px; height: 20px; border-radius: 50%; background: #fff3e0; color: #b25e00; font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qmid { min-width: 0; }
.qtitle { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member { padding: 7px 0; border-top: 1px dashed #f0f1f3; }
.member:first-of-type { border-top: none; }
.member-row { display: flex; align-items: center; gap: 8px; }
.member-mid { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mstatus { font-size: 11px; color: #8f959e; display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: #34c724; } .dot-red { background: #f54a45; } .dot-gray { background: #b0b3b8; }
.slots { display: inline-flex; gap: 3px; }
.slot { width: 14px; height: 8px; border-radius: 3px; border: 1px solid #d0d3d6; display: inline-block; }
.slot.full { background: #3370ff; border-color: #3370ff; }
.member-tasks { font-size: 11px; color: #51565d; margin: 4px 0 0 40px; }
.member-fam { margin: 4px 0 0 40px; display: flex; gap: 4px; flex-wrap: wrap; }
.arc { padding: 5px 0; border-top: 1px dashed #f0f1f3; }
.arc:first-of-type { border-top: none; }
.arc-t { font-size: 12px; font-weight: 600; }
.logline { font-size: 11px; color: #51565d; padding: 2.5px 0; }

/* ---------- 头像 / 徽标 ---------- */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar.sm { width: 20px; height: 20px; font-size: 11px; }
.badge {
  background: #f54a45; color: #fff; font-style: normal; font-size: 10px; border-radius: 8px;
  padding: 0 5px; min-width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
}
.role .badge { position: absolute; top: -5px; right: -5px; }
.chip { font-size: 10px; border-radius: 4px; padding: 0 5px; font-weight: 600; flex-shrink: 0; }
.chip-blue { background: #e8f0ff; color: #245bdb; }
.chip-green { background: #e4f8e0; color: #237804; }
.chip-amber { background: #fff3e0; color: #b25e00; }
.chip-gray { background: #f2f3f5; color: #8f959e; }
.chip-teal { background: #e0f5f3; color: #0a7d72; }

/* ---------- 旁白 / 提示 ---------- */
#narration {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: rgba(23, 26, 31, .92); color: #fff; border-radius: 12px; padding: 10px 18px;
  font-size: 13.5px; max-width: 72%; display: none; align-items: center; gap: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 60;
}
.ndot { width: 8px; height: 8px; border-radius: 50%; background: #4dabf7; animation: blink 1.4s infinite; flex-shrink: 0; }
#toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: #1f2329; color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 70;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 概念首页覆盖层 ---------- */
.intro-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(17, 20, 26, .55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.intro-card {
  background: #fff; border-radius: 16px; max-width: 780px; width: 100%;
  max-height: 92vh; overflow-y: auto; padding: 28px 32px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.intro-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.intro-logo {
  width: 46px; height: 46px; border-radius: 12px; background: #3370ff; color: #fff;
  font-size: 24px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.intro-card h1 { font-size: 22px; margin: 0; }
.intro-sub { color: #8f959e; font-size: 13px; margin-top: 2px; }
.intro-p { font-size: 13.5px; color: #384049; margin: 8px 0; line-height: 1.75; }
.intro-note {
  background: #fff8e6; border: 1px solid #ffe7a3; color: #8a6116;
  border-radius: 10px; padding: 10px 14px; font-size: 12.5px; margin: 12px 0 4px; line-height: 1.7;
}
.intro-sec { font-weight: 600; font-size: 13px; margin: 16px 0 10px; }
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.intro-item {
  text-align: left; border: 1px solid #e0e2e6; border-radius: 10px; padding: 12px 14px;
  background: #fff; display: flex; flex-direction: column; gap: 4px; transition: all .15s;
}
.intro-item:hover { border-color: #3370ff; box-shadow: 0 4px 14px rgba(51, 112, 255, .12); transform: translateY(-1px); }
.intro-item-t { font-weight: 600; font-size: 13.5px; color: #1f2329; }
.intro-item-d { font-size: 12px; color: #8f959e; line-height: 1.5; }
.intro-item.free { background: #f4f7ff; border-style: dashed; }
.intro-item.free .intro-item-t { color: #245bdb; }
.seen { font-style: normal; font-size: 10px; background: #e4f8e0; color: #237804; border-radius: 4px; padding: 0 5px; font-weight: 500; }
.intro-foot { text-align: center; color: #b0b3b8; font-size: 11px; margin-top: 16px; }
@media (max-width: 720px) { .intro-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- 演示结束悬浮框 ---------- */
.end-card {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #fff; border-radius: 14px; padding: 14px 18px; width: 560px; max-width: 92vw;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22); border: 1px solid #e5e6eb; z-index: 65;
}
.end-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.end-x { color: #8f959e; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.end-x:hover { background: #f2f3f5; color: #1f2329; }
.end-sub { color: #51565d; font-size: 12.5px; margin: 6px 0 2px; }
.end-sec { color: #8f959e; font-size: 12px; margin: 10px 0 6px; }
.end-list { display: flex; gap: 6px; flex-wrap: wrap; }
.end-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e5e6eb; }
