/* ================================
   AI 办公室 · 样式表（纯本地无依赖）
   ================================ */

:root {
  /* 页面中性暖灰-浅石色系：深浅适中、层次清晰 */
  --bg-page: #eceee9;
  --bg-surface: #ffffff;
  --bg-surface-soft: #f6f7f4;
  --bg-topbar: rgba(255, 255, 255, 0.86);
  --border-subtle: #dcdfd8;
  --border-strong: #c8cdc4;

  --text-primary: #1f2523;
  --text-secondary: #58625e;
  --text-muted: #7f8984;

  /* 7 种互不相同的状态颜色 */
  --status-running: #22a565;
  --status-running-soft: #e6f6ee;

  --status-waiting: #de9318;
  --status-waiting-soft: #fdf4e3;

  --status-blocked: #d94844;
  --status-blocked-soft: #fdeaea;

  --status-billing: #c89408;
  --status-billing-soft: #fef6d6;

  --status-done: #2d87d8;
  --status-done-soft: #e7f2fc;

  --status-idle: #95a0ad;
  --status-idle-soft: #f0f2f5;

  --status-offline: #7e6d96;
  --status-offline-soft: #f1eef6;

  --shadow-card: 0 2px 10px rgba(24, 32, 28, 0.05);
  --shadow-card-hover: 0 8px 22px rgba(24, 32, 28, 0.10);
  --shadow-scene: 0 12px 32px rgba(22, 24, 22, 0.14);
  --shadow-modal: 0 24px 60px rgba(15, 20, 18, 0.28);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f4f5f1 0%, var(--bg-page) 62%, #e4e7e0 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 56px;
}

/* ---------------- 顶部导航栏 ---------------- */

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  margin-bottom: 18px;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 20px rgba(24, 30, 27, 0.06);
  border-radius: var(--radius-lg);
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2d3834 0%, #4d5d56 100%);
  color: #f6efe3;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.mode-badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: #8a5707;
  background: #fdf0d5;
  border: 1px solid #f0d095;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attention-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: #fdf0ea;
  border: 1px solid #f2c4bc;
  color: #b53632;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.attention-pill:hover {
  background: #fce3da;
  transform: translateY(-1px);
}

.attention-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-blocked);
  animation: pulse-ring 1.8s ease-out infinite;
}

.refresh-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-running);
  box-shadow: 0 0 0 3px rgba(34, 165, 101, 0.18);
}

