/* 虚幻工坊 · 独立工作台风格 (对标 macOS ChatGPT 客户端) */
:root {
  --bg: #f8f6f0;
  --sidebar-bg: #efece4;
  --card-bg: #ffffff;
  --fg: #1d1b16;
  --muted: #7c7567;
  --line: #ded8cb;
  --hover: #e6e2d7;
  --active: #ded8cb;
  
  --gold: #b37e3b;
  --gold-bg: rgba(179, 126, 59, 0.1);
  --gold-border: #d4a96b;
  
  --green: #2d8557;
  --green-bg: rgba(45, 133, 87, 0.08);
  --green-border: #8ec5a7;

  --amber: #c4762b;
  --amber-bg: rgba(196, 118, 43, 0.08);
  --amber-border: #f0bd8d;

  --blue: #2a6fb8;
  --blue-bg: rgba(42, 111, 184, 0.08);
  --blue-border: #92bce6;

  --red: #b83d30;
  --red-bg: rgba(184, 61, 48, 0.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181611;
    --sidebar-bg: #1f1c15;
    --card-bg: #26231c;
    --fg: #ede7dc;
    --muted: #968e7f;
    --line: #383428;
    --hover: #2b271f;
    --active: #383428;

    --gold: #cda365;
    --gold-bg: rgba(205, 163, 101, 0.12);
    --gold-border: #8a6c3f;

    --green: #48a877;
    --green-bg: rgba(72, 168, 119, 0.12);
    --green-border: #296043;

    --amber: #dc8c43;
    --amber-bg: rgba(220, 140, 67, 0.12);
    --amber-border: #7e4f24;

    --blue: #5596dd;
    --blue-bg: rgba(85, 150, 221, 0.12);
    --blue-border: #265487;

    --red: #d95e50;
    --red-bg: rgba(217, 94, 80, 0.15);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; background: var(--bg); color: var(--fg); font-family: var(--font-sans); }

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* ————— 左侧边栏 (Sidebar) ————— */
.sidebar {
  width: 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease, margin-left 0.25s ease;
  z-index: 10;
}
.sidebar.collapsed {
  margin-left: -270px;
}

.sb-header {
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.sb-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sb-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--fg);
}
.ver-select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
}
.new-chat-btn {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--fg);
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.new-chat-btn:hover {
  background: var(--hover);
  border-color: var(--gold);
}

.sb-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}
.sb-group {
  margin-bottom: 16px;
}
.sb-group-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 8px;
  margin-bottom: 4px;
}
.sb-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
  position: relative;
}
.thread-item:hover {
  background: var(--hover);
}
.thread-item.active {
  background: var(--active);
  font-weight: 600;
  color: var(--gold);
}
.thread-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.thread-pin-tag {
  font-size: 10px;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 6px;
  font-weight: 500;
}
.thread-video-tag {
  font-size: 10.5px;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.thread-pin-icon {
  font-size: 11px;
  color: var(--gold);
  margin-right: 5px;
}
.thread-ver-pill {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card-bg);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 底部状态栏 */
.sb-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sb-footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
}
.sb-footer-btn:hover {
  background: var(--hover);
  border-color: var(--gold);
}
.sb-footer-btn .badge {
  background: var(--gold);
  color: #fff;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: bold;
}
.sb-footer-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 8px;
}
.sb-footer-link:hover {
  color: var(--gold);
}

/* ————— 中右主界面 (Main View) ————— */
.main-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.chat-header {
  height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  z-index: 5;
  flex-shrink: 0;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sidebar-toggle {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 32px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.sidebar-toggle:hover {
  background: var(--hover);
  border-color: var(--gold-border);
}
.thread-title-editable {
  font-size: 15px;
  font-weight: 600;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 0;
}
.thread-title-editable:hover {
  background: var(--hover);
}
.ver-badge {
  font-size: 11.5px;
  padding: 2px 8px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.project-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  background: var(--card-bg);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ————— 灵光语音对话球与语音状态坞 ————— */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 4px;
}
.voice-station {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 12px 3px 6px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.voice-station:hover {
  border-color: var(--gold-border);
}
body.inCall .voice-station {
  border-color: var(--gold);
  background: var(--gold-bg);
  box-shadow: 0 0 12px rgba(179, 126, 59, 0.2);
}

.orbit-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.orbit-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(232, 184, 114, 0.25), transparent 70%);
}

#orb {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  box-shadow: none;
}
#orb .lg-orb-canvas {
  position: absolute;
  left: -35%;
  top: -35%;
  width: 170%;
  height: 170%;
  pointer-events: none;
}

