:root {
      color-scheme: light;
      --ds-page: #f6f6f8;
      --ds-bg: #ffffff;
      --ds-main-tint: #ffffff;
      --ds-sidebar: #fafafa;
      --ds-border: #e4e4e7;
      --ds-separator: #ebebef;
      --ds-text: #18181b;
      --ds-muted: #71717a;
      --ds-secondary: #52525b;
      --ds-accent: #2563eb;
      --ds-accent-hover: #1d4ed8;
      --ds-item-hover: #f4f4f5;
      --ds-item-active: #eff6ff;
      --ds-item-active-border: #bfdbfe;
      --ds-ok: #16a34a;
      --ds-danger: #dc2626;
      --ds-log-bg: #fafafa;
      --ds-log-border: #e4e4e7;
      --ds-shadow: none;
      --ds-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
      --ds-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
      --ds-radius: 8px;
      --ds-radius-sm: 6px;
      --layout-card-gap: 0;
      --chat-max: 768px;
      --sidebar-w: 260px;
    }
    * { box-sizing: border-box; }
    html, body { height: 100%; margin: 0; }
    body {
      font-family: 'PingFang SC', 'Microsoft YaHei', ui-sans-serif, system-ui, -apple-system, sans-serif;
      background: var(--ds-bg);
      color: var(--ds-text);
      line-height: 1.5;
      overflow: hidden;
    }
    a { color: var(--ds-accent); }

    .app {
      display: flex;
      height: 100%;
      min-height: 0;
      background: var(--ds-bg);
    }

    .sidebar {
      width: var(--sidebar-w);
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      background: #f7f7f8;
      border-right: 1px solid var(--ds-border);
      min-width: 0;
      min-height: 0;
    }
    .sidebar-top {
      flex-shrink: 0;
      padding: 12px 12px 8px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .sidebar-top .sidebar-brand-title-row {
      justify-content: flex-start;
      padding: 0;
      width: 100%;
    }
    .sidebar-brand-agent-wrap,
    .agent-switch-wrap {
      position: relative;
      display: flex;
      width: 100%;
    }
    .sidebar-agent-brand {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      min-width: 0;
      padding: 6px 8px;
      margin: 0 0 2px;
      border: none;
      border-radius: 10px;
      background: transparent;
      color: var(--ds-text);
      font-family: inherit;
      cursor: pointer;
      text-align: left;
      transition: background 120ms ease;
    }
    .sidebar-agent-brand:hover {
      background: rgba(0, 0, 0, 0.05);
    }
    .sidebar-agent-name {
      flex: 1;
      min-width: 0;
      font-size: 15px;
      font-weight: 600;
      line-height: 1.35;
      letter-spacing: -0.02em;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--ds-text);
    }
    .sidebar-agent-chevron {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      color: var(--ds-muted);
      transition: transform 150ms ease, color 150ms ease;
    }
    .agent-switch-wrap.open .sidebar-agent-chevron {
      transform: rotate(180deg);
      color: var(--ds-secondary);
    }
    .btn-sidebar-new-chat {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 10px;
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--ds-border);
      border-radius: 999px;
      background: var(--ds-bg);
      color: var(--ds-text);
      font-size: 14px;
      font-weight: 500;
      font-family: inherit;
      cursor: pointer;
      transition: background 120ms ease;
    }
    .btn-sidebar-new-chat:hover {
      background: var(--ds-item-hover);
    }
    .btn-sidebar-new-chat svg {
      flex-shrink: 0;
      color: var(--ds-text);
    }
    .sidebar-sessions-wrap {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0 8px;
    }
    .sidebar-session-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 4px 0 8px;
      scrollbar-width: thin;
    }
    .sidebar-session-item {
      display: flex;
      align-items: center;
      gap: 4px;
      width: 100%;
      border-radius: 10px;
      border: none;
      background: transparent;
      color: var(--ds-text);
      transition: background 120ms ease;
    }
    .sidebar-session-item:hover {
      background: rgba(0, 0, 0, 0.05);
    }
    .sidebar-session-item.active {
      background: var(--ds-bg);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    .sidebar-session-main {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 9px 8px 9px 12px;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
      font-size: 13px;
      font-weight: 400;
      text-align: left;
      cursor: pointer;
      line-height: 1.35;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sidebar-session-title {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sidebar-session-running-badge {
      flex-shrink: 0;
      padding: 1px 6px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 600;
      line-height: 1.4;
      letter-spacing: 0.02em;
      color: #15803d;
      background: rgba(22, 163, 74, 0.12);
    }
    .sidebar-session-item.running .sidebar-session-running-badge {
      animation: sidebar-session-running-pulse 1.4s ease-in-out infinite;
    }
    @keyframes sidebar-session-running-pulse {
      0%,
      100% {
        opacity: 1;
      }
      50% {
        opacity: 0.55;
      }
    }
    .sidebar-session-close {
      flex-shrink: 0;
      width: 28px;
      height: 28px;
      margin-right: 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 6px;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      opacity: 0;
      transition: opacity 120ms ease, background 120ms ease;
    }
    .sidebar-session-item:hover .sidebar-session-close,
    .sidebar-session-item.active .sidebar-session-close {
      opacity: 0.7;
    }
    .sidebar-session-close:hover {
      opacity: 1;
      background: rgba(220, 38, 38, 0.08);
      color: var(--ds-danger);
    }
    .sidebar-session-list .session-tabs-empty {
      padding: 12px;
      font-size: 13px;
      color: var(--ds-muted);
    }
    .sidebar-nav {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 8px;
      border-top: 1px solid var(--ds-border);
    }
    .sidebar-footer {
      flex-shrink: 0;
      padding: 8px 8px 12px;
      border-top: 1px solid var(--ds-border);
    }
    .sidebar-nav-row {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 10px 12px;
      border: none;
      border-radius: 10px;
      background: transparent;
      color: var(--ds-text);
      font-size: 14px;
      font-family: inherit;
      cursor: pointer;
      text-align: left;
      transition: background 120ms ease;
    }
    .sidebar-nav-row:hover {
      background: rgba(0, 0, 0, 0.05);
    }
    .sidebar-nav-row.is-active {
      background: rgba(0, 0, 0, 0.06);
      font-weight: 500;
    }
    .sidebar-nav-row svg {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      color: var(--ds-secondary);
    }
    .sidebar-brand {
      padding: 0;
      flex-shrink: 0;
      border-bottom: none;
    }
    .sidebar-brand-title-row {
      display: flex;
      align-items: center;
      gap: 0;
      justify-content: center;
      min-width: 0;
    }
    /* 浮层挂 body，fixed 定位，避免侧栏 overflow:hidden 裁剪 */
    .agent-switch-dropdown {
      display: none;
      position: fixed;
      z-index: 10050;
      min-width: 168px;
      width: max-content;
      max-width: min(260px, calc(100vw - 24px));
      max-height: min(360px, calc(100vh - 24px));
      overflow: hidden;
      background: var(--ds-bg);
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: 14px;
      box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.05),
        0 16px 40px rgba(15, 23, 42, 0.14);
      flex-direction: column;
    }
    .agent-switch-dropdown.is-open {
      display: flex;
    }
    .agent-switch-dropdown-head {
      flex-shrink: 0;
      padding: 10px 12px 8px;
      font-size: 12px;
      font-weight: 600;
      color: var(--ds-muted);
      letter-spacing: 0.02em;
      border-bottom: 1px solid var(--ds-border);
      background: #fafafa;
      border-radius: 14px 14px 0 0;
    }
    .agent-switch-dropdown-list {
      overflow-y: auto;
      padding: 6px;
      min-height: 0;
    }
    .agent-switch-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      text-align: left;
      padding: 8px 10px;
      border: none;
      border-radius: 10px;
      background: transparent;
      color: var(--ds-text);
      font-size: 13px;
      cursor: pointer;
    }
    .agent-switch-item:hover {
      background: var(--ds-item-hover);
    }
    .agent-switch-item.is-current {
      background: var(--ds-item-active);
      color: var(--ds-accent);
    }
    .agent-switch-item-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 1px;
    }
    .agent-switch-item-name {
      font-weight: 600;
      line-height: 1.25;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .agent-switch-item-id {
      font-size: 11px;
      color: var(--ds-muted);
      line-height: 1.2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .agent-switch-item.is-current .agent-switch-item-id {
      color: var(--ds-accent);
      opacity: 0.85;
    }
    .agent-switch-item-check {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      color: var(--ds-accent);
      opacity: 0;
    }
    .agent-switch-item.is-current .agent-switch-item-check {
      opacity: 1;
    }
    .agent-switch-loading,
    .agent-switch-empty {
      padding: 14px 12px;
      font-size: 13px;
      color: var(--ds-muted);
    }
    .agent-switch-dropdown-foot {
      flex-shrink: 0;
      border-top: 1px solid var(--ds-border);
      padding: 6px;
      background: #fafafa;
      border-radius: 0 0 14px 14px;
    }
    .agent-switch-manage-btn {
      display: flex;
      width: 100%;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: none;
      border-radius: 10px;
      background: transparent;
      color: var(--ds-accent);
      font-size: 13px;
      font-weight: 600;
      padding: 8px 10px;
      cursor: pointer;
    }
    .agent-switch-manage-btn:hover {
      background: var(--ds-item-hover);
    }
    .sidebar-brand-ws {
      margin-top: 0.45rem;
      padding-top: 0.45rem;
      border-top: 1px solid var(--ds-border);
    }
    .sidebar-brand-ws-title {
      font-size: 0.65rem;
      font-weight: 600;
      color: var(--ds-text);
      margin-bottom: 0.35rem;
      letter-spacing: 0.02em;
    }
    .sidebar-brand-ws-label {
      display: block;
      font-size: 0.62rem;
      color: var(--ds-muted);
      margin-bottom: 0.15rem;
    }
    .sidebar-brand-model-input {
      width: 100%;
      box-sizing: border-box;
      margin-bottom: 0.35rem;
    }
    .btn-bind-save--brand {
      margin-top: 0;
      padding: 0.32rem 0.5rem;
      font-size: 0.68rem;
    }
    .sidebar-icon-btn {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 1.85rem;
      height: 1.85rem;
      margin: 0;
      padding: 0;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      transition: color 0.15s ease, background 0.15s ease;
    }
    .sidebar-icon-btn:hover {
      color: var(--ds-accent);
      background: var(--ds-item-hover);
    }
    .sidebar-icon-btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px rgba(79, 109, 245, 0.35);
    }
    .sidebar-icon-btn svg {
      display: block;
    }
    .sidebar-icon-btn .ic {
      font-size: 1.05rem;
      font-weight: 300;
      line-height: 1;
      color: currentColor;
    }
    .btn-primary {
      margin: 0;
      padding: 0.5rem 1rem;
      border-radius: 10px;
      border: none;
      background: var(--ds-accent);
      color: #fff;
      font-weight: 500;
      cursor: pointer;
      font-size: 0.8rem;
    }
    .btn-primary:hover { background: var(--ds-accent-hover); }
    .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
    /* 侧栏抽屉内：分组说明 / meta 行（会话统计、agent.json 区块标题） */
    .sidebar-drawer-meta {
      font-size: 0.7rem;
      color: var(--ds-muted);
      padding: 0 0.35rem 0.45rem;
      line-height: 1.45;
      flex-shrink: 0;
      border-bottom: 1px solid var(--ds-log-border);
      margin-bottom: 0.25rem;
    }
    #sessionList {
      /* 会话列表样式见 .sidebar-session-list */
    }
    .pending-prompts-bar {
      flex-shrink: 0;
      border-bottom: 1px solid var(--ds-border);
      padding: 8px 20px 10px;
      background: var(--ds-log-bg);
      max-width: var(--chat-max);
      margin: 0 auto;
      width: 100%;
    }
    .pending-prompts-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--ds-secondary);
      margin-bottom: 6px;
    }
    .pending-prompts-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 120px;
      overflow-y: auto;
    }
    .pending-prompt-item {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 6px 8px;
      border-radius: 8px;
      border: 1px solid var(--ds-separator);
      background: #fff;
      font-size: 12px;
    }
    .pending-prompt-item--schedule {
      border-color: #fcd34d;
      background: #fffbeb;
    }
    .pending-prompt-item--user {
      border-color: #e0e7ff;
      background: #f5f7ff;
    }
    .pending-prompt-source-tag {
      display: inline-block;
      font-size: 10px;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 4px;
      margin-right: 4px;
      vertical-align: middle;
    }
    .pending-prompt-source-tag--schedule {
      color: #b45309;
      background: #fef3c7;
    }
    .pending-prompt-source-tag--user {
      color: #4338ca;
      background: #e0e7ff;
    }
    .pending-prompt-text {
      flex: 1;
      min-width: 0;
      color: var(--ds-text);
      word-break: break-word;
      line-height: 1.4;
    }
    .pending-prompt-preview {
      margin-top: 4px;
      line-height: 1.4;
    }
    .pending-prompt-meta {
      font-size: 10px;
      color: var(--ds-muted);
      margin-top: 2px;
    }
    .pending-prompts-bar--has-schedule {
      background: #fffbeb;
      border-bottom-color: #fcd34d;
    }
    .pending-prompts-bar--has-schedule .pending-prompts-title {
      color: #b45309;
    }
    .pending-prompt-cancel {
      flex-shrink: 0;
      border: none;
      background: transparent;
      color: var(--ds-danger);
      cursor: pointer;
      font-size: 11px;
      padding: 2px 4px;
    }
    .pending-prompts-empty {
      font-size: 12px;
      color: var(--ds-muted);
    }
    .session-group-label {
      font-size: 0.7rem;
      font-weight: 500;
      color: var(--ds-muted);
      padding: 0.45rem 0.35rem 0.3rem;
    }
    /* 会话行 / 工具·Skill·MCP 绑定行 共用 */
    .sidebar-drawer-item {
      display: flex;
      align-items: stretch;
      border-radius: var(--ds-radius-sm);
      margin: 4px 0;
      position: relative;
      border: 1px solid transparent;
      transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    }
    .sidebar-drawer-item:hover {
      background: var(--ds-item-hover);
    }
    .sidebar-drawer-list {
      display: flex;
      flex-direction: column;
      padding: 0.05rem 0 0.2rem;
    }
    .sidebar-drawer-item-label {
      flex: 1;
      min-width: 0;
      padding: 0.55rem 0.35rem 0.55rem 0.65rem;
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--ds-text);
      font-family: ui-monospace, monospace;
      word-break: break-word;
      display: flex;
      align-items: center;
    }
    .sidebar-drawer-empty {
      font-size: 0.7rem;
      color: var(--ds-muted);
      padding: 0.5rem 0.5rem 0.45rem;
      line-height: 1.45;
    }
    .session-item.active {
      background: var(--ds-item-active);
      border-color: #b8cff9;
      box-shadow: var(--ds-shadow);
    }
    .session-item-main {
      flex: 1;
      min-width: 0;
      padding: 0.55rem 0.25rem 0.55rem 0.65rem;
      cursor: pointer;
      text-align: left;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
    }
    .session-item-title {
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--ds-text);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
    }
    .session-item-sub {
      font-size: 0.68rem;
      color: var(--ds-muted);
      margin-top: 0.2rem;
      font-family: ui-monospace, monospace;
    }
    .session-menu-wrap {
      position: relative;
      flex-shrink: 0;
      display: flex;
      align-items: flex-start;
      padding: 0.4rem 0.35rem 0 0;
    }
    .session-menu-btn {
      width: 1.85rem;
      height: 1.85rem;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      font-size: 0.85rem;
      line-height: 1;
      letter-spacing: 0.06em;
      padding: 0;
      opacity: 0.65;
    }
    .sidebar-drawer-item:hover .session-menu-btn,
    .session-item.active .session-menu-btn,
    .session-menu-btn:focus-visible,
    .session-menu-wrap.open .session-menu-btn {
      opacity: 1;
      color: var(--ds-text);
      background: rgba(255, 255, 255, 0.9);
    }
    .session-dropdown {
      display: none;
      position: absolute;
      right: 0.15rem;
      top: 2rem;
      min-width: 9.5rem;
      z-index: 80;
      background: var(--ds-bg);
      border: 1px solid var(--ds-border);
      border-radius: 10px;
      box-shadow: var(--ds-shadow-lg);
      padding: 0.3rem 0;
    }
    .session-menu-wrap.open .session-dropdown { display: block; }
    .session-dropdown button {
      display: block;
      width: 100%;
      text-align: left;
      padding: 0.5rem 0.85rem;
      border: none;
      background: transparent;
      color: var(--ds-text);
      font-size: 0.8125rem;
      cursor: pointer;
    }
    .session-dropdown button:hover { background: var(--ds-item-hover); }
    .session-dropdown button.danger { color: var(--ds-danger); }

    .sidebar-drawers {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
      overflow-y: auto;
      scrollbar-width: thin;
    }
    .sidebar-icon-rail {
      align-items: center;
      gap: 8px;
      padding: 10px 0 12px;
      overflow-x: hidden;
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      scrollbar-width: thin;
    }
    .sidebar-nav-item {
      width: 34px;
      height: 34px;
      flex-shrink: 0;
      border: none;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      color: #777a80;
      cursor: pointer;
      transition: background 120ms ease, color 120ms ease;
    }
    .sidebar-nav-item:hover {
      background: rgba(120, 120, 128, 0.12);
      color: #4f535b;
    }
    .sidebar-nav-item:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
    }
    .sidebar-nav-item svg {
      width: 18px;
      height: 18px;
      display: block;
    }
    .schedule-manage-prompt {
      max-width: 220px;
      word-break: break-word;
      white-space: pre-wrap;
    }
    .schedule-manage-session-link {
      color: var(--ds-accent);
      cursor: pointer;
      text-decoration: underline;
      background: none;
      border: none;
      padding: 0;
      font: inherit;
    }
    .schedule-create-form {
      display: grid;
      gap: 0.55rem;
      margin-top: 0.75rem;
      padding: 0.75rem;
      border: 1px dashed var(--ds-border);
      border-radius: var(--ds-radius-sm);
      background: #fafbfc;
    }
    .schedule-create-form[hidden] {
      display: none !important;
    }
    .schedule-create-row {
      display: grid;
      gap: 0.25rem;
    }
    .schedule-create-row label {
      font-size: 0.75rem;
      color: var(--ds-text-soft);
    }
    .schedule-create-row input,
    .schedule-create-row select,
    .schedule-create-row textarea {
      width: 100%;
      box-sizing: border-box;
      border: 1px solid var(--ds-border);
      border-radius: 6px;
      padding: 0.4rem 0.5rem;
      font: inherit;
      background: #fff;
    }
    .schedule-create-row textarea {
      min-height: 72px;
      resize: vertical;
    }
    .schedule-create-actions {
      display: flex;
      gap: 0.5rem;
      justify-content: flex-end;
      margin-top: 0.25rem;
    }
    .schedule-run-status--pending {
      color: var(--ds-text-soft);
    }
    .schedule-run-status--running {
      color: var(--ds-accent);
    }
    .schedule-run-status--succeeded {
      color: #0d7a3a;
    }
    .schedule-run-status--failed {
      color: #c0392b;
    }
    .schedule-runs-result-pre {
      margin-top: 0.75rem;
      padding: 0.65rem;
      max-height: 200px;
      overflow: auto;
      border: 1px solid var(--ds-border);
      border-radius: var(--ds-radius-sm);
      background: #f8fafc;
      font-size: 0.75rem;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .schedule-runs-result-pre[hidden] {
      display: none !important;
    }
    /* 侧栏图标悬浮说明（fixed，避免被 sidebar overflow 裁切） */
    .sidebar-hover-tip {
      position: fixed;
      z-index: 99990;
      max-width: min(280px, 46vw);
      padding: 8px 11px;
      border-radius: 10px;
      font-size: 13px;
      line-height: 1.45;
      color: var(--ds-text);
      background: #ffffff;
      border: 1px solid var(--ds-separator);
      box-shadow: var(--ds-shadow-md);
      pointer-events: none;
      word-break: break-word;
    }
    .sidebar-nav-env {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.04em;
    }
    details.sidebar-drawer {
      border-bottom: 1px solid var(--ds-border);
      flex: 0 0 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      position: relative;
      z-index: 0;
      background: var(--ds-sidebar);
    }
    details.sidebar-drawer[open] {
      z-index: 1;
    }
    details.sidebar-drawer > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      padding: 0.55rem 0.75rem;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--ds-text);
      background: #eef0f4;
      position: relative;
    }
    details.sidebar-drawer > summary::-webkit-details-marker {
      display: none;
    }
    details.sidebar-drawer > summary:hover {
      background: #e4e8ef;
    }
    .drawer-summary-title {
      letter-spacing: -0.01em;
    }
    .drawer-chevron {
      font-size: 0.55rem;
      color: var(--ds-muted);
      transition: transform 0.2s ease;
      flex-shrink: 0;
    }
    details.sidebar-drawer:not([open]) > summary .drawer-chevron {
      transform: rotate(-90deg);
    }
    details.sidebar-drawer .sidebar-drawer-body {
      padding: 0 0.65rem 0.65rem;
      overflow: auto;
      max-height: min(34vh, 280px);
    }
    /* 工具 / Skill / MCP：body 不裁剪 absolute/fixed 下拉，滚动交给列表区 */
    details.sidebar-drawer .sidebar-drawer-body.sidebar-drawer-body--tools,
    details.sidebar-drawer .sidebar-drawer-body.sidebar-drawer-body--skills,
    details.sidebar-drawer .sidebar-drawer-body.sidebar-drawer-body--mcp,
    details.sidebar-drawer .sidebar-drawer-body.sidebar-drawer-body--agent-teams {
      overflow: visible;
      max-height: none;
    }
    .drawer-bind-block--solo .sidebar-drawer-list.agent-bind-chips {
      max-height: min(28vh, 220px);
      overflow-x: hidden;
      overflow-y: auto;
      min-height: 0;
    }
    .sidebar-drawer-body--sessions {
      display: flex;
      flex-direction: column;
      max-height: min(40vh, 360px);
      overflow: hidden;
      padding-bottom: 0.5rem;
    }
    .session-summary-actions {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      flex-shrink: 0;
    }
    .sidebar-drawer-body--tools {
      display: flex;
      flex-direction: column;
    }
    .sidebar-drawer-body--skills {
      display: flex;
      flex-direction: column;
    }
    .sidebar-drawer-body--mcp {
      display: flex;
      flex-direction: column;
    }
    .sidebar-drawer-body--agent-teams {
      display: flex;
      flex-direction: column;
    }
    .agent-md-modal {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 1rem;
      box-sizing: border-box;
    }
    .agent-md-modal.is-open {
      display: flex;
    }
    .agent-md-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
    }
    .agent-md-modal-card {
      position: relative;
      width: min(920px, 100%);
      height: min(82vh, 760px);
      max-height: min(82vh, 760px);
      display: flex;
      flex-direction: column;
      background: var(--ds-bg);
      border-radius: var(--ds-radius);
      box-shadow: var(--ds-shadow-lg);
      border: 1px solid var(--ds-border);
      overflow: hidden;
    }
    .agent-md-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.85rem 1rem;
      border-bottom: 1px solid var(--ds-border);
      flex-shrink: 0;
    }
    .agent-md-modal-head h2 {
      margin: 0;
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--ds-text);
    }
    /* 设置主视图（布局对齐文件管理页） */
    .agent-settings-view {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
    }
    .agent-settings-view[hidden] {
      display: none !important;
    }
    .agent-settings-layout {
      flex: 1;
      min-height: 0;
      display: flex;
      gap: 0;
      overflow: hidden;
    }
    .agent-settings-nav {
      flex-shrink: 0;
      width: 220px;
      display: flex;
      flex-direction: column;
      border: none;
      border-radius: 0;
      border-right: 1px solid var(--ds-border);
      overflow: hidden;
      background: var(--ds-bg);
    }
    .agent-settings-nav-title {
      flex-shrink: 0;
      padding: 10px 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--ds-muted);
      border-bottom: 1px solid var(--ds-border);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .agent-settings-nav-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 6px 0;
      display: flex;
      flex-direction: column;
    }
    .agent-settings-nav-item {
      display: flex;
      align-items: center;
      width: 100%;
      padding: 8px 12px;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
      font-size: 13px;
      text-align: left;
      cursor: pointer;
      user-select: none;
    }
    .agent-settings-nav-item:hover {
      background: var(--ds-item-hover);
    }
    .agent-settings-nav-item.is-selected {
      background: rgba(10, 132, 255, 0.1);
      color: var(--ds-accent);
      font-weight: 600;
    }
    .agent-settings-content {
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--ds-bg);
    }
    .agent-settings-panels {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .agent-settings-head {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--ds-border);
      background: var(--ds-bg);
    }
    .agent-settings-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .agent-settings-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 0;
      background: var(--ds-bg);
    }
    .agent-settings-scroll[hidden] {
      display: none !important;
    }
    .agent-settings-md-panel {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      padding: 14px 20px;
    }
    .agent-settings-md-editor {
      flex: 1;
      min-height: min(60vh, 520px);
      border: 1px solid var(--ds-separator);
      border-radius: 10px;
      background: #ffffff;
    }
    .btn-agent-settings-cancel {
      padding: 6px 14px;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-bg);
      color: inherit;
      font: inherit;
      font-size: 13px;
      cursor: pointer;
    }
    .btn-agent-settings-cancel:hover {
      background: var(--ds-item-hover);
    }
    .settings-unified-panel {
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .settings-section {
      padding: 14px 20px;
      border: none;
      border-radius: 0;
      border-bottom: 1px solid var(--ds-border, #e5e5ea);
      background: var(--ds-bg);
    }
    .settings-section:last-child {
      border-bottom: none;
    }
    .settings-section-title {
      margin: 0 0 0.65rem;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--ds-text);
    }
    .settings-fields {
      display: grid;
      gap: 0.55rem;
    }
    .settings-field {
      display: grid;
      gap: 0.3rem;
    }
    .settings-field-label {
      font-size: 0.78rem;
      color: var(--ds-text-soft);
      line-height: 1.35;
    }
    .settings-textarea {
      min-height: 110px;
    }
    .settings-textarea--compact {
      min-height: 80px;
    }
    .settings-env-list {
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .settings-env-list .agent-env-fixed-section {
      margin-bottom: 0;
      padding-left: 0;
      padding-right: 0;
      border: none;
      border-radius: 0;
      border-bottom: 1px solid var(--ds-border, #e5e5ea);
      background: transparent;
    }
    .settings-env-list .agent-env-fixed-section:last-child {
      border-bottom: none;
    }
    .agent-md-panel-hint {
      margin: 0;
      font-size: 0.75rem;
      color: var(--ds-text-soft);
    }
    .llm-providers-block {
      display: grid;
      gap: 0.75rem;
    }
    .llm-providers-empty {
      margin: 0;
      font-size: 0.74rem;
      color: var(--ds-text-soft);
      line-height: 1.45;
    }
    .llm-provider-form {
      display: grid;
      gap: 0.55rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--ds-border, #e5e5ea);
    }
    .llm-provider-form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.55rem;
    }
    .llm-provider-form-field--full {
      grid-column: 1 / -1;
    }
    .llm-provider-form-actions {
      display: flex;
      justify-content: flex-end;
    }
    .llm-provider-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
    }
    .llm-provider-list-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.55rem 0;
      border-bottom: 1px solid var(--ds-border, #e5e5ea);
      font-size: 0.84rem;
    }
    .llm-provider-list-item:last-child {
      border-bottom: none;
    }
    .llm-provider-list-body {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
      min-width: 0;
    }
    .llm-provider-list-name {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      min-width: 0;
      color: var(--ds-text);
    }
    .llm-provider-list-meta {
      font-size: 0.76rem;
      color: var(--ds-text-muted, #8e8e93);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .llm-provider-list-default {
      flex-shrink: 0;
      font-size: 0.7rem;
      color: var(--ds-accent);
      background: rgba(10, 132, 255, 0.1);
      padding: 0.1rem 0.4rem;
      border-radius: 4px;
    }
    .llm-provider-list-actions {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      flex-shrink: 0;
    }
    .llm-provider-list-set-default {
      border: none;
      background: transparent;
      color: var(--ds-accent);
      cursor: pointer;
      font-size: 0.76rem;
      padding: 0.15rem 0.35rem;
      border-radius: 4px;
    }
    .llm-provider-list-set-default:hover {
      background: rgba(10, 132, 255, 0.08);
    }
    .llm-provider-list-remove {
      flex-shrink: 0;
      border: none;
      background: transparent;
      color: var(--ds-danger, #ff3b30);
      cursor: pointer;
      font-size: 0.76rem;
      padding: 0.15rem 0.35rem;
      border-radius: 4px;
    }
    .llm-provider-list-remove:hover {
      background: rgba(255, 59, 48, 0.08);
    }
    @media (max-width: 720px) {
      .llm-provider-form-grid {
        grid-template-columns: 1fr;
      }
    }
    .agent-md-modal-close {
      border: none;
      background: transparent;
      color: var(--ds-muted);
      font-size: 1.35rem;
      line-height: 1;
      cursor: pointer;
      padding: 0.15rem 0.35rem;
      border-radius: 6px;
    }
    .agent-md-modal-close:hover {
      color: var(--ds-text);
      background: var(--ds-item-hover);
    }
    .agent-md-modal-icon-btn {
      border: none;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      padding: 0.15rem 0.35rem;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .agent-md-modal-icon-btn:hover {
      color: var(--ds-text);
      background: var(--ds-item-hover);
    }
    .agent-md-modal-icon-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .agent-md-modal-icon-btn svg {
      width: 16px;
      height: 16px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .agent-md-editor {
      display: block;
      width: 100%;
      max-width: 100%;
      flex: 1;
      min-height: min(50vh, 420px);
      margin: 0;
      padding: 0.85rem 1rem;
      border: none;
      resize: vertical;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.8rem;
      line-height: 1.5;
      color: var(--ds-text);
      background: var(--ds-log-bg);
      box-sizing: border-box;
    }
    .agent-md-editor:focus {
      outline: none;
      box-shadow: inset 0 0 0 2px rgba(79, 109, 245, 0.2);
    }
    /* whentouse 仅需约三行高度，覆盖 agent-md-editor 的大块编辑区样式 */
    .agent-md-editor.settings-textarea--whentouse {
      flex: none;
      min-height: calc(3 * 1.5em + 1.7rem);
      height: auto;
      resize: vertical;
    }
    .agent-md-modal-foot {
      display: flex;
      justify-content: flex-end;
      gap: 0.5rem;
      padding: 0.75rem 1rem;
      border-top: 1px solid var(--ds-border);
      flex-shrink: 0;
      background: var(--ds-sidebar);
    }
    .agent-md-modal-card .agent-md-modal-head {
      background: #f7f7fa;
      border-bottom-color: #d9d9e3;
    }
    .agent-md-modal-card .agent-md-modal-foot {
      background: #f7f7fa;
      border-top-color: #d9d9e3;
      margin-top: auto;
    }
    .agent-md-modal-card .agent-picker-scroll,
    .agent-md-modal-card .tool-files-body {
      flex: 1;
      min-height: 0;
      max-height: none;
      overflow: auto;
      padding: 0.9rem 1rem 1rem;
      background: #f2f2f7;
    }
    .agent-md-modal-card > .agent-md-editor {
      flex: 1;
      min-height: 0;
      margin: 0.9rem 1rem 1rem;
      border: 1px solid #d9d9e3;
      border-radius: 12px;
      background: #ffffff;
      padding: 0.85rem 0.95rem;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
      resize: none;
    }
    /* 四个业务弹窗统一外观：设置、tool-results、MCP 管理、Skill 管理 */
    .agent-md-modal-card.modal-unified {
      width: min(940px, 100%);
      border-radius: 14px;
      border: 1px solid var(--ds-separator);
      box-shadow: var(--ds-shadow-lg);
    }
    .agent-md-modal-card.modal-unified .agent-md-modal-head {
      min-height: 50px;
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--ds-separator);
      background: var(--ds-bg);
    }
    .agent-md-modal-card.modal-unified .tool-files-body {
      flex: 1;
      min-height: 0;
      overflow: auto;
      padding: 0.9rem 1rem 1rem;
      background: #f2f2f7;
    }
    .agent-md-modal-card.modal-unified .agent-md-modal-foot {
      padding: 0.7rem 1rem 0.85rem;
      border-top: 1px solid var(--ds-separator);
      background: #f7f7fa;
    }
    .agent-md-modal-card.modal-unified .tool-files-meta {
      color: #8b8b95;
    }
    .agent-md-modal-card.modal-unified .tool-files-list {
      gap: 0.6rem;
    }
    .agent-md-modal-card.modal-unified .tool-files-item {
      border-radius: 12px;
      border: 1px solid #d9d9e3;
      background: #ffffff;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }
    .agent-md-modal-card.modal-unified .tool-files-download {
      border-color: #d4d4dd;
      background: #ffffff;
    }
    .agent-md-modal-card.modal-unified .tool-files-download:hover {
      border-color: #bfc5ff;
      background: #eef2ff;
    }
    @media (max-height: 780px) {
      .agent-md-modal-card {
        height: min(88vh, 760px);
        max-height: min(88vh, 760px);
      }
    }
    .modal-head-actions {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
    }
    .modal-head-actions.modal-head-actions--close-only {
      gap: 0;
    }
    .modal-body-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.65rem;
    }
    .btn-agent-md-cancel {
      padding: 0.45rem 0.9rem;
      border-radius: 8px;
      border: 1px solid var(--ds-border);
      background: var(--ds-bg);
      color: var(--ds-text);
      font-size: 0.8rem;
      cursor: pointer;
    }
    .btn-agent-md-cancel:hover {
      background: var(--ds-item-hover);
    }
    .btn-permission-deny {
      padding: 0.5rem 1.25rem;
      border-radius: 8px;
      border: 1px solid #c0392b;
      background: rgba(192, 57, 43, 0.15);
      color: #e74c3c;
      font-size: 0.85rem;
      cursor: pointer;
    }
    .btn-permission-deny:hover {
      background: rgba(192, 57, 43, 0.3);
    }
    .btn-permission-allow {
      padding: 0.5rem 1.25rem;
      border-radius: 8px;
      border: 1px solid #27ae60;
      background: rgba(39, 174, 96, 0.15);
      color: #2ecc71;
      font-size: 0.85rem;
      cursor: pointer;
    }
    .btn-permission-allow:hover {
      background: rgba(39, 174, 96, 0.3);
    }
    .agent-env-kv-row {
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
    }
    .agent-env-fixed-section {
      margin-bottom: 0.9rem;
      padding: 0.65rem;
      border: 1px solid var(--ds-separator);
      border-radius: 10px;
      background: var(--ds-bg-subtle);
    }
    .agent-env-fixed-section-title {
      margin: 0 0 0.55rem;
      font-size: 0.82rem;
      color: var(--ds-text-soft);
    }
    .agent-env-fixed-row {
      display: grid;
      grid-template-columns: minmax(170px, 0.9fr) 1.8fr;
      gap: 0.5rem;
      margin-bottom: 0.45rem;
      align-items: center;
    }
    .agent-env-fixed-row:last-child {
      margin-bottom: 0;
    }
    .agent-env-fixed-row--whentouse {
      align-items: start;
    }
    .agent-env-fixed-row--whentouse .agent-env-kv-input {
      min-height: 0;
    }
    .agent-env-fixed-label {
      color: var(--ds-text-soft);
      font-size: 0.78rem;
      line-height: 1.35;
      word-break: break-all;
    }
    .agent-env-kv-input {
      width: 100%;
      box-sizing: border-box;
      border: 1px solid var(--ds-separator);
      border-radius: 10px;
      padding: 0.52rem 0.65rem;
      background: #ffffff;
      color: var(--ds-text);
      font: inherit;
      font-size: 0.86rem;
      line-height: 1.35;
    }
    .agent-env-kv-input::placeholder {
      color: var(--ds-muted);
    }
    .agent-env-kv-input:focus {
      outline: none;
      border-color: var(--ds-accent);
      box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16);
    }
    .main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      min-height: 0;
      background: var(--ds-bg);
    }
    .main-header[hidden] {
      display: none !important;
    }
    .main-header {
      flex-shrink: 0;
      padding: 1rem clamp(1rem, 3vw, 1.75rem) 1rem;
      border-bottom: 1px solid var(--ds-border);
      background: var(--ds-bg);
    }
    .main-header-top {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      gap: 0.5rem 0.75rem;
    }
    .main-header-trailing {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .system-settings {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.28rem 0.42rem;
      border-radius: 10px;
      border: 1px solid var(--ds-border);
      background: var(--ds-main-tint);
    }
    .system-settings-label {
      font-size: 0.68rem;
      color: var(--ds-muted);
      white-space: nowrap;
    }
    .btn-system-settings {
      border: 1px solid var(--ds-border);
      background: var(--ds-bg);
      color: var(--ds-text);
      border-radius: 8px;
      padding: 0.3rem 0.55rem;
      font-size: 0.72rem;
      cursor: pointer;
      white-space: nowrap;
    }
    .btn-system-settings:hover {
      background: var(--ds-item-hover);
    }
    .main-header h1 {
      font-size: 1.2rem;
      font-weight: 650;
      margin: 0;
      line-height: 1.3;
      color: var(--ds-text);
      letter-spacing: -0.02em;
    }
    .main-header .mode-pill {
      display: inline-flex;
      align-items: center;
      font-size: 0.7rem;
      font-weight: 500;
      color: var(--ds-muted);
      padding: 0.2rem 0.55rem;
      border-radius: 999px;
      background: var(--ds-main-tint);
      border: 1px solid var(--ds-border);
    }
    .main-header .sub {
      font-size: 0.7rem;
      color: var(--ds-muted);
      margin-top: 0.5rem;
      word-break: break-all;
      font-family: ui-monospace, monospace;
      padding: 0.35rem 0.55rem;
      border-radius: var(--ds-radius-sm);
      background: var(--ds-log-bg);
      border: 1px solid var(--ds-log-border);
      max-width: 100%;
    }
    .main-header .sub:empty {
      display: none;
    }
    .main-scroll {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
    }
    .main-body {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      width: 100%;
    }
    .chat-thread {
      flex: 1 1 0;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 20px 24px 28px;
      width: 100%;
      position: relative;
    }
    .chat-thread > *:not(.chat-loading) {
      max-width: var(--chat-max);
      width: 100%;
      margin-left: auto;
      margin-right: auto;
      box-sizing: border-box;
    }
    .chat-loading {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      background: rgba(255, 255, 255, 0.72);
      z-index: 3;
    }
    .chat-loading[hidden] {
      display: none !important;
    }
    .chat-loading-inner {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 10px;
      border: 1px solid var(--ds-separator);
      background: var(--ds-bg);
      color: var(--ds-secondary);
      font-size: 12px;
      box-shadow: var(--ds-shadow);
    }
    .chat-loading-spinner {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      border: 2px solid rgba(142, 142, 147, 0.28);
      border-top-color: var(--ds-accent);
      animation: ws-ready-spin 0.75s linear infinite;
      flex-shrink: 0;
    }
    .chat-placeholder {
      font-size: 14px;
      color: var(--ds-muted);
      text-align: center;
      padding: 48px 16px;
    }
    .chat-msg {
      max-width: 100%;
      margin: 0 0 16px;
      padding: 0;
      border-radius: 0;
      line-height: 1.65;
      font-size: 15px;
      border: none;
      box-shadow: none;
    }
    .chat-msg-user {
      align-self: flex-end;
      max-width: 75%;
      margin-left: auto;
      padding: 10px 14px;
      border-radius: 18px;
      background: #f4f4f5;
      color: var(--ds-text);
      font-size: 15px;
    }
    /* 定时任务触发的整轮会话消息（用户/助手/工具） */
    .chat-msg-scheduled-turn {
      border-left: 3px solid #d97706;
    }
    .chat-msg-user.chat-msg-scheduled-turn {
      background: #fef9c3;
    }
    /* channel 入站（<channel> 包裹）用户消息 */
    .chat-msg-user.chat-msg-channel-inbound {
      border: 1px solid rgba(37, 99, 235, 0.22);
      background: #eff6ff;
    }
    .chat-msg-assistant.chat-msg-scheduled-turn,
    .chat-msg-system.chat-msg-scheduled-turn {
      border-left-color: #ca8a04;
    }
    .chat-run-group--scheduled {
      border: 1px solid var(--ds-border);
      border-radius: var(--ds-radius-sm);
      padding: 8px 10px 10px;
      background: var(--ds-log-bg);
    }
    .chat-run-group--scheduled > .chat-msg-label:first-child {
      color: #b45309;
    }
    .chat-scheduled-badge {
      display: inline-block;
      font-size: 0.7rem;
      font-weight: 600;
      color: #b45309;
      background: #fef3c7;
      border: 1px solid #fcd34d;
      border-radius: 4px;
      padding: 0 6px;
      margin-right: 6px;
      vertical-align: middle;
    }
    .chat-user-body {
      white-space: pre-wrap;
      word-break: break-word;
    }
    .chat-command-name {
      display: inline-block;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.82rem;
      font-weight: 600;
      color: #1d4ed8;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      border-radius: 6px;
      padding: 0.2rem 0.55rem;
      line-height: 1.35;
    }
    .chat-local-command-stdout {
      display: block;
      margin: 0.4rem 0 0;
      padding: 0.6rem 0.75rem;
      border-radius: 8px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.78rem;
      line-height: 1.5;
      white-space: pre-wrap;
      word-break: break-all;
      color: #0f172a;
      overflow-x: auto;
    }
    .chat-local-command-stderr {
      display: block;
      margin: 0.4rem 0 0;
      padding: 0.6rem 0.75rem;
      border-radius: 8px;
      background: #fef2f2;
      border: 1px solid #fecaca;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.78rem;
      line-height: 1.5;
      white-space: pre-wrap;
      word-break: break-word;
      color: #991b1b;
    }
    .chat-slash-xml-rest {
      display: block;
      margin-top: 0.25rem;
      font-size: 0.72rem;
      color: var(--ds-muted);
      white-space: pre-wrap;
      word-break: break-word;
    }
    .chat-user-body.is-collapsed {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      line-clamp: 2;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }
    .chat-user-toggle {
      margin-top: 0.4rem;
      padding: 0;
      border: none;
      background: transparent;
      color: var(--ds-accent);
      font-size: 0.76rem;
      line-height: 1.3;
      cursor: pointer;
    }
    .chat-user-toggle:hover {
      text-decoration: underline;
    }
    .chat-msg-assistant {
      background: transparent;
      border: none;
      box-shadow: none;
      padding: 0;
      margin-bottom: 20px;
      max-width: 100%;
    }
    .chat-msg-system {
      background: transparent;
      border: none;
      border-left: none;
      padding: 4px 0;
      margin-bottom: 8px;
      color: var(--ds-muted);
      font-size: 12px;
    }
    .chat-msg-system .chat-user-body {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 12px;
      line-height: 1.5;
      color: #a1a1aa;
    }
    .chat-run-group {
      margin-bottom: 4px;
    }
    .chat-msg-label {
      display: none;
    }
    .chat-msg-system .chat-msg-label,
    .chat-run-group--scheduled > .chat-msg-label:first-child,
    .chat-run-summary-card .chat-msg-label {
      display: block;
      font-size: 11px;
      font-weight: 500;
      text-transform: none;
      letter-spacing: 0;
      color: var(--ds-muted);
      margin-bottom: 6px;
    }
    /* 工具调用：单行折叠 */
    .chat-tool-row {
      margin: 0 0 6px;
      border: none;
      border-radius: 6px;
      background: #f4f4f5;
      overflow: hidden;
    }
    .chat-tool-row[open] {
      background: #f0f0f2;
    }
    .chat-tool-row--scheduled {
      border-left: 3px solid #d97706;
      padding-left: 8px;
    }
    .chat-tool-row-summary {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 7px 12px;
      cursor: pointer;
      list-style: none;
      font-size: 13px;
      line-height: 1.4;
    }
    .chat-tool-row-summary::-webkit-details-marker {
      display: none;
    }
    .chat-tool-row-summary::before {
      content: '';
      flex-shrink: 0;
      width: 14px;
      height: 14px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: center;
      background-size: 14px;
      transition: transform 120ms ease;
    }
    .chat-tool-row[open] > .chat-tool-row-summary::before {
      transform: rotate(90deg);
    }
    .chat-tool-name {
      font-weight: 500;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      flex-shrink: 0;
      max-width: 24%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--ds-muted);
      font-size: 12px;
    }
    .chat-tool-summary {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--ds-text);
      font-size: 13px;
    }
    .chat-tool-status {
      flex-shrink: 0;
      font-size: 11px;
      font-weight: 500;
      padding: 2px 8px;
      border-radius: 999px;
      line-height: 1.3;
    }
    .chat-tool-status.is-running {
      color: #1d4ed8;
      background: #dbeafe;
    }
    .chat-tool-status.is-ok {
      color: #15803d;
      background: #dcfce7;
    }
    .chat-tool-status.is-err {
      color: #b91c1c;
      background: #fee2e2;
    }
    .chat-tool-detail {
      padding: 4px 12px 10px 36px;
      border-top: 1px solid rgba(0, 0, 0, 0.05);
    }
    .chat-tool-pre {
      margin: 0 0 0.35rem;
      padding: 0.5rem 0.65rem;
      border-radius: 6px;
      background: #f8fafc;
      border: 1px solid var(--ds-separator);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.75rem;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
      max-height: 240px;
      overflow: auto;
      color: var(--ds-text);
    }
    .chat-tool-pre-label {
      font-size: 11px;
      font-weight: 500;
      color: var(--ds-muted);
      margin: 6px 0 4px;
      text-transform: none;
      letter-spacing: 0;
    }
    .chat-run-summary-card {
      position: relative;
      padding: 10px 12px;
      cursor: pointer;
      border: 1px solid var(--ds-border);
      border-radius: var(--ds-radius-sm);
      background: var(--ds-log-bg);
      margin-bottom: 8px;
    }
    .chat-run-summary-card--scheduled {
      border-left: 3px solid #ca8a04;
    }
    .chat-run-summary-card::after {
      content: '详情';
      position: absolute;
      right: 10px;
      top: 10px;
      color: var(--ds-accent);
      font-size: 12px;
    }
    .chat-run-summary-preview {
      margin-top: 0.25rem;
      color: var(--ds-secondary);
      font-size: 0.8rem;
      white-space: pre-wrap;
      word-break: break-word;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      line-clamp: 5;
      -webkit-line-clamp: 5;
      overflow: hidden;
    }
    .run-group-modal-body {
      flex: 1;
      min-height: 0;
      overflow: hidden;
      padding: 0;
      background: transparent;
    }
    .run-group-modal-chat-thread {
      height: 100%;
      max-height: min(70vh, 760px);
      overflow-y: auto;
      padding: 0 18px 16px;
    }
    .chat-md {
      color: var(--ds-text);
      font-size: 15px;
    }
    .chat-md :first-child {
      margin-top: 0;
    }
    .chat-md :last-child {
      margin-bottom: 0;
    }
    .chat-md h1,
    .chat-md h2,
    .chat-md h3,
    .chat-md h4 {
      margin: 1em 0 0.4em;
      font-weight: 600;
      line-height: 1.35;
      font-size: 14px;
      color: var(--ds-text);
    }
    .chat-md h1:first-child,
    .chat-md h2:first-child,
    .chat-md h3:first-child,
    .chat-md h4:first-child {
      margin-top: 0;
    }
    .chat-md p {
      margin: 0.45em 0;
    }
    .chat-md ul,
    .chat-md ol {
      margin: 0.4em 0;
      padding-left: 1.25rem;
    }
    .chat-md li {
      margin: 0.15em 0;
    }
    .chat-md li::marker {
      color: var(--ds-muted);
    }
    .chat-md hr {
      border: none;
      border-top: 1px solid var(--ds-border);
      margin: 14px 0;
    }
    .chat-md strong {
      font-weight: 600;
      color: var(--ds-text);
    }
    .chat-md pre {
      margin: 0.65em 0;
      padding: 0.65rem 0.75rem;
      border-radius: 6px;
      background: #f4f4f5;
      color: var(--ds-text);
      border: 1px solid var(--ds-border);
      overflow-x: auto;
      font-size: 13px;
    }
    .chat-md code {
      font-family: ui-monospace, monospace;
      font-size: 0.9em;
      padding: 0.1em 0.35em;
      border-radius: 4px;
      background: #f4f4f5;
      color: var(--ds-secondary);
    }
    .chat-md pre code {
      padding: 0;
      background: transparent;
      color: inherit;
      font-size: inherit;
    }
    .chat-md blockquote {
      margin: 10px 0;
      padding: 10px 12px;
      border-left: 3px solid var(--ds-accent);
      border-radius: 0 6px 6px 0;
      background: var(--ds-log-bg);
      color: var(--ds-secondary);
      font-size: 13px;
    }
    .chat-md blockquote p {
      margin: 0.2em 0;
    }
    .pdf-export-download-wrap {
      margin: 0.35rem 0 0.75rem;
    }
    .pdf-export-download-btn {
      display: inline-block;
      padding: 0.35rem 0.75rem;
      border-radius: 6px;
      font-size: 0.82rem;
      font-weight: 600;
      text-decoration: none;
      color: #fff;
      background: var(--ds-accent, #2563eb);
    }
    .pdf-export-download-btn:hover {
      filter: brightness(1.08);
    }
    .chat-streaming {
      opacity: 0.88;
    }
    .chat-streaming .stream-pulse {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--ds-accent);
      margin-left: 0.35rem;
      vertical-align: middle;
      animation: streamDot 1s ease-in-out infinite;
    }
    @keyframes streamDot {
      0%,
      100% {
        opacity: 0.35;
      }
      50% {
        opacity: 1;
      }
    }
    label.f {
      display: block;
      font-size: 0.72rem;
      color: var(--ds-muted);
      margin-bottom: 0.2rem;
    }
    .ws-config-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .composer {
      flex-shrink: 0;
      padding: 0;
      background: var(--ds-bg);
    }
    .composer-inner {
      width: 100%;
      margin: 0 auto;
      padding: 12px 24px 16px;
      max-width: calc(var(--chat-max) + 48px);
    }
    .composer-card {
      border: 1px solid var(--ds-border);
      border-radius: var(--ds-radius);
      background: var(--ds-bg);
      box-shadow: none;
      padding: 10px 12px;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }
    .composer-prompt-wrap {
      position: relative;
    }
    .prompt-file-suggestions {
      display: none;
      box-sizing: border-box;
      margin: 0;
      padding: 4px 0;
      max-height: min(240px, 32vh);
      overflow-y: auto;
      list-style: none;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-bg);
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    }
    .prompt-file-suggestions.is-open {
      display: block;
    }
    .prompt-file-suggestions li {
      padding: 6px 10px;
      font-size: 0.78rem;
      font-family: ui-monospace, monospace;
      color: var(--ds-text);
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .prompt-file-suggestions li:hover,
    .prompt-file-suggestions li.is-active {
      background: var(--ds-main-tint);
      color: var(--ds-accent);
    }
    .prompt-file-suggestions .prompt-file-suggest-empty {
      color: var(--ds-muted);
      cursor: default;
      font-family: inherit;
    }
    .prompt-file-suggestions .prompt-file-suggest-empty:hover {
      background: transparent;
      color: var(--ds-muted);
    }
    .workspace-upload-input {
      position: fixed;
      left: -9999px;
      top: 0;
      width: 1px;
      height: 1px;
      opacity: 0;
    }
    label.composer-action-btn.is-busy {
      opacity: 0.55;
      pointer-events: none;
    }
    .composer-card .prompt-editor#prompt {
      width: 100%;
      min-height: 48px;
      max-height: 28vh;
      overflow-y: auto;
      font: inherit;
      font-size: 15px;
      line-height: 1.55;
      padding: 2px 0;
      border: none;
      border-radius: 0;
      background: transparent;
      color: var(--ds-text);
      outline: none;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .composer-card .prompt-editor#prompt:empty::before {
      content: attr(data-placeholder);
      color: #b4b4b4;
      pointer-events: none;
    }
    .prompt-file-chip {
      display: inline;
      color: #2563eb;
      text-decoration: underline;
      text-underline-offset: 2px;
      background: rgba(37, 99, 235, 0.08);
      border-radius: 4px;
      padding: 1px 5px;
      margin: 0 1px;
      font-family: ui-monospace, Menlo, monospace;
      font-size: 0.9em;
      cursor: default;
      white-space: nowrap;
    }
    .debug-notify-stack {
      position: fixed;
      top: 16px;
      right: 16px;
      z-index: 10050;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
      max-width: min(420px, calc(100vw - 32px));
      pointer-events: none;
    }
    .debug-notify {
      pointer-events: auto;
      max-width: 100%;
      padding: 10px 14px;
      border-radius: 10px;
      font-size: 13px;
      line-height: 1.45;
      word-break: break-word;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
      border: 1px solid #e4e4e7;
      background: #fafafa;
      color: #3f3f46;
      animation: debug-notify-in 0.22s ease;
    }
    .debug-notify--info {
      background: #f0f9ff;
      border-color: #bae6fd;
      color: #0c4a6e;
    }
    .debug-notify--warn {
      background: #fffbeb;
      border-color: #fde68a;
      color: #92400e;
    }
    .debug-notify--error {
      background: #fef2f2;
      border-color: #fecaca;
      color: #991b1b;
    }
    @keyframes debug-notify-in {
      from {
        opacity: 0;
        transform: translateY(-6px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    .composer-upload-toast {
      position: absolute;
      left: 0;
      right: 0;
      bottom: -2px;
      transform: translateY(100%);
      z-index: 50;
      margin-top: 6px;
      padding: 6px 10px;
      border-radius: 8px;
      background: #ecfdf5;
      border: 1px solid #86efac;
      color: #166534;
      font-size: 0.75rem;
    }
    .composer-upload-toast.is-error {
      background: #fef2f2;
      border-color: #fecaca;
      color: #b91c1c;
    }
    .composer-card:focus-within {
      border-color: var(--ds-accent);
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    }
    .composer-card label.f {
      margin-bottom: 0.45rem;
      padding-left: 0;
      font-weight: 500;
      color: #4b5563;
    }
    .prompt-label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.45rem;
    }
    .prompt-label-row label.f {
      margin-bottom: 0;
    }
    .prompt-session-info {
      font-size: 0.68rem;
      color: var(--ds-muted);
      font-family: ui-monospace, monospace;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 62%;
      text-align: right;
    }
    .composer-card-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.65rem;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--ds-border);
    }
    .composer-tools-left {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      min-width: 0;
    }
    .composer-tools-right {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }
    .composer-model-field {
      position: relative;
      flex: 1;
      min-width: min(200px, 28vw);
      max-width: min(560px, 72vw);
    }
    .composer-mode-select {
      box-sizing: border-box;
      height: 2.2rem;
      min-width: 9.5rem;
      max-width: 11.5rem;
      padding: 0 0.5rem;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-main-tint);
      color: var(--ds-text);
      font-size: 0.72rem;
      outline: none;
    }
    .composer-mode-select:focus {
      border-color: #c7d2fe;
      box-shadow: 0 0 0 2px rgba(79, 109, 245, 0.12);
    }
    .composer-allow-ask-select {
      box-sizing: border-box;
      height: 2.2rem;
      min-width: 6.8rem;
      max-width: 8.4rem;
      padding: 0 0.45rem;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-main-tint);
      color: var(--ds-text);
      font-size: 0.72rem;
      outline: none;
    }
    .composer-allow-ask-select:focus {
      border-color: #c7d2fe;
      box-shadow: 0 0 0 2px rgba(79, 109, 245, 0.12);
    }
    .composer-model-input {
      width: 100%;
      box-sizing: border-box;
      height: 2.2rem;
      padding: 0 0.5rem;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-main-tint);
      color: var(--ds-text);
      font-size: 12px;
      font-family: inherit;
      outline: none;
    }
    .composer-model-input:focus {
      border-color: #c7d2fe;
      box-shadow: 0 0 0 2px rgba(79, 109, 245, 0.12);
    }
    .composer-model-input::placeholder {
      color: #b4b4b4;
      font-family: inherit;
    }
    .composer-model-suggestions {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 100%;
      margin: 0 0 4px;
      padding: 0.25rem 0;
      list-style: none;
      max-height: min(220px, 32vh);
      overflow: auto;
      border: 1px solid var(--ds-border);
      border-radius: 10px;
      background: var(--ds-bg);
      box-shadow: var(--ds-shadow-md);
      z-index: 50;
      display: none;
    }
    .composer-model-suggestions.is-open {
      display: block;
    }
    .composer-model-suggestions li {
      padding: 0.38rem 0.55rem;
      font-size: 0.72rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      cursor: pointer;
      color: var(--ds-text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .composer-model-suggestions li:hover,
    .composer-model-suggestions li.is-active {
      background: var(--ds-item-active);
      color: var(--ds-accent);
    }
    .composer-model-suggestions .composer-model-suggest-empty {
      color: var(--ds-muted);
      cursor: default;
      font-family: inherit;
    }
    .composer-model-suggestions .composer-model-suggest-empty:hover {
      background: transparent;
      color: var(--ds-muted);
    }
    .composer-action-btn {
      width: 2.2rem;
      height: 2.2rem;
      border-radius: 8px;
      flex-shrink: 0;
    }
    .composer-action-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    .composer-action-btn svg {
      width: 17px;
      height: 17px;
    }
    .tool-files-body {
      padding: 0.75rem 1rem 0.95rem;
      max-height: min(62vh, 560px);
      overflow: auto;
      background: var(--ds-main-tint);
    }
    .tool-files-meta {
      margin: 0 0 0.55rem;
      font-size: 0.72rem;
      color: var(--ds-muted);
      word-break: break-all;
    }
    .tool-files-state {
      font-size: 0.82rem;
      color: var(--ds-muted);
      padding: 0.45rem 0.2rem;
    }
    .tool-files-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .tool-files-item {
      border: 1px solid var(--ds-border);
      border-radius: 10px;
      background: var(--ds-bg);
      padding: 0.55rem 0.65rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.7rem;
    }
    .tool-files-main {
      min-width: 0;
      flex: 1;
    }
    .tool-files-name {
      font-size: 0.8rem;
      color: var(--ds-text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    }
    .tool-files-sub {
      margin-top: 0.22rem;
      font-size: 0.7rem;
      color: var(--ds-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .tool-files-download {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 1.9rem;
      padding: 0 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--ds-border);
      background: var(--ds-bg);
      color: var(--ds-text);
      font-size: 0.75rem;
      text-decoration: none;
      flex-shrink: 0;
    }
    .tool-files-download:hover {
      border-color: #c7d2fe;
      background: #eef2ff;
      color: var(--ds-accent);
    }
    .page-footer-note {
      text-align: center;
      font-size: 0.65rem;
      color: #9ca3af;
      padding: 0.5rem 1rem 0;
      letter-spacing: 0.02em;
    }
    .drawer-bind-block {
      margin-bottom: 0.55rem;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid var(--ds-border);
      font-size: 0.72rem;
    }
    .drawer-bind-block--solo {
      margin-bottom: 0;
      padding-bottom: 0;
      border-bottom: none;
    }
    .drawer-bind-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.35rem;
    }
    .drawer-bind-head.sidebar-drawer-meta {
      padding-top: 0.15rem;
      font-size: 0.7rem;
    }
    .drawer-bind-head strong {
      color: var(--ds-text);
      font-weight: 600;
    }
    .agent-bind-model-input {
      width: 100%;
      box-sizing: border-box;
      padding: 0.25rem 0.35rem;
      border-radius: 6px;
      border: 1px solid var(--ds-border);
      background: var(--ds-bg);
      color: var(--ds-text);
      font-size: 0.72rem;
    }
    .btn-bind-save {
      margin-top: 0.35rem;
      width: 100%;
      padding: 0.3rem;
      border-radius: 8px;
      border: none;
      background: var(--ds-accent);
      color: #fff;
      font-size: 0.7rem;
      cursor: pointer;
    }
    .btn-bind-save:hover:not(:disabled) {
      background: var(--ds-accent-hover);
    }
    .btn-bind-save:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .agent-picker-search {
      width: 100%;
      box-sizing: border-box;
      margin-bottom: 0.45rem;
      padding: 0.35rem;
      border-radius: 8px;
      border: 1px solid var(--ds-border);
      font-size: 0.78rem;
    }
    .agent-picker-scroll {
      max-height: min(42vh, 280px);
      overflow: auto;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      padding: 0.35rem;
    }
    .agent-picker-item {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.25rem 0;
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    .agent-picker-item:last-child {
      border-bottom: none;
    }
    .agent-picker-section {
      margin-bottom: 0.8rem;
    }
    .agent-picker-section:last-child {
      margin-bottom: 0;
    }
    .agent-picker-tabs {
      display: flex;
      gap: 0.3rem;
      margin-bottom: 0.45rem;
      flex-wrap: wrap;
    }
    .btn-picker-tab {
      border: 1px solid var(--ds-border);
      background: var(--ds-bg-elev);
      color: var(--ds-text);
      border-radius: 6px;
      font-size: 0.7rem;
      line-height: 1;
      padding: 0.32rem 0.5rem;
      cursor: pointer;
    }
    .btn-picker-tab.is-on {
      color: #fff;
      border-color: var(--ds-accent);
      background: var(--ds-accent);
    }
    .agent-picker-section-title {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--ds-text-soft);
      margin-bottom: 0.3rem;
    }
    .agent-picker-empty {
      font-size: 0.72rem;
      color: var(--ds-text-soft);
      padding: 0.2rem 0.05rem 0.35rem;
    }
    .agent-picker-cloud-search {
      width: 100%;
      box-sizing: border-box;
      margin-bottom: 0.35rem;
      padding: 0.32rem 0.36rem;
      border-radius: 7px;
      border: 1px solid var(--ds-border);
      font-size: 0.74rem;
    }
    .agent-picker-cloud-meta {
      font-size: 0.68rem;
      color: var(--ds-text-soft);
      margin: 0.08rem 0 0.22rem;
    }
    .agent-picker-cloud-pager {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 0.35rem;
      margin-bottom: 0.35rem;
    }
    .agent-picker-cloud-page-info {
      font-size: 0.68rem;
      color: var(--ds-text-soft);
      min-width: 4.2rem;
      text-align: center;
    }
    .agent-picker-item-label {
      flex: 1;
      font-size: 0.74rem;
      line-height: 1.35;
    }
    .agent-picker-actions {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      flex-shrink: 0;
    }
    .btn-picker-action {
      border: 1px solid var(--ds-border);
      background: var(--ds-bg-elev);
      color: var(--ds-text);
      border-radius: 6px;
      font-size: 0.68rem;
      line-height: 1;
      padding: 0.28rem 0.42rem;
      cursor: pointer;
    }
    .btn-picker-action:hover:not(:disabled) {
      border-color: var(--ds-accent);
    }
    .btn-picker-action.is-on {
      color: #fff;
      border-color: var(--ds-accent);
      background: var(--ds-accent);
    }
    .btn-picker-action.is-delete {
      color: #ff6a6a;
      border-color: rgba(255, 106, 106, 0.45);
      background: rgba(255, 106, 106, 0.08);
    }
    .btn-picker-action:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    /* 页面级布局：ChatGPT 式侧栏 + 主区 */
    body {
      background: var(--ds-bg);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    .main {
      background: var(--ds-bg);
      display: flex;
      flex-direction: column;
      min-height: 0;
    }
    .main-header[hidden] {
      display: none !important;
    }
    .main-header {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 52px;
      padding: 0 20px;
      border-bottom: 1px solid var(--ds-border);
      background: var(--ds-bg);
    }
    .main-header-title {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      line-height: 1.3;
      color: var(--ds-text);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
      flex: 1;
    }
    .main-header-sub {
      display: none;
    }
    .composer-meta {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 0;
      font-size: 12px;
      color: var(--ds-muted);
      margin-bottom: 8px;
      padding: 0 4px;
      min-width: 0;
    }
    .composer-meta .conn-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .composer-meta .conn-status::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--ds-muted);
      flex-shrink: 0;
    }
    .composer-meta .conn-status.ready::before { background: var(--ds-ok); }
    .composer-meta .conn-status.err::before { background: var(--ds-danger); }
    .composer-meta .conn-status.ready { color: var(--ds-ok); font-weight: 500; }
    .composer-meta .conn-status.err { color: var(--ds-danger); font-weight: 500; }
    .composer-meta .composer-meta-sep {
      width: 1px;
      height: 14px;
      margin: 0 10px;
      background: var(--ds-border);
      flex-shrink: 0;
    }
    .composer-meta .prompt-session-info {
      font-family: ui-monospace, Menlo, monospace;
      font-size: 11px;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: min(360px, 45vw);
    }
    .main-scroll {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .main-body {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .chat-thread {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      padding: 24px 20px 32px;
      flex: 1;
    }
    .composer {
      flex-shrink: 0;
      padding: 0 0 28px;
      background: var(--ds-bg);
      border-top: none;
    }
    .composer-inner {
      max-width: var(--chat-max);
      margin: 0 auto;
      padding: 0 20px;
      width: 100%;
    }
    .composer-card {
      border: 1px solid var(--ds-border);
      border-radius: 26px;
      background: var(--ds-bg);
      box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
      padding: 14px 16px 10px;
    }
    .composer-card:focus-within {
      border-color: #d4d4d8;
      box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    }
    .composer-card .prompt-editor#prompt {
      font-size: 16px;
      min-height: 28px;
      max-height: 200px;
      padding: 0;
      line-height: 1.5;
    }
    .composer-card-footer {
      border-top: none;
      margin-top: 8px;
      padding-top: 0;
    }
    .composer-model-input,
    .composer-mode-select,
    .composer-allow-ask-select {
      height: 30px;
      border-radius: 6px;
      border: 1px solid var(--ds-border);
      background: var(--ds-bg);
      font-size: 12px;
    }
    .composer-action-btn {
      width: 30px;
      height: 30px;
      border-radius: 6px;
    }
    #btnSend.composer-action-btn {
      width: 34px;
      height: 34px;
      border-radius: 999px;
      background: var(--ds-accent);
      color: #fff;
      flex-shrink: 0;
    }
    #btnSend.composer-action-btn:hover:not(:disabled) {
      background: var(--ds-accent-hover);
    }
    #btnSend.composer-action-btn:disabled {
      background: #d4d4d8;
      opacity: 1;
    }
    .composer-model-field {
      flex: 1;
      min-width: 140px;
      max-width: 280px;
    }
    .btn-primary {
      border-radius: 6px;
      font-weight: 500;
    }
    .agent-md-modal-backdrop {
      background: rgba(0, 0, 0, 0.4);
    }
    .sidebar *::-webkit-scrollbar,
    .sidebar-session-list::-webkit-scrollbar,
    .main-scroll *::-webkit-scrollbar,
    .chat-thread::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .sidebar *::-webkit-scrollbar-thumb,
    .sidebar-session-list::-webkit-scrollbar-thumb,
    .main-scroll *::-webkit-scrollbar-thumb,
    .chat-thread::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 999px;
    }
    @keyframes ws-ready-spin {
      to { transform: rotate(360deg); }
    }

    /* 工具 chip 视觉 */
    .agent-bind-chips .sidebar-drawer-item {
      background: var(--ds-page);
      border-color: transparent;
    }
    .agent-bind-chips .sidebar-drawer-item:hover {
      background: var(--ds-item-hover);
    }

    /* 会话页签条 */
    .session-tabs {
      display: flex;
      align-items: stretch;
      gap: 0;
      height: 40px;
      padding: 0;
      border-bottom: none;
      background: transparent;
      flex-shrink: 0;
    }
    .session-tabs-list {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: stretch;
      gap: 0;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: thin;
    }
    .session-tabs-list::-webkit-scrollbar { height: 6px; }
    .session-tabs-list::-webkit-scrollbar-thumb {
      background: rgba(60, 60, 67, 0.2);
      border-radius: 999px;
    }
    .session-tabs-empty {
      font-size: 12px;
      color: var(--ds-muted);
      padding: 8px;
    }
    .session-tab {
      position: relative;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      max-width: 180px;
      min-width: 88px;
      height: 100%;
      padding: 0 8px 0 12px;
      margin-bottom: 0;
      border: none;
      border-bottom: 2px solid transparent;
      border-radius: 0;
      background: transparent;
      color: var(--ds-muted);
      transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
    }
    .session-tab:hover {
      color: var(--ds-text);
      background: var(--ds-item-hover);
    }
    .session-tab.active {
      color: var(--ds-text);
      border-bottom-color: var(--ds-accent);
      background: var(--ds-bg);
    }
    .session-tab-main {
      flex: 1;
      min-width: 0;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
      font-size: 13px;
      font-weight: 500;
      text-align: left;
      padding: 0;
      cursor: pointer;
      line-height: 1;
      overflow: hidden;
    }
    .session-tab-icon {
      flex-shrink: 0;
      width: 14px;
      height: 14px;
      color: var(--ds-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .session-tab.active .session-tab-icon {
      color: var(--ds-secondary);
    }
    .session-tab-label {
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .session-tab-close {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 4px;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      opacity: 0;
      transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
    }
    .session-tab:hover .session-tab-close,
    .session-tab.active .session-tab-close {
      opacity: 0.55;
    }
    .session-tab-close:hover {
      opacity: 1;
      background: rgba(220, 38, 38, 0.1);
      color: var(--ds-danger);
    }
    .session-tab-new {
      flex-shrink: 0;
      width: 36px;
      height: 100%;
      margin: 0 4px 0 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      border: none;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      font-size: 18px;
      line-height: 1;
      transition: background 120ms ease, color 120ms ease;
    }
    .session-tab-new:hover {
      background: var(--ds-item-hover);
      color: var(--ds-accent);
    }
    .session-tab-new:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
    }

    /* 文件浏览（纯文件系统只读） */
    .repo-manage-view {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
    }
    .repo-manage-view[hidden] {
      display: none !important;
    }
    .chat-workspace {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .chat-workspace[hidden] {
      display: none !important;
    }
    .repo-manage-layout {
      flex: 1;
      min-height: 0;
      display: flex;
      gap: 0;
      overflow: hidden;
    }
    .repo-tree-panel {
      flex-shrink: 0;
      width: 220px;
      display: flex;
      flex-direction: column;
      border: none;
      border-radius: 0;
      border-right: 1px solid var(--ds-border);
      overflow: hidden;
      background: var(--ds-bg);
    }
    .repo-tree-panel-title {
      flex-shrink: 0;
      padding: 10px 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--ds-muted);
      border-bottom: 1px solid var(--ds-border);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .repo-tree-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 6px 0;
    }
    .repo-tree-item {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px 4px 0;
      font-size: 13px;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .repo-tree-item:hover {
      background: var(--ds-item-hover);
    }
    .repo-tree-item.is-selected {
      background: rgba(10, 132, 255, 0.1);
      color: var(--ds-accent);
    }
    .repo-tree-item.is-file {
      color: var(--ds-muted);
    }
    .repo-tree-item.is-file .repo-tree-name {
      font-weight: 400;
    }
    .repo-tree-toggle {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: none;
      background: transparent;
      color: var(--ds-muted);
      cursor: pointer;
      font-size: 10px;
      padding: 0;
    }
    .repo-tree-toggle.is-placeholder {
      visibility: hidden;
      pointer-events: none;
    }
    .repo-tree-name {
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .repo-type-icon {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
      color: var(--ds-muted);
    }
    .repo-type-icon-dir {
      color: #d4a017;
    }
    .repo-type-icon-file {
      color: #94a3b8;
    }
    .repo-type-icon-md {
      color: #2563eb;
    }
    .repo-type-icon-json {
      color: #ca8a04;
    }
    .repo-type-icon-yaml {
      color: #7c3aed;
    }
    .repo-type-icon-html {
      color: #ea580c;
    }
    .repo-type-icon-js {
      color: #ca8a04;
    }
    .repo-type-icon-ts {
      color: #2563eb;
    }
    .repo-type-icon-vue {
      color: #059669;
    }
    .repo-type-icon-code {
      color: #0d9488;
    }
    .repo-type-icon-sql {
      color: #6366f1;
    }
    .repo-type-icon-shell {
      color: #475569;
    }
    .repo-type-icon-xml {
      color: #b45309;
    }
    .repo-type-icon-image {
      color: #db2777;
    }
    .repo-type-icon-archive {
      color: #a16207;
    }
    .repo-type-icon-pdf {
      color: #dc2626;
    }
    .repo-type-icon-doc {
      color: #1d4ed8;
    }
    .repo-type-icon-text {
      color: #64748b;
    }
    .repo-type-icon-docker {
      color: #0284c7;
    }
    .repo-tree-item.is-selected .repo-type-icon-dir {
      color: var(--ds-accent);
    }
    .repo-entry-name-wrap {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }
    .repo-entry-name-wrap .repo-entry-link {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .repo-content-panel {
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .repo-entries-wrap[hidden] {
      display: none !important;
    }
    .repo-file-preview {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      border: none;
      border-radius: 0;
      overflow: hidden;
      background: var(--ds-bg);
    }
    .repo-file-preview[hidden] {
      display: none !important;
    }
    .repo-file-preview-header {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--ds-border);
      background: var(--ds-bg);
    }
    .repo-file-preview-title {
      font-size: 13px;
      font-weight: 600;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .repo-file-preview-actions {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .btn-repo-file-action {
      flex-shrink: 0;
      padding: 5px 12px;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-bg);
      color: inherit;
      font: inherit;
      font-size: 12px;
      text-decoration: none;
      cursor: pointer;
    }
    .btn-repo-file-action:hover {
      background: var(--ds-item-hover);
    }
    .btn-repo-file-delete {
      color: #b91c1c;
      border-color: #fecaca;
    }
    .btn-repo-file-delete:hover {
      background: #fef2f2;
    }
    .btn-repo-file-delete:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .repo-file-preview-unavailable {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--ds-muted);
    }
    .repo-file-preview-hint {
      margin: 0;
      font-size: 14px;
      text-align: center;
      line-height: 1.6;
    }
    .repo-file-preview-body {
      flex: 1;
      min-height: 0;
      overflow: auto;
      padding: 14px 16px;
      font-size: 13px;
      line-height: 1.6;
    }
    .repo-file-preview-text pre {
      margin: 0;
      white-space: pre-wrap;
      word-break: break-word;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 12px;
      line-height: 1.55;
    }
    .repo-tree-item.is-file.is-selected {
      background: rgba(10, 132, 255, 0.1);
      color: var(--ds-accent);
    }
    .repo-entries-wrap {
      flex: 1;
      min-height: 0;
      overflow: auto;
      border: none;
      border-radius: 0;
    }
    .repo-entries-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .repo-entries-table th,
    .repo-entries-table td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid var(--ds-border);
      vertical-align: top;
    }
    .repo-entries-table th {
      position: sticky;
      top: 0;
      background: var(--ds-bg);
      font-weight: 600;
      color: var(--ds-muted);
      font-size: 12px;
      z-index: 1;
    }
    .repo-entries-table tr:last-child td {
      border-bottom: none;
    }
    .repo-entry-link {
      border: none;
      background: none;
      color: var(--ds-accent);
      font: inherit;
      font-size: inherit;
      cursor: pointer;
      padding: 0;
      text-align: left;
    }
    .repo-entry-link:hover {
      text-decoration: underline;
    }
    .repo-entry-dir {
      font-weight: 500;
      color: inherit;
    }
    .repo-panel-state {
      padding: 24px;
      text-align: center;
      color: var(--ds-muted);
      font-size: 13px;
    }
    .repo-panel-state.is-error {
      color: var(--ds-danger);
    }

    /* Picker 主视图（工具 / MCP / Skill / Teams，布局对齐文件管理页） */
    .picker-manage-view {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
    }
    .picker-manage-view[hidden] {
      display: none !important;
    }
    .picker-manage-layout {
      flex: 1;
      min-height: 0;
      display: flex;
      gap: 0;
      overflow: hidden;
    }
    .picker-nav-panel {
      flex-shrink: 0;
      width: 220px;
      display: flex;
      flex-direction: column;
      border: none;
      border-radius: 0;
      border-right: 1px solid var(--ds-border);
      overflow: hidden;
      background: var(--ds-bg);
    }
    .picker-nav-panel[hidden] {
      display: none !important;
    }
    .picker-nav-title {
      flex-shrink: 0;
      padding: 10px 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--ds-muted);
      border-bottom: 1px solid var(--ds-border);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .picker-nav-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 6px 0;
      display: flex;
      flex-direction: column;
    }
    .picker-nav-item {
      display: flex;
      align-items: center;
      width: 100%;
      padding: 8px 12px;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
      font-size: 13px;
      text-align: left;
      cursor: pointer;
      user-select: none;
    }
    .picker-nav-item:hover {
      background: var(--ds-item-hover);
    }
    .picker-nav-item.is-selected {
      background: rgba(10, 132, 255, 0.1);
      color: var(--ds-accent);
      font-weight: 600;
    }
    .picker-content-panel {
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--ds-bg);
    }
    /* 主视图通用：顶栏、表格、行内操作按钮（Picker / 定时任务等共用） */
    .manage-view-head {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--ds-border);
      background: var(--ds-bg);
    }
    .manage-view-meta {
      margin: 0;
      font-size: 12px;
      color: var(--ds-muted);
      min-width: 0;
    }
    .manage-head-actions {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
    }
    .btn-manage-head-action {
      padding: 5px 12px;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-bg);
      color: inherit;
      font: inherit;
      font-size: 12px;
      cursor: pointer;
      white-space: nowrap;
    }
    .btn-manage-head-action:hover:not(:disabled) {
      background: var(--ds-item-hover);
    }
    .btn-manage-head-action:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .manage-content-body {
      flex: 1;
      min-height: 0;
      overflow: auto;
      display: flex;
      flex-direction: column;
    }
    .manage-entries-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .manage-entries-table[hidden] {
      display: none !important;
    }
    .manage-entries-table th,
    .manage-entries-table td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid var(--ds-border);
      vertical-align: middle;
    }
    .manage-entries-table th.col-actions,
    .manage-entries-table td.col-actions {
      text-align: right;
      white-space: nowrap;
    }
    .manage-entries-table td.col-detail {
      max-width: 360px;
      white-space: pre-line;
      color: var(--ds-muted);
      font-size: 12px;
      line-height: 1.45;
    }
    .manage-entries-table th {
      position: sticky;
      top: 0;
      background: var(--ds-bg);
      font-weight: 600;
      color: var(--ds-muted);
      font-size: 12px;
      z-index: 1;
    }
    .manage-entries-table tr:last-child td {
      border-bottom: none;
    }
    .manage-row-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: wrap;
      width: 100%;
    }
    .btn-manage-row-action {
      flex-shrink: 0;
      padding: 4px 10px;
      border: 1px solid var(--ds-border);
      border-radius: 8px;
      background: var(--ds-bg);
      color: inherit;
      font: inherit;
      font-size: 12px;
      cursor: pointer;
      white-space: nowrap;
    }
    .btn-manage-row-action:hover:not(:disabled) {
      background: var(--ds-item-hover);
    }
    .btn-manage-row-action.is-on {
      color: #fff;
      border-color: var(--ds-accent);
      background: var(--ds-accent);
    }
    .btn-manage-row-action.is-delete {
      color: #b91c1c;
      border-color: #fecaca;
    }
    .btn-manage-row-action.is-delete:hover:not(:disabled) {
      background: #fef2f2;
    }
    .btn-manage-row-action:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .manage-panel-state {
      padding: 24px;
      text-align: center;
      color: var(--ds-muted);
      font-size: 13px;
    }
    .manage-panel-state.is-error {
      color: var(--ds-danger);
    }
    .picker-manage-head {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--ds-border);
      background: var(--ds-bg);
    }
    .picker-search {
      flex: 1;
      min-width: 0;
      max-width: 280px;
      box-sizing: border-box;
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px solid var(--ds-border);
      font-size: 13px;
      background: var(--ds-bg);
      color: inherit;
    }
    .picker-panel-state {
      padding: 24px;
      text-align: center;
      color: var(--ds-muted);
      font-size: 13px;
    }
    .picker-panel-state.is-error {
      color: var(--ds-danger);
    }
    /* 定时任务主视图 */
    .schedule-manage-view {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
    }
    .schedule-manage-view[hidden] {
      display: none !important;
    }
    .schedule-manage-layout {
      flex: 1;
      min-height: 0;
      display: flex;
      overflow: hidden;
    }
    .schedule-content-panel {
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--ds-bg);
    }
    .schedule-tasks-wrap,
    .schedule-runs-wrap {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: auto;
      padding: 0 0 14px;
    }
    .schedule-tasks-pager {
      margin-top: 0.35rem;
      padding: 0 0.25rem;
    }
    .schedule-runs-wrap[hidden] {
      display: none !important;
    }
    .schedule-create-trigger-modes {
      display: flex;
      gap: 12px;
      align-items: center;
      font-size: 13px;
    }
    .schedule-runs-head-left {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .schedule-runs-title {
      font-size: 13px;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .schedule-runs-meta {
      padding: 0 14px 8px;
    }
    .picker-cloud-panel {
      flex: 1;
      min-height: 0;
      overflow: auto;
      padding: 14px 16px;
    }
    .picker-cloud-panel[hidden] {
      display: none !important;
    }
    .picker-cloud-panel .agent-picker-cloud-search {
      max-width: 360px;
      margin-bottom: 10px;
    }
    .picker-cloud-panel .agent-picker-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid var(--ds-border);
    }
    .picker-cloud-panel .agent-picker-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      margin-left: auto;
      flex-shrink: 0;
    }
    .picker-cloud-panel .agent-picker-item:last-child {
      border-bottom: none;
    }