.refresh-time {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.btn-subtle {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.btn-subtle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: #f9faf8;
}

.btn-subtle:active {
  transform: translateY(1px);
}

.btn-primary-subtle {
  background: #2d3834;
  border-color: #2d3834;
  color: #f7f5f0;
}

.btn-primary-subtle:hover {
  background: #3d4c46;
  border-color: #3d4c46;
  color: #ffffff;
}

.btn-danger-subtle {
  color: #9e3531;
  border-color: #ebc9c6;
  background: #fff7f6;
}

.btn-danger-subtle:hover {
  color: #7e221e;
  border-color: #dea7a2;
  background: #fdeceb;
}

/* ---------------- 云端认证与连接提示条 ---------------- */

.cloud-banner {
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  font-size: 13px;
}

.cloud-auth-panel {
  border-color: #e6d3a7;
  background: #fffcf3;
}

.cloud-auth-panel.is-error {
  border-color: #ecb8b5;
  background: #fff6f5;
}

.cloud-auth-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cloud-auth-msg {
  font-weight: 600;
  color: #7c5612;
}

.cloud-auth-panel.is-error .cloud-auth-msg {
  color: #b02e2a;
}

.cloud-auth-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cloud-token-input {
  width: 240px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.cloud-token-input:focus {
  border-color: #2d87d8;
  box-shadow: 0 0 0 3px rgba(45, 135, 216, 0.16);
}

.connection-banner {
  border-color: #f0cf95;
  background: #fff8e8;
  color: #8a5607;
  font-weight: 600;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* ---------------- 等距办公室场景 ---------------- */

.scene-card {
  position: relative;
  isolation: isolate;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-scene);
}

.office-scroll {
  width: 100%;
  overflow-x: auto;
  background: #1f1e1c;
}

.office-stage {
  position: relative;
  width: 100%;
  min-width: 680px;
  aspect-ratio: 1536 / 1024;
  background: #22211f;
  overflow: hidden;
  user-select: none;
  --scene-scale: 1;
  --seat-ghost-opacity: 0.35;
}

.office-bg-img,
.office-svg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.office-svg-bg {
  z-index: 1;
}

.office-bg-img {
  z-index: 2;
  object-fit: fill;
}

.office-bg-img[hidden],
.office-svg-bg[hidden] {
  display: none !important;
}

.scene-hud-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  background: rgba(25, 27, 30, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f3f1ec;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4cd28f;
}

.hud-sep {
  opacity: 0.45;
}

.office-stage.is-paused *,
.office-stage.is-paused *::before,
.office-stage.is-paused *::after {
  animation-play-state: paused !important;
}

.office-empty-seats {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.empty-seat-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: clamp(1px, calc(2.5px * var(--scene-scale, 1)), 3px) clamp(5px, calc(8px * var(--scene-scale, 1)), 9px);
  border-radius: var(--radius-pill);
  background: rgba(24, 21, 18, 0.44);
  border: 1px dashed rgba(255, 244, 224, 0.28);
  color: rgba(246, 238, 224, 0.62);
  font-size: clamp(8.5px, calc(11px * var(--scene-scale, 1)), 11px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.office-seats {
  position: absolute;
  inset: 0;
  z-index: 8;
}

.office-nameplates {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

/* 角色节点：left/top/width/height 精准对应底图缩放后的可见包围框 */
.seat-node {
  position: absolute;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  outline: none;
}

.seat-node:hover,
.seat-node:focus-visible {
  z-index: 1200 !important;
}

.seat-node:hover .seat-sprite-anim,
.seat-node:focus-visible .seat-sprite-anim {
  filter: brightness(1.07) drop-shadow(0 0 6px rgba(255, 250, 236, 0.48));
}

.seat-node:focus-visible .seat-sprite-clip {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
  border-radius: 8px;
}

/* 遮挡裁切层：保持静止与无水平翻转，确保桌沿/前墙 clip-path 精准对齐 */
.seat-sprite-clip {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: filter 0.22s ease, opacity 0.22s ease;
}

.seat-sprite-anim {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: center bottom;
  transition: filter 0.18s ease;
}

/* 状态视觉：offline / claude 整体稍微灰一点 + 工位摸鱼晃动 */
.seat-node.is-offline .seat-sprite-clip {
  filter: grayscale(0.62) contrast(0.94) brightness(0.95);
  opacity: 0.74;
}

.seat-node.is-offline:hover .seat-sprite-clip,
.seat-node.is-offline:focus-visible .seat-sprite-clip {
  opacity: 0.88;
}

/* 坐姿进行中轻微呼吸起伏 */
.seat-node.status-running.is-seated .seat-sprite-anim {
  animation: seat-bob 2.6s ease-in-out infinite;
}

/* 站立停留轻微呼吸（休息区站位或走道停留） */
.seat-node.is-standing .seat-sprite-anim {
  animation: seat-bob 2.8s ease-in-out infinite;
}

/* 休息区坐位（沙发/吧台凳）轻微放松呼吸 */
.seat-node.is-resting .seat-sprite-anim {
  animation: seat-bob 3.4s ease-in-out infinite;
}

/* offline / claude 工位摸鱼轻微晃动 */
.seat-node.is-offline .seat-sprite-anim {
  animation: slacking-sway 3.6s ease-in-out infinite;
}

/* 走路时轻微上下摆动 */
.seat-node.is-walking .seat-sprite-anim {
  animation: walk-bob 0.38s ease-in-out infinite;
}

.seat-sprite-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 4px 6px rgba(24, 18, 12, 0.34));
  pointer-events: none;
}

.seat-sprite-img.is-flipped {
  transform: scaleX(-1);
}

.seat-node.is-lead .seat-sprite-img {
  filter: drop-shadow(0 0 10px rgba(255, 198, 76, 0.42)) drop-shadow(0 5px 8px rgba(24, 18, 12, 0.4));
}

/* 头顶气泡容器：紧贴本人头顶正上方，位于遮挡裁切层之外 */
.seat-bubble-stack {
  position: absolute;
  bottom: calc(100% + max(2px, calc(3px * var(--scene-scale, 1))));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: max(2px, calc(3px * var(--scene-scale, 1)));
  pointer-events: none;
}

/* 口头禅 / 相遇聊天 / done 出发短气泡（2~3 秒消失） */
.seat-catchphrase {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2px, calc(3.5px * var(--scene-scale, 1)), 4px) clamp(6px, calc(9px * var(--scene-scale, 1)), 10px);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.96);
  border: 1.5px solid rgba(92, 78, 62, 0.26);
  color: #2b2620;
  font-size: clamp(9.5px, calc(12px * var(--scene-scale, 1)), 12px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(18, 16, 14, 0.26);
  animation: catchphrase-pop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.seat-catchphrase::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: max(3px, calc(4px * var(--scene-scale, 1))) solid transparent;
  border-top-color: rgba(255, 253, 248, 0.96);
}

.seat-catchphrase.is-chat {
  background: rgba(244, 248, 255, 0.96);
  border-color: rgba(45, 135, 216, 0.42);
  color: #1f4c7a;
  letter-spacing: 0.08em;
}

.seat-catchphrase.is-chat::after {
  border-top-color: rgba(244, 248, 255, 0.96);
}

.seat-catchphrase.is-done-flash {
  background: rgba(235, 246, 255, 0.97);
  border-color: var(--status-done);
  color: #195b96;
}

.seat-catchphrase.is-done-flash::after {
  border-top-color: rgba(235, 246, 255, 0.97);
}

/* 头顶状态图标气泡：沿用 v2.2 的 7 种图标与颜色 */
.seat-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, calc(4px * var(--scene-scale, 1)), 4px);
  max-width: clamp(96px, calc(156px * var(--scene-scale, 1)), 170px);
  padding: clamp(2px, calc(3px * var(--scene-scale, 1)), 4px) clamp(5px, calc(8px * var(--scene-scale, 1)), 9px);
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 9px rgba(18, 22, 20, 0.28);
  font-size: clamp(10px, calc(13px * var(--scene-scale, 1)), 13px);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
}