#callState {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.3px;
  user-select: none;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.inCall #callState {
  color: var(--gold);
  font-weight: 500;
}

.voice-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.voice-btn:hover {
  background: var(--hover);
  border-color: var(--gold);
}
body.inCall .voice-btn {
  border-color: var(--gold-border);
  background: var(--card-bg);
  color: var(--gold);
}
.voice-btn.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.hdr-btn {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s;
}
.hdr-btn:hover {
  background: var(--hover);
  border-color: var(--gold-border);
}
.hdr-btn.active {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--gold-border);
  font-weight: 600;
}
.hdr-btn.danger:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}

/* 消息流区域 */
.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 40px;
  scroll-behavior: smooth;
}

/* 欢迎页 */
.welcome-screen {
  max-width: 680px;
  margin: 60px auto 0;
  text-align: center;
}
.welcome-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.welcome-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
}
.welcome-desc code {
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--gold);
}
.starter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
}
.starter-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.starter-card:hover {
  border-color: var(--gold);
  background: var(--hover);
}
.starter-card b {
  display: block;
  font-size: 13.5px;
  margin-bottom: 4px;
  color: var(--fg);
}
.starter-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* 消息列表 */
.messages-container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 用户气泡 */
.msg-user-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
}
.msg-user-actions {
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  padding-top: 6px;
}
.msg-user-row:hover .msg-user-actions {
  opacity: 1;
}
.msg-spoken-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.msg-spoken-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.msg-spoken-box:hover .msg-spoken-actions {
  opacity: 1;
}
@media (hover: none) {
  .msg-user-actions,
  .msg-spoken-actions {
    opacity: 0.7;
  }
}
.msg-action-btn {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--muted);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.msg-action-btn:hover {
  color: var(--fg);
  border-color: var(--gold);
}
.msg-action-btn.danger:hover,
.card-action-btn.danger:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}
.msg-user-bubble {
  max-width: 78%;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 14px 14px 2px 14px;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.6;
}
.msg-user-images {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.msg-img-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s;
}
.msg-img-thumb:hover {
  transform: scale(1.04);
}

/* 助手回答卡片 */
.msg-asst-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg-spoken-box {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.65;
}

/* 独立详解卡片 (Detail Card) */
.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.detail-card-header {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fg);
}
.detail-card-actions {
  display: flex;
  gap: 8px;
}
.card-action-btn {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--muted);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.card-action-btn:hover {
  color: var(--fg);
  border-color: var(--gold);
}

.detail-card-body {
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
}

