.cockpit {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 顶栏 */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: rgba(11, 16, 25, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(79, 139, 255, 0.22), rgba(20, 217, 197, 0.18));
  border: 1px solid rgba(79, 139, 255, 0.42);
  box-shadow: 0 0 16px rgba(79, 139, 255, 0.2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 三栏主体 */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rail-left-w) minmax(0, 1fr) var(--rail-right-w);
  overflow: hidden;
}

.rail-left,
.rail-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
}

.rail-left {
  border-right: 1px solid var(--border-subtle);
}

.rail-right {
  border-left: 1px solid var(--border-subtle);
}

.rail-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
}

.rail-rooms {
  flex: 0 0 38%;
  border-bottom: 1px solid var(--border-subtle);
}

.rail-members {
  flex: 1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.muted-count {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(148, 179, 219, 0.12);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-mono);
}

.room-list,
.member-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

/* 中央群聊舞台 */
.stage-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(180deg, rgba(13, 19, 31, 0.6) 0%, rgba(9, 14, 23, 0.85) 100%);
  position: relative;
}

.room-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 21, 34, 0.72);
}

.room-banner-meta {
  min-width: 0;
}

.room-banner-meta h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-topic {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 可折叠圆桌席位发光条 */
.roundtable-bar {
  flex-shrink: 0;
  height: 76px;
  border-bottom: 1px solid var(--border-subtle);
  background: radial-gradient(ellipse 70% 110% at 50% 100%, rgba(79, 139, 255, 0.11), rgba(11, 16, 25, 0.6) 72%);
  position: relative;
  overflow: hidden;
  transition: height var(--ease-smooth), border-color var(--ease-smooth), opacity var(--ease-smooth);
}

.roundtable-bar.collapsed {
  height: 0;
  border-bottom-color: transparent;
  opacity: 0;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.composer-dock {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(11, 16, 25, 0.94);
  backdrop-filter: blur(12px);
}

/* 右栏活文档 */
.right-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 10px;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.livedoc-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 1280x720 紧凑适配（保证 0 溢出、0 挤压） */
@media (max-width: 1360px) {
  :root {
    --rail-left-w: 232px;
    --rail-right-w: 292px;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .brand-sub {
    display: none;
  }

  .token-label {
    display: none;
  }

  .chat-stream {
    padding: 12px 14px 16px;
  }
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .rail-right {
    display: none;
  }
}