.seat-indicator.is-icon-only {
  width: clamp(19px, calc(26px * var(--scene-scale, 1)), 28px);
  height: clamp(19px, calc(26px * var(--scene-scale, 1)), 28px);
  padding: 0;
  border-radius: 50%;
}

.seat-indicator-icon {
  flex-shrink: 0;
  font-size: clamp(10.5px, calc(14px * var(--scene-scale, 1)), 15px);
  line-height: 1;
}

.seat-indicator-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(9px, calc(11.5px * var(--scene-scale, 1)), 11.5px);
  font-weight: 600;
  line-height: 1.15;
}

.seat-indicator.status-running {
  background: rgba(235, 251, 242, 0.96);
  border-color: var(--status-running);
  color: #15663e;
  animation: pulse-ring-green 2.2s ease-out infinite;
}

.seat-indicator.status-waiting {
  background: rgba(255, 248, 232, 0.96);
  border-color: var(--status-waiting);
  color: #9c6306;
  box-shadow: 0 3px 9px rgba(180, 120, 14, 0.30);
}

.seat-indicator.status-blocked {
  background: rgba(255, 238, 238, 0.97);
  border-color: var(--status-blocked);
  color: #a92622;
  box-shadow: 0 3px 10px rgba(160, 26, 26, 0.34);
  animation: pulse-ring 1.6s ease-out infinite;
}

.seat-indicator.status-billing {
  background: linear-gradient(180deg, #fffbe6 0%, #fef0b5 100%);
  border-color: #d69800;
  color: #7c5200;
  box-shadow: 0 3px 10px rgba(180, 126, 0, 0.34);
  animation: pulse-ring-gold 1.8s ease-out infinite;
}

.seat-indicator.status-done {
  background: rgba(235, 246, 255, 0.94);
  border-color: var(--status-done);
  color: #1e63a3;
}

.seat-indicator.status-idle {
  background: rgba(244, 246, 249, 0.90);
  border-color: var(--status-idle);
  color: #5c6672;
}

.seat-indicator.status-offline {
  background: rgba(243, 241, 247, 0.88);
  border-color: rgba(126, 109, 150, 0.62);
  color: #5f5075;
  opacity: 0.88;
}

.seat-avatar-ring {
  width: 82%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 14px rgba(15, 15, 15, 0.38);
  background: #e9ece8;
  display: grid;
  place-items: center;
}

.seat-node.is-lead .seat-avatar-ring {
  border-color: #f3cf86;
  box-shadow: 0 0 0 3px rgba(243, 207, 134, 0.32), 0 8px 18px rgba(15, 15, 15, 0.42);
}

.seat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  letter-spacing: 0.02em;
}