/* 三段式诊断样式突出 */
.diag-section {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.diag-loc {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
}
.diag-cause {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
}
.diag-fix {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}
.diag-title {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.diag-loc .diag-title { color: var(--amber); }
.diag-cause .diag-title { color: var(--blue); }
.diag-fix .diag-title { color: var(--green); }

/* Markdown 样式 */
.detail-card-body h1, .detail-card-body h2, .detail-card-body h3 {
  margin: 14px 0 8px;
  font-weight: 700;
}
.detail-card-body h1 { font-size: 17px; }
.detail-card-body h2 { font-size: 15.5px; }
.detail-card-body h3 { font-size: 14px; color: var(--gold); }
.detail-card-body p { margin-bottom: 8px; }
.detail-card-body ul, .detail-card-body ol { margin: 6px 0 10px 20px; }
.detail-card-body li { margin-bottom: 4px; }
.detail-card-body pre {
  background: #191815;
  color: #f1ede4;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.detail-card-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--hover);
  color: var(--gold);
}
.detail-card-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.detail-card-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.detail-card-body th, .detail-card-body td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
}
.detail-card-body th {
  background: var(--hover);
  font-weight: 600;
}

.detail-card-footer {
  background: var(--sidebar-bg);
  border-top: 1px solid var(--line);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.distill-badge {
  font-size: 11.5px;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  padding: 2px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ————— 底部输入坞 (Input Dock) ————— */
.input-dock {
  position: relative;
  padding: 12px 20px 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* 多段引用托盘与浮动按钮 */
.quote-btn {
  position: fixed;
  z-index: 1000;
  background: var(--gold);
  color: #ffffff;
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  user-select: none;
  transition: transform 0.1s, background-color 0.15s;
}
.quote-btn:hover {
  background: #a26f30;
  transform: translateY(-1px);
}
.quote-btn:active {
  transform: translateY(0);
}

.quote-tray {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.qitem {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.qt {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
  font-size: 12px;
}
.qdel {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  border-radius: 4px;
}
.qdel:hover {
  color: var(--red);
  background: var(--red-bg);
}
.qinput {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  color: var(--fg);
  outline: none;
  box-sizing: border-box;
}
.qinput:focus {
  border-color: var(--gold);
}

/* 截图即时预览缩略图条 (支持大图预览与状态展示) */
.pending-images {
  width: 100%;
  max-width: 820px;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.pending-img-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s;
}
.pending-img-chip:hover {
  border-color: var(--gold);
}
.pending-img-chip img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s;
}
.pending-img-chip img:hover {
  transform: scale(1.05);
}
.pending-img-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}
.pending-img-name {
  font-weight: 500;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-img-meta {
  color: var(--muted);
  font-size: 11px;
}
.pending-img-status {
  font-size: 11px;
  font-weight: 500;
}
.pending-img-status.uploading {
  color: var(--gold);
}
.pending-img-status.ready {
  color: var(--green);
}
.pending-img-status.error {
  color: var(--red);
}
.pending-img-chip .remove-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11.5px;
  padding: 3px 6px;
  margin-left: 6px;
  transition: all 0.15s;
}
.pending-img-chip .remove-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}

.input-box {
  width: 100%;
  max-width: 820px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 2px 16px rgba(179, 126, 59, 0.15);
}
.input-box textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  max-height: 180px;
}
.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.input-left-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-btn {
  border: 1px solid var(--line);
  background: var(--hover);
  color: var(--fg);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.tool-btn:hover {
  border-color: var(--gold);
}
.tool-select {
  border: 1px solid var(--line);
  background: var(--hover);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.send-btn {
  border: none;
  background: var(--gold);
  color: #fff;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-footnote {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.input-footnote code {
  color: var(--gold);
}

/* ————— 右侧大纲抽屉 (Detail Outline Drawer) ————— */
.outline-drawer {
  width: 290px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--line);
  position: absolute;
  top: 0;
  right: -290px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  z-index: 15;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
}
.outline-drawer.open {
  right: 0;
}
.drawer-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.drawer-title {
  font-size: 14px;
  font-weight: 700;
}
.drawer-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}
.outline-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.outline-item {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.outline-item:hover {
  border-color: var(--gold);
}
.outline-item-title {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}
.outline-item-time {
  font-size: 11px;
  color: var(--muted);
}
.outline-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 40px;
}

/* ————— 弹层与灯箱 (Modal Dialogs) ————— */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open {
  display: flex;
}
.modal-dialog {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 90%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-close { background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }

.modal-toolbar {
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
}
.modal-search {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  padding: 7px 12px;
  font-size: 13px;
}
.add-memory-btn {
  border: 1px solid var(--gold);
  background: var(--gold-bg);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.memory-card {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.memory-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.memory-topic {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--fg);
}
.memory-rule {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg);
}
.memory-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.memory-actions {
  display: flex;
  gap: 6px;
}
.mem-btn {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.mem-btn.del:hover {
  color: var(--red);
  border-color: var(--red);
}

/* 灯箱图片 */
.lightbox-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-close {
  position: absolute;
  top: -30px;
  right: -30px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
}
.lightbox-dialog img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* 响应式收敛 */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    height: 100%;
    z-index: 20;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  .starter-grid {
    grid-template-columns: 1fr;
  }
}

/* 方案与六匠多Agent协作改码看板 */
.plan-dock {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 24px;
  padding: 0;
  box-sizing: border-box;
}

.plan-card {
  background: var(--card-bg);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(179, 126, 59, 0.08);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.plan-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-project-badge {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.plan-version-badge {
  background: var(--card-bg);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
}

.plan-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.plan-status-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
}
.plan-status-badge.waiting {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}
.plan-status-badge.running {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.plan-status-badge.revising {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

/* 待拍板决策区 */
.plan-qs-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-qs-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.plan-q-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-q-label {
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
}
.plan-q-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-opt-btn {
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.plan-opt-btn:hover {
  border-color: var(--gold);
}
.plan-opt-btn.rec {
  border-style: dashed;
  border-color: var(--gold);
}
.plan-opt-btn.on {
  background: var(--gold);
  color: #ffffff;
  border: 1px solid var(--gold);
  font-weight: 500;
}

/* 方案正文折叠区 */
.plan-body-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.plan-body-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fg);
  max-height: 160px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.25s ease-out;
}
.plan-body-text.expanded {
  max-height: 3000px;
}
.plan-toggle-more {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0 0;
  display: block;
}

/* 六匠分工选择栏 */
.plan-roles-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.plan-role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.plan-role-label {
  color: var(--muted);
  width: 82px;
  flex-shrink: 0;
}
.plan-role-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.plan-role-chip {
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
}
.plan-role-chip.on {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.plan-base-select {
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  outline: none;
}

/* 操作按钮区 */
.plan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.plan-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
  transition: all 0.15s;
}
.plan-btn:hover {
  background: var(--hover);
}
.plan-btn.primary {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
}
.plan-btn.primary:hover {
  background: #a26f30;
}
.plan-btn.danger {
  color: var(--red);
}
.plan-btn.danger:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

/* 流程执行卡片与步骤表 */
.flow-progress-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flow-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.flow-step-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.flow-step-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--line);
}
.flow-step-item.cur {
  border-color: var(--gold);
  background: var(--gold-bg);
}
.flow-step-item.done {
  border-color: var(--green-border);
  color: var(--muted);
}
.flow-step-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}
.flow-step-badge.cur {
  background: var(--gold);
  color: #fff;
}
.flow-step-badge.done {
  background: var(--green);
  color: #fff;
}
.flow-step-badge.queued {
  background: var(--line);
  color: var(--muted);
}

/* ————— 视频素材展台与多视频卡片 ————— */
.video-material-tray {
  margin: 8px 0 12px 0;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.video-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.video-tray-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.video-tray-tag {
  font-size: 11px;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  padding: 1px 6px;
  border-radius: 4px;
}
.video-tray-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video-asset-card {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.video-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.video-card-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}
.video-card-link {
  font-size: 11.5px;
  color: var(--blue);
  text-decoration: none;
}
.video-card-link:hover {
  text-decoration: underline;
}
.video-frames-row, .keyframes-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.video-frame-thumb {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.video-frame-thumb:hover {
  transform: scale(1.05);
  border-color: var(--gold);
}
.msg-keyframes-wrap {
  margin: 6px 0 10px 0;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.keyframes-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

/* 顶部当班进程监视按钮与抽屉 */
.monitor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  color: var(--fg);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.monitor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  transition: background 0.2s, box-shadow 0.2s;
}
.monitor-dot.active {
  background: #28a745;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.active-tasks-drawer {
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 12px 18px;
  animation: slideDown 0.2s ease-out;
}
.tasks-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tasks-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tasks-drawer-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}
.tasks-drawer-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.tasks-drawer-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}
.tasks-drawer-close:hover {
  background: var(--hover);
  color: var(--fg);
}
.tasks-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.task-running-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.task-card-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 80%;
}
.task-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-persona-badge {
  font-weight: 600;
  color: var(--gold);
}
.task-id-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.task-step-desc {
  color: var(--fg);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.monitor-dot.done-dot {
  background: var(--gold);
  box-shadow: 0 0 5px rgba(176, 134, 67, 0.45);
}
.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12.5px;
  gap: 10px;
}
.task-card.done {
  border-left-color: #2e7d32;
}
.task-card-status {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.task-card-status.done {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.28);
}

/* 工单消息下方派发动作与交付审核看板区 */
.dispatch-action-box {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--gold-bg);
  border: 1px dashed var(--gold-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.dispatch-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dispatch-tip {
  font-size: 12.5px;
  color: var(--fg);
  font-weight: 500;
}
.dispatch-tip.running-tip {
  color: #28a745;
}
.dispatch-tip.done-tip {
  color: var(--gold-deep, #8a6421);
  font-weight: 600;
}
.dispatch-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dispatch-run-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}
.dispatch-run-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}
.dispatch-run-btn:active:not(:disabled) {
  transform: translateY(0);
}
.dispatch-run-btn.locked,
.dispatch-run-btn.done-locked {
  background: rgba(168, 132, 68, 0.16);
  color: var(--muted);
  border: 1px solid var(--gold-border);
  cursor: not-allowed;
  transform: none;
}
.dispatch-rerun-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.dispatch-rerun-btn:hover {
  color: var(--fg);
  border-color: var(--gold);
}

/* 实时进度与交付审核看板 */
.task-delivery-panel {
  background: var(--bg-card, #fdfaf3);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--fg-soft, #5b5247);
}
.task-meta-grid strong {
  color: var(--fg);
  font-weight: 600;
}
.task-live-steps {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 8px;
  background: var(--bg-soft, #f5efe2);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.task-step-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-files-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.task-files-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.task-file-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  background: var(--bg-soft, #f3ede0);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg);
}
.task-file-chip.more,
.task-file-more {
  font-size: 11px;
  color: var(--gold);
  border-color: var(--gold-border);
}
.task-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a745;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
  animation: pulse-dot 1.8s infinite;
}
.task-done-badge {
  display: inline-block;
  padding: 2px 7px;
  margin-right: 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.3);
}
.task-progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-step-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-soft, #f5efe2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg-soft, #5b5247);
}
.task-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}
.task-review-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--gold-border);
  background: var(--bg);
  color: var(--fg);
  transition: all 0.15s ease;
}
.task-review-btn.primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.task-review-btn:hover {
  opacity: 0.92;
  border-color: var(--gold);
}
.task-diff-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.task-diff-pre {
  background: #1e1e1e;
  color: #e6e1dc;
  padding: 12px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 55vh;
  white-space: pre;
}

