/* ============================================================================
   经营工作台 · v3（覆盖层，最后加载）
   目标：去掉「一个白卡片装所有东西」的模板感，改成
   ① 左侧：对话优先的主画布（标题栏 → 提示条 → 消息区 → 输入区）
   ② 右侧：轻量资料栏（无卡片、无重边框，只有一条分隔线）
   ③ 空态：编号卡片网格，而不是居中的三颗药丸按钮
   只改样式与结构，不动任何 data-* 钩子与 id。
   ========================================================================= */

/* ---------------------------------------------------------------- 页头 */
.ws-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}
.ws-eyebrow {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-5);
}
.ws-top h1 {
  margin: 9px 0 6px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.032em;
  color: var(--ink);
  line-height: 1.2;
}
.ws-top p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-4);
}
.ws-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-bottom: 3px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.ws-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------------------------------------------------------------- 布局 */
.ws-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 16px;
  align-items: start;
}

/* ---------------------------------------------------------------- 主画布 */
.ws-conv {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 566px;
  /* 不再是一张卡片：没有描边、没有底色、没有圆角，靠留白和右侧留白分隔 */
  overflow: visible;
}

.ws-conv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 4px;
}
.ws-conv-id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.ws-conv-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
}
.ws-conv-id h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-conv-id small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--ink-5);
}
.ws-conv-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ws-mode { position: relative; }
.ws-mode select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9fd;
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  font-weight: 550;
  padding: 6px 26px 6px 10px;
  cursor: pointer;
}
.ws-mode select:hover { border-color: var(--line-strong); background: #fff; }
.ws-mode::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  border-right: 1.4px solid var(--ink-4);
  border-bottom: 1.4px solid var(--ink-4);
  transform: rotate(45deg);
  pointer-events: none;
}
.ws-text-btn {
  border: 0;
  background: none;
  font: inherit;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.ws-text-btn:hover:not(:disabled) { background: var(--card-2); color: var(--brand-deep); }
.ws-text-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ws-hint {
  padding: 0 0 12px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink-5);
  background: none;
  border-bottom: 0;
}
.ws-poll-error {
  padding: 9px 18px;
  font-size: 10.5px;
  color: #8a6a1f;
  background: #fdf8ea;
  border-bottom: 1px solid #f2e6c8;
}

/* ---------------------------------------------------------------- 消息区 */
.ws-conv .chat-feed {
  flex: 1;
  min-height: 200px;
  padding: 8px 0 6px;
}
/* 空态在画布内垂直居中，避免内容全挤在顶部、下面留一大块白 */
.ws-conv .chat-feed.is-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 22px;
}
.ws-conv .older-messages { margin-bottom: 18px; }

/* ---------------------------------------------------------------- 空态 */
.ws-empty { padding: 4px 2px 0; }
.ws-empty-head h3 {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ink);
}
.ws-empty-head p {
  margin: 0 0 18px;
  max-width: 520px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-4);
}
.ws-starters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ws-starter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  padding: 13px 13px 12px;
  background: #fbfcfe;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
              transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.ws-starter:hover:not(:disabled) {
  background: #fff;
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -14px rgba(11, 15, 23, 0.35);
}
.ws-starter:disabled { opacity: 0.5; cursor: not-allowed; }
.ws-starter-no {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-5);
  font-variant-numeric: tabular-nums;
}
.ws-starter-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.ws-starter-q {
  font-size: 11px;
  line-height: 1.65;
  color: var(--ink-4);
}
.ws-starter-arrow {
  position: absolute;
  top: 11px;
  right: 11px;
  font-size: 11px;
  color: var(--ink-5);
  opacity: 0;
  transition: opacity 0.16s var(--ease), color 0.16s var(--ease);
}
.ws-starter:hover:not(:disabled) .ws-starter-arrow { opacity: 1; color: var(--brand); }

/* ---------------------------------------------------------------- 输入区 */
.ws-composer {
  margin: auto 0 0;
  padding: 12px 0 2px;
  border-top: 0;
  background: none;
}
.ws-composer textarea {
  width: 100%;
  min-height: 62px;
  max-height: 190px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.75;
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.ws-composer textarea::placeholder { color: var(--ink-5); }
.ws-composer textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ws-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.ws-composer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ws-chip {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-3);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.ws-chip:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.ws-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.ws-hintline {
  font-size: 10px;
  color: var(--ink-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-send {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #0b1424;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}
.ws-send:hover:not(:disabled) { background: #16233a; }
.ws-send:active:not(:disabled) { transform: translateY(1px); }
.ws-send:disabled { opacity: 0.4; cursor: not-allowed; }
.ws-send span { font-size: 11px; opacity: 0.65; }

/* ---------------------------------------------------------------- 右侧资料栏 */
.ws-rail {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  padding: 2px 2px 0 0;
  border-left: 0;
  min-height: 566px;
}
.ws-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ws-rail-head h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ws-count {
  padding: 1px 6px;
  border-radius: 5px;
  background: #eaeff8;
  color: var(--ink-4);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}
.ws-rail-sub {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink-5);
}
.ws-rail-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
}
.ws-rail-empty {
  margin: auto 0;
  padding: 24px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--ink-4);
}
.ws-rail-empty span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 9px;
  border-radius: 10px;
  background: #f2f6fc;
  color: var(--ink-4);
}
.ws-rail-empty svg { width: 17px; height: 17px; }
.ws-rail-empty b {
  display: block;
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-3);
}
.ws-rail-empty p {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.65;
  color: var(--ink-5);
}

/* 资料栏里的文件条目：压扁、去阴影 */
.ws-rail .file-tile {
  gap: 9px;
  padding: 9px 10px;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}
.ws-rail .file-tile:hover { border-color: var(--line-strong); }
.ws-rail .file-type {
  min-width: 26px;
  height: 30px;
  font-size: 7.5px;
  border-radius: 6px;
}
.ws-rail .file-name strong { font-size: 10.5px; }

/* ---------------------------------------------------------------- 消息气泡 */
.ws-conv .message { margin-bottom: 20px; }
.ws-conv .message-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 11px;
  background: var(--brand-soft);
  border: 1px solid #dbe6fb;
  color: var(--brand-deep);
}
.ws-conv .from-user .message-avatar {
  background: #eef1f6;
  border-color: var(--line);
  color: var(--ink-4);
}
.ws-conv .message-meta b { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.ws-conv .message-meta span { font-size: 9.5px; color: var(--ink-5); }
.ws-conv .message-text { font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.ws-conv .from-user .message-text {
  background: #f4f7fc;
  border: 1px solid var(--line-soft);
  border-radius: 2px 12px 12px 12px;
  padding: 11px 14px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
  .ws-rail {
    min-height: 0;
    padding: 16px 2px 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  /* 整行变宽后，虚线空框别横贯到底，收成一个左对齐的小块 */
  .ws-rail-empty { margin: 0; max-width: 420px; padding: 18px 16px; }
}
@media (max-width: 900px) {
  .ws-starters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-conv { min-height: 520px; }
}
@media (max-width: 720px) {
  .ws-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ws-top h1 { font-size: 25px; }
  .ws-starters { grid-template-columns: minmax(0, 1fr); }
  .ws-hintline { display: none; }
  .ws-conv-head { flex-wrap: wrap; gap: 10px; }
  .ws-conv-tools { width: 100%; justify-content: flex-end; }
}

/* 异常提示里带一个「刷新状态」按钮（头部去掉后，恢复入口放在这里） */
.ws-poll-error {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ws-poll-error .btn { margin-left: auto; }