.seat-avatar-ring .avatar-placeholder {
  font-size: clamp(14px, calc(22px * var(--scene-scale, 1)), 22px);
}

/* 名牌（位于独立顶层，默认隐藏；悬停或聚焦显示，主管位常显） */
.seat-nameplate {
  position: absolute;
  transform: translate(-50%, 0);
  margin-top: max(1px, calc(2px * var(--scene-scale, 1)));
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: clamp(1px, calc(2px * var(--scene-scale, 1)), 2.5px) clamp(5px, calc(8px * var(--scene-scale, 1)), 9px);
  border-radius: var(--radius-pill);
  background: rgba(24, 24, 24, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f7f4ee;
  font-size: clamp(9.5px, calc(12.5px * var(--scene-scale, 1)), 12px);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease, box-shadow 0.16s ease;
}

.seat-nameplate.is-lead {
  background: rgba(54, 38, 16, 0.92);
  border-color: rgba(245, 206, 122, 0.76);
  color: #fff0cb;
  box-shadow: 0 3px 12px rgba(210, 148, 36, 0.38);
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.seat-nameplate.is-offline {
  filter: grayscale(0.75);
}

.seat-nameplate.is-visible {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

.seat-nameplate.is-focus-visible {
  box-shadow: 0 0 0 2px #ffffff, 0 4px 12px rgba(0, 0, 0, 0.45);
}

.seat-lead-star {
  color: #f4c668;
  font-size: clamp(9px, calc(11.5px * var(--scene-scale, 1)), 11.5px);
}

.scene-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 18px;
  background: #f8f9f6;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.scene-interval {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------------- 区块通用头部 ---------------- */

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-count {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

/* 状态图例 */
.status-legend {
  list-style: none;
  margin: 0;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-icon {
  font-size: 13px;
  line-height: 1;
}

/* 状态圆点通用色 */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.status-running,
.seat-bubble-dot.status-running { background: var(--status-running); }

.status-dot.status-waiting,
.seat-bubble-dot.status-waiting { background: var(--status-waiting); }

.status-dot.status-blocked,
.seat-bubble-dot.status-blocked { background: var(--status-blocked); }

.status-dot.status-billing,
.seat-bubble-dot.status-billing { background: var(--status-billing); }

.status-dot.status-done,
.seat-bubble-dot.status-done { background: var(--status-done); }

.status-dot.status-idle,
.seat-bubble-dot.status-idle { background: var(--status-idle); }

.status-dot.status-offline,
.seat-bubble-dot.status-offline { background: var(--status-offline); }

/* ---------------- 团队卡片网格 ---------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.team-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 17px 16px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.team-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--status-idle));
  transition: background-color 0.2s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.team-card:focus-visible {
  outline: 2px solid #2d87d8;
  outline-offset: 2px;
}

.team-card.status-running { --card-accent: var(--status-running); }
.team-card.status-waiting { --card-accent: var(--status-waiting); }
.team-card.status-blocked { --card-accent: var(--status-blocked); }
.team-card.status-billing { --card-accent: var(--status-billing); }
.team-card.status-done    { --card-accent: var(--status-done); }
.team-card.status-idle    { --card-accent: var(--status-idle); }
.team-card.status-offline {
  --card-accent: var(--status-offline);
  background: #f9f8fb;
}

.card-avatar-box {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #eef0ec;
  background: #f0f2ee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.team-card.is-lead .card-avatar-box {
  border-color: #ebd096;
}

.card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-avatar-box .avatar-placeholder {
  font-size: 20px;
}

.card-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.card-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-badge {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: #825914;
  background: #fbf0d9;
  border: 1px solid #ebd19a;
}

.card-role {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-status-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-status-icon {
  font-size: 13px;
  line-height: 1;
}

.team-card.status-running .card-status-text { color: #197c4c; }
.team-card.status-waiting .card-status-text { color: #a76c0a; }
.team-card.status-blocked .card-status-text { color: #b5322e; }
.team-card.status-billing .card-status-text { color: #946900; }
.team-card.status-done .card-status-text    { color: #1e63a3; }
.team-card.status-idle .card-status-text    { color: #67727e; }
.team-card.status-offline .card-status-text { color: #66577c; }

.card-task-preview {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 需要你关注 ---------------- */

.live-badge {
  padding: 3px 9px;
  border-radius: 6px;
  background: #e3efe7;
  border: 1px solid #c2decb;
  color: #2c6d4a;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attention-empty {
  padding: 24px 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.attention-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--status-waiting);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.attention-card.status-blocked {
  border-left-color: var(--status-blocked);
  background: linear-gradient(90deg, #fff7f7 0%, #ffffff 28%);
}

.attention-card.status-billing {
  border-left-color: var(--status-billing);
  background: linear-gradient(90deg, #fffbeb 0%, #ffffff 28%);
}

.attention-card.status-waiting {
  border-left-color: var(--status-waiting);
  background: linear-gradient(90deg, #fffbf2 0%, #ffffff 28%);
}

.attention-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.attention-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.attention-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #eceee9;
  background: #f1f2ee;
}

.attention-avatar .avatar-placeholder {
  font-size: 16px;
}

.attention-info {
  min-width: 0;
  flex: 1;
}

.attention-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.attention-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.attention-role {
  font-size: 12.5px;
  color: var(--text-muted);
}

.attention-task {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  word-break: break-word;
}

.attention-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.attention-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 状态胶囊 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.status-running { background: var(--status-running-soft); color: #197c4c; }
.status-pill.status-waiting { background: var(--status-waiting-soft); color: #9c6306; }
.status-pill.status-blocked { background: var(--status-blocked-soft); color: #b5322e; }
.status-pill.status-billing { background: var(--status-billing-soft); color: #8c6200; }
.status-pill.status-done    { background: var(--status-done-soft);    color: #1e63a3; }
.status-pill.status-idle    { background: var(--status-idle-soft);    color: #5c6672; }
.status-pill.status-offline { background: var(--status-offline-soft); color: #5f5075; }

/* ---------------- 详情弹窗 ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 22, 20, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.16s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  outline: none;
  animation: pop-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-accent-bar {
  height: 5px;
  background: var(--status-idle);
}

.modal-accent-bar.status-running { background: var(--status-running); }
.modal-accent-bar.status-waiting { background: var(--status-waiting); }
.modal-accent-bar.status-blocked { background: var(--status-blocked); }
.modal-accent-bar.status-billing { background: var(--status-billing); }
.modal-accent-bar.status-done    { background: var(--status-done); }
.modal-accent-bar.status-idle    { background: var(--status-idle); }
.modal-accent-bar.status-offline { background: var(--status-offline); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.modal-avatar-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #e7eae4;
  background: #f2f4ef;
}

.modal-avatar-wrap .avatar-placeholder {
  font-size: 22px;
}

.modal-title-block {
  min-width: 0;
}

.modal-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-role {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
  font-size: 21px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.modal-close:hover {
  background: #eaece7;
  color: var(--text-primary);
}

.modal-body {
  padding: 18px 20px 22px;
}

.modal-warning {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff6e6;
  border: 1px solid #f0d096;
  color: #8a5607;
  font-size: 12.5px;
}

.detail-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
}

.detail-row dt {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-row dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-row-task {
  align-items: start;
}

.detail-task {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-soft);
  border: 1px solid #e6e9e3;
  line-height: 1.55;
}

.detail-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.detail-muted {
  color: var(--text-muted);
}

/* ---------------- 动效 ---------------- */

@keyframes seat-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}

@keyframes slacking-sway {
  0%, 100% { transform: rotate(-1.6deg) translateY(0); }
  50% { transform: rotate(1.8deg) translateY(-1px); }
}

@keyframes walk-bob {
  0%, 100% { transform: translateY(0) rotate(-1.8deg); }
  50% { transform: translateY(-3.5px) rotate(1.8deg); }
}

@keyframes catchphrase-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(217, 72, 68, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(217, 72, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 72, 68, 0); }
}

@keyframes pulse-ring-green {
  0%   { box-shadow: 0 0 0 0 rgba(34, 165, 101, 0.65); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 165, 101, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 165, 101, 0); }
}

@keyframes pulse-ring-gold {
  0%   { box-shadow: 0 0 0 0 rgba(214, 152, 0, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(214, 152, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 152, 0, 0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- 响应式适配 ---------------- */

@media (max-width: 960px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px 12px 44px;
  }

  .topbar {
    top: 8px;
    padding: 11px 13px;
    border-radius: 16px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .attention-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .attention-right {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