/* ── 实时语音按钮 + 【讨论 / 方案 / 实施】三态切换器与协同配置面板 ── */
@keyframes popUpDrawer {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.realtime-voice-btn {
  position: relative;
  padding-left: 22px !important;
  font-weight: 600;
  transition: all 0.18s ease;
}
.realtime-voice-btn::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.2s ease;
}
.realtime-voice-btn.active {
  background: rgba(46, 125, 50, 0.12) !important;
  color: #1f6324 !important;
  border-color: rgba(46, 125, 50, 0.45) !important;
}
.realtime-voice-btn.active::before {
  background: #28a745;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.8);
  animation: pulse-dot 1.4s infinite;
}

.work-mode-switch {
  display: inline-flex;
  align-items: center;
  background: #f3ecdf;
  border: 1px solid #c4a36a;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.mode-seg-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #3a3226;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.mode-seg-btn:hover { color: #221f1a; }
.mode-seg-btn.active {
  background: #6e5410;
  color: #fffef9;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .work-mode-switch { background: #2a241c; border-color: rgba(212,165,90,.45); }
  .mode-seg-btn { color: #ebe5d8; }
  .mode-seg-btn:hover { color: #fff8e6; }
  .mode-seg-btn.active { background: #f1d29a; color: #1a140c; }
}

/* 悬浮于输入框正上方的【方案 / 实施】配置抽屉：绝不把底部输入框顶出屏幕 */
.mode-config-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 20px;
  right: 20px;
  width: calc(100% - 40px);
  max-width: 820px;
  margin: 0 auto;
  z-index: 45;
  background: rgba(253, 250, 243, 0.98);
  backdrop-filter: blur(8px);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 12px 16px;
  box-sizing: border-box;
  box-shadow: 0 -6px 26px rgba(42, 34, 24, 0.12), 0 2px 10px rgba(179, 126, 59, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(330px, 52vh);
  overflow: hidden;
  animation: popUpDrawer 0.16s ease-out;
}
.mode-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
  flex-shrink: 0;
}
.mode-config-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-config-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.mode-config-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mode-mini-btn {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-mini-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}
.mode-mini-btn.close-btn {
  color: var(--muted);
}
.mode-mini-btn.close-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}

/* 方案模式：单行紧凑可滚动的讨论记录勾选列表 */
.mode-msg-checklist {
  max-height: 156px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}
.mode-msg-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}
.mode-msg-check-item:hover {
  border-color: var(--gold-border);
  background: #faf5e8;
}
.mode-msg-check-item.checked {
  background: #f8f0de;
  border-color: rgba(158, 107, 43, 0.45);
}
.mode-msg-check-item input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}
.mode-msg-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 26px;
  flex-shrink: 0;
}
.mode-msg-role-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  background: #ede6d6;
  color: #5b5247;
}
.mode-msg-role-tag.user {
  background: rgba(158, 107, 43, 0.15);
  color: var(--gold);
}
.mode-msg-excerpt {
  flex: 1;
  min-width: 0;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}
.mode-role-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  flex: 1;
}
.mode-role-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  min-width: 72px;
  flex-shrink: 0;
}
.mode-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mode-role-pill {
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-role-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.mode-role-pill.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(158, 107, 43, 0.25);
}

.mode-primary-run-btn {
  border: none;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(158, 107, 43, 0.25);
  transition: opacity 0.15s, transform 0.1s;
}
.mode-primary-run-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.stream-plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(90deg, rgba(179, 126, 59, 0.14), rgba(179, 126, 59, 0.04));
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 8px;
}
.stream-plan-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--fg);
}
.stream-plan-badge {
  background: var(--gold);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 5px;
}






/* UE teacher records reuse the workbench theme, never hard-code light backgrounds. */
.ue-teaching-panel { margin:8px 12px; padding:8px; border:1px solid var(--line,var(--border)); border-radius:8px; font-size:12px; max-height:42vh; overflow:auto; flex-shrink:0; }
.ue-teaching-panel[hidden] { display:none; }
.ue-teaching-body { display:grid; gap:10px; padding-top:8px; }
.ue-teaching-body label { display:grid; gap:4px; margin:6px 0; }
.ue-teaching-body select,.ue-teaching-body textarea { width:100%; max-width:100%; box-sizing:border-box; background:var(--card,var(--bg)); color:var(--ink); border:1px solid var(--line,var(--border)); border-radius:5px; padding:5px; }
.ue-teaching-body button { background:var(--card,var(--bg)); color:var(--ink); border:1px solid var(--line,var(--border)); border-radius:5px; padding:4px 6px; margin:3px; cursor:pointer; }
.ue-teaching-body pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:11px; max-height:200px; overflow:auto; }
.ue-hypothesis { padding:6px 0; border-bottom:1px solid var(--line,var(--border)); }.ue-hypothesis small {display:block;color:var(--muted);}.ue-hypothesis.ruled-out span {text-decoration:line-through;opacity:.6;}
.ue-student-line {font-size:11px;color:var(--muted);}.ue-teaching-status {color:var(--gold);overflow-wrap:anywhere;}
