dsh-session-superagent 0.9.264 → 0.9.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js CHANGED
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
14
14
  const { useCallback, useEffect, useRef, useState } = React
15
15
 
16
16
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
17
- const CLIENT_VERSION = '0.9.264'
17
+ const CLIENT_VERSION = '0.9.266'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -117,7 +117,7 @@ window.__ModuleLoader__.load({
117
117
  // 官方 GUI 的 376 条选择器 / 40KB 样式原样搬过来,类名统一 `dt-` 前缀,不污染宿主。
118
118
  // 两个表单都有这个开关:文案只写一份,改的时候不会漏掉另一处
119
119
  const ISOLATED_HINT = '隔离执行(每次唤醒开一个临时副本;在副本里改,用完自动回收)'
120
- const PORTED_CSS = "/* Panel layout and local UI controls styled with DSH `--dsw-alias-*` design tokens; one rule per line. */\n.dt-page { box-sizing: border-box; height: 100%; overflow: auto; scrollbar-gutter: stable; scroll-padding: 48px 0 72px; container-type: inline-size; padding: 28px clamp(24px, 4vw, 48px) 0; color: var(--dsw-alias-label-primary); }\n/* Deployment page rendered inside DSH Plugin Manager, which owns scrolling and padding. */\n.dt-embedded { container-type: inline-size; color: var(--dsw-alias-label-primary); }\n/* Disable sticky positioning inside DSH Plugin Manager, where the host container owns scrolling and bottom padding. */\n.dt-embedded .dt-savebar { position: static; }\n.dt-page > * + * { margin-top: 16px; }\n.dt-page > .dt-column { max-width: 960px; margin: 0 auto; padding-bottom: 48px; display: flex; flex-direction: column; gap: 24px; }\n.dt-head { position: relative; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }\n.dt-search { position: relative; width: 240px; max-width: 100%; }\n.dt-search-results { position: absolute; top: calc(100% + 6px); right: 0; width: min(560px, 90cqw); max-height: 60vh; overflow: auto; padding: 8px 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 12px; background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); z-index: 5; display: flex; flex-direction: column; gap: 8px; }\n.dt-mark { background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 25%, transparent); color: inherit; border-radius: 2px; }\n[data-platform='darwin'] .dt-page .dt-head { padding-top: var(--dsh-frame-top-clearance, 0px); }\n.dt-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--dsw-alias-label-secondary); }\n.dt-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }\n.dt-page .dt-tabs { overflow-x: auto; display: flex; gap: 20px; max-width: none; padding: 0; border-radius: 0; background: none; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-segmented { width: 100%; max-width: 420px; box-sizing: border-box; display: inline-grid; gap: 2px; padding: 3px; border-radius: 9px; background: var(--dsw-alias-interactive-bg-hover); }\n.dt-form.dt-block { padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 16px; gap: 16px; }\n.dt-block-title { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }\n.dt-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }\n.dt-section-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--dsw-alias-label-primary); }\n.dt-section-name { white-space: nowrap; }\n.dt-count { font-size: 14px; color: var(--dsw-alias-label-caption); font-variant-numeric: tabular-nums; font-weight: 400; } .dt-section-sub { font-size: 12px; line-height: 18px; font-weight: 400; color: var(--dsw-alias-label-caption); }\n.dt-hint { margin: 0; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-tertiary); }\n.dt-error { margin: 0; font-size: 13px; line-height: 20px; color: var(--dsw-alias-state-error-primary); }\n.dt-banner { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 20px; background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 10%, transparent); overflow-wrap: anywhere; }\n.dt-banner.dt-danger { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent); color: var(--dsw-alias-state-error-primary); }\n.dt-list { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }\n.dt-row { position: relative; min-width: 0; border-radius: 12px; padding: 10px 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-start; }\n.dt-row.dt-link:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-row-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }\n.dt-disclosure-body .dt-row-main { flex-basis: 0; }\n.dt-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; }\n.dt-open { max-width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-open::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }\n.dt-open:focus-visible { outline: none; }\n.dt-open-wrap { white-space: normal; }\n.dt-open:focus-visible::after { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-caption); overflow-wrap: anywhere; }\n.dt-row-quote { font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n/* Transparent block borders preserve vertical spacing when line clamping clips padding. */\n.dt-banner:is(.dt-clamp, .dt-clamp-8) { padding-block: 0; border-block: 8px solid transparent; }\n.dt-banner-label { font-weight: 500; }\n.dt-banner .dt-md { display: inline; }\n.dt-banner .dt-md > p:first-child { display: inline; }\n.dt-row-buttons { position: relative; z-index: 1; gap: 8px; margin-top: 4px; }\n.dt-row-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; font-size: 13px; line-height: 20px; }\n.dt-dot { flex: none; margin-top: 5px; }\n.dt-inline-link { position: relative; z-index: 1; color: var(--dsw-alias-link); text-decoration: none; }\n.dt-inline-link:hover { text-decoration: underline; }\n.dt-textlink { padding: 0; border: 0; background: none; font: inherit; color: var(--dsw-alias-link); cursor: pointer; text-align: left; }\n.dt-textlink:hover { text-decoration: underline; }\n.dt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 20px; }\n.dt-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; line-height: 20px; }\n.dt-kv dt { color: var(--dsw-alias-label-tertiary); }\n.dt-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }\n@container (max-width: 640px) { .dt-kv dt { margin-top: 4px; } .dt-kv dt:first-of-type { margin-top: 0; } }\n.dt-timeline-day { position: sticky; top: 0; z-index: 1; padding: 6px 0 2px; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-caption); font-weight: 500; list-style: none; background: var(--dsw-alias-bg-base); }\n.dt-event-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }\n.dt-event-head .dt-event-time { margin-left: auto; flex: none; font-size: 12px; color: var(--dsw-alias-label-caption); font-variant-numeric: tabular-nums; }\n.dt-event-nums { color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }\n.dt-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }\n.dt-event { padding: 12px 0; border-bottom: 0.5px solid var(--dsw-alias-border-l2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }\n.dt-event:last-child { border-bottom: 0; }\n.dt-event.dt-highlight { background: var(--dsw-alias-interactive-bg-hover); border-radius: 8px; padding-inline: 8px; margin-inline: -8px; }\n.dt-event-text { margin: 0; font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }\n.dt-event-actor { font-weight: 500; color: var(--dsw-alias-label-secondary); }\n.dt-event-quiet .dt-event-text { color: var(--dsw-alias-label-tertiary); }\n.dt-flow { margin: 0; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); }\n.dt-clamp-8 { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }\n.dt-more { align-self: flex-start; font-size: 12px; }\n.dt-reveal { opacity: 0; }\n.dt-event:hover .dt-reveal, .dt-reveal:focus-visible { opacity: 1; }\n@media (hover: none) {\n .dt-reveal { opacity: 1; }\n}\n.dt-event-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }\n.dt-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.dt-filters .dt-search { margin-left: auto; }\n.dt-form { display: flex; flex-direction: column; gap: 24px; }\n.dt-fieldset { display: flex; flex-direction: column; gap: inherit; min-width: 0; margin: 0; padding: 0; border: 0; }\n.dt-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 20px; min-width: 0; }\n.dt-field small { color: var(--dsw-alias-label-caption); font-size: 12px; }\n.dt-textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-1, transparent); resize: vertical; }\n.dt-select { box-sizing: border-box; width: 100%; min-width: 0; height: 32px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 8px; padding: 0 28px 0 8px; text-overflow: ellipsis; font: inherit; font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-1, transparent); }\n.dt-textarea:focus-visible, .dt-select:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-mono { font-family: var(--ds-font-family-code, Menlo, monospace); font-size: 12px; overflow-wrap: anywhere; }\n.dt-detail { margin-top: 2px; color: var(--dsw-alias-label-secondary); }\n.dt-savebar .dt-error { white-space: pre-line; }\n.dt-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; font-size: 13px; }\n.dt-subhead-actions { display: inline-flex; align-items: center; gap: 4px; }\n.dt-btn-busy .dt-btn-icon svg { animation: dt-spin 1s linear infinite; }\n.dt-subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); }\n.dt-rules, .dt-changes { list-style: none; margin: 0; padding: 0; }\n.dt-field-head { display: inline-flex; align-items: center; gap: 4px; color: var(--dsw-alias-label-secondary); }\n.dt-info { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--dsw-alias-label-caption); cursor: help; }\n.dt-info:hover, .dt-info:focus-visible { color: var(--dsw-alias-label-secondary); }\n.dt-info:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; border-radius: 50%; }\n.dt-tooltip { position: fixed; z-index: 1100; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 3px 7px; border-radius: 8px; background: var(--dsw-alias-tooltip-bg); color: var(--dsw-static-neutral-bluish-00); font-size: 13px; line-height: 20px; overflow-wrap: break-word; pointer-events: none; animation: dt-tooltip-in 150ms ease-in-out; }\n@keyframes dt-tooltip-in { from { opacity: 0; } }\n.dt-rules { border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-rule { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; border-bottom: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-rule > :first-child { flex: 1; min-width: 0; }\n.dt-rule-preview { flex: 1; min-width: 0; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--dsw-alias-label-caption); }\n.dt-rule-switch { margin-top: 2px; flex: none; }\n.dt-rule-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dsw-alias-label-caption); }\n.dt-rule-dot[data-enabled] { background: var(--dsw-alias-brand-primary); }\n.dt-rule-body { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 8px 28px; }\n.dt-model { display: flex; flex-direction: column; gap: 6px; }\n.dt-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }\n.dt-changes { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 20px; }\n.dt-changes li::before { content: '· '; color: var(--dsw-alias-label-caption); }\n.dt-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }\n.dt-modal.dt-glossary-modal { width: min(680px, 100%); }\n.dt-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; }\n.dt-nav-item:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-nav-item[aria-current='true'] { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); font-weight: 500; }\n.dt-nav-item:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; }\n.dt-changed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dsw-alias-brand-primary); flex: none; }\n.dt-add-skill { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-prompt-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }\n.dt-editor { min-height: 360px; }\n.dt-inline-select { width: auto; }\n.dt-preview-part { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--dsw-alias-border-l3); }\n.dt-preview-head { font-size: 13px; line-height: 20px; display: flex; align-items: baseline; gap: 8px; }\ndiv.dt-preview-head { color: var(--dsw-alias-label-secondary); }\n.dt-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 16px; min-width: 0; }\n.dt-card-head { display: flex; align-items: center; gap: 12px; min-height: 28px; }\n.dt-card-head .dt-row-main { flex: 1 1 0; min-width: 64px; }\n.dt-card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }\n.dt-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }\n.dt-rows-item { display: grid; grid-template-columns: repeat(var(--dt-columns), minmax(0, 1fr)) auto; gap: 8px; align-items: center; }\n.dt-filter-gap { flex: 1; }\n.dt-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; width: 100%; }\n.dt-page-head > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }\n.dt-page-head .dt-toolbar { flex: 0 1 auto; margin-left: auto; }\n.dt-page-head > .dt-btn { margin-left: -10px; }\n.dt-page-title { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; width: 100%; }\n.dt-page-title h2 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 20px; line-height: 28px; font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }\n.dt-status-line { margin-top: -16px; }\n.dt-plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 20px; }\n.dt-plain-list > li { position: relative; padding-left: 12px; }\n.dt-plain-list > li::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 1px; background: currentColor; opacity: 0.45; }\n.dt-details { display: flex; flex-direction: column; gap: 2px; border-top: 0.5px solid var(--dsw-alias-border-l2); padding-top: 8px; }\n.dt-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-danger-zone .dt-btn { color: var(--dsw-alias-state-error-primary); }\n.dt-md { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }\n.dt-md p, .dt-md ul, .dt-md ol { margin: 0; }\n.dt-md ul, .dt-md ol { padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }\n.dt-md-heading { font-weight: 500; }\n.dt-code { font-family: var(--ds-font-family-code, Menlo, monospace); font-size: 12px; padding: 0 4px; border-radius: 4px; background: var(--dsw-alias-bg-module-platform); }\n.dt-dot-wrap { display: inline-flex; flex: none; }\n.dt-search-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }\n.dt-ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }\n.dt-legend-title { margin: 16px 0 6px; font-size: 13px; color: var(--dsw-alias-label-tertiary); }\n.dt-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }\n.dt-legend li { display: flex; align-items: center; gap: 6px; }\n.dt-legend .dt-dot { margin-top: 0; }\n.dt-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 0; background: var(--dsw-alias-bg-base, var(--dsw-alias-bg-layer-1)); border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-savebar .dt-hint { margin-right: auto; }\n.dt-card > .dt-savebar, .dt-block > .dt-savebar { margin: 0 -16px -16px; padding: 12px 16px; border-radius: 0 0 16px 16px; }\n.dt-glossary { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }\n.dt-glossary th, .dt-glossary td { text-align: left; padding: 6px 8px; border-bottom: 0.5px solid var(--dsw-alias-border-l2); vertical-align: top; }\n.dt-glossary th { color: var(--dsw-alias-label-tertiary); font-weight: 400; }\n.dt-glossary th.dt-glossary-group { color: var(--dsw-alias-label-secondary); font-weight: 600; padding-top: 14px; }\n.dt-glossary th:nth-child(-n+2), .dt-glossary td:nth-child(-n+2) { white-space: nowrap; }\n.dt-values { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0 0; font-size: 13px; }\n.dt-values dt { color: var(--dsw-alias-label-tertiary); }\n.dt-values dd { margin: 0; }\n.dt-pre { margin: 0; padding: 12px; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); font-family: var(--ds-font-family-code, Menlo, monospace); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; }\n.dt-pre ins { background: color-mix(in srgb, var(--dsw-alias-state-success-primary, green) 18%, transparent); text-decoration: none; }\n.dt-pre del { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 18%, transparent); text-decoration: none; }\n.dt-prompt { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }\n.dt-prompt-nav { display: flex; flex-direction: column; gap: 2px; }\n.dt-prompt-nav button { justify-content: flex-start; }\n.dt-disclosure-body { padding: 8px 0 8px 28px; display: flex; flex-direction: column; gap: 8px; }\n@container (max-width: 640px) {\n .dt-tab { padding: 0 8px; font-size: 13px; }\n .dt-segment { padding: 0 10px; }\n .dt-head { align-items: center; }\n .dt-search-results { right: auto; left: 0; width: 100%; }\n .dt-page-title h2 { font-size: 17px; line-height: 24px; }\n .dt-status-line { margin-top: -12px; }\n .dt-page .dt-tabs { display: flex; flex-wrap: nowrap; scrollbar-width: thin; }\n .dt-page .dt-tab { flex: none; }\n .dt-page .dt-tabs[data-more='end'] { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }\n .dt-page .dt-tabs[data-more='start'] { mask-image: linear-gradient(to right, transparent, #000 40px); }\n .dt-page .dt-tabs[data-more='both'] { mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }\n .dt-kv { grid-template-columns: 1fr; gap: 6px; }\n .dt-grid3, .dt-prompt { grid-template-columns: 1fr; }\n .dt-search { width: 100%; }\n .dt-filters .dt-search { margin-left: 0; }\n}\n/* Local UI primitive styles (see controls.tsx). */\n.dt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: none; border-radius: 18px; cursor: pointer; font: inherit; font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); background: transparent; padding: 0 14px; white-space: nowrap; }\n.dt-btn:disabled { cursor: not-allowed; opacity: 0.4; }\n.dt-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-btn-md { height: 36px; }\n.dt-btn-sm { height: 28px; font-size: 12px; line-height: 18px; padding: 0 10px; border-radius: 14px; }\n/* 主按钮:深色下 label-primary-foreground(深色)压绿底只有 4.09 —— 深色主题里前景该是浅的。 */\n/* 往白色混 70%:浅色下仍是浅字(4.5+),深色下变浅(>4.5),两边都过。 */\n.dt-btn-primary { background: var(--dsw-alias-button-primary-fill); color: color-mix(in srgb, var(--dsw-alias-label-primary-foreground) 30%, #ffffff); }\n.dt-btn-primary:hover:not(:disabled) { background: var(--dsw-alias-button-primary-hover); }\n.dt-btn-ghost { background: transparent; border: 0.5px solid var(--dsw-alias-border-l3); color: var(--dsw-alias-label-secondary); }\n.dt-btn-ghost:hover:not(:disabled), .dt-btn-outline:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-btn-ghost:active:not(:disabled) { background: var(--dsw-alias-interactive-bg-active); }\n.dt-btn-outline { border: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-btn-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }\n.dt-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 8px; font-size: 11px; line-height: 17px; font-weight: 500; white-space: nowrap; }\n.dt-tag[data-tone='outline'] { border: 0.5px solid var(--dsw-alias-border-l4); color: var(--dsw-alias-label-tertiary); }\n.dt-tag[data-tone='neutral'] { background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-secondary); }\n.dt-tag[data-tone='quiet'] { color: var(--dsw-alias-label-tertiary); }\n.dt-tag[data-tone='success'] { background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent); color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 72%, var(--dsw-alias-label-primary)); }\n.dt-tag[data-tone='info'] { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent); color: var(--dsw-alias-state-business-primary); }\n/* 胶囊是「暂停/退避/判断」唯一的状态色:文字与 12% 同色底叠起来,浅色下警告只有 4.17。 */\n/* 往 label-primary 混 28%:浅色变深、深色变浅,两档都留出余量。 */\n.dt-tag[data-tone='warning'] { background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent); color: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 72%, var(--dsw-alias-label-primary)); }\n.dt-tag[data-tone='danger'] { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent); color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 76%, var(--dsw-alias-label-primary)); }\n.dt-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: none; border-radius: 12px; font: inherit; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); cursor: pointer; }\n.dt-pill:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-pill-active, .dt-pill-active:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-button-ghost-active-fill); box-shadow: inset 0 0 0 1px var(--dsw-alias-button-ghost-active-border); }\n.dt-tabs { display: grid; padding: 4px; border-radius: 12px; background: var(--dsw-alias-bg-module-platform); }\n.dt-tab { box-sizing: border-box; height: 34px; padding: 0 12px; border: 0.5px solid transparent; border-radius: 8px; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 14px; line-height: 20px; white-space: nowrap; cursor: pointer; transition: color 180ms ease, background 180ms ease; }\n.dt-tab:hover { color: var(--dsw-alias-label-primary); }\n.dt-tab[aria-selected='true'] { color: var(--dsw-alias-label-primary); font-weight: 600; background: var(--dsw-alias-bg-layer-3); border-color: var(--dsw-alias-border-l3); }\n.dt-tab:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 4px; }\n.dt-segment { height: 28px; padding: 0 16px; border: 0; border-radius: 7px; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color 120ms ease, background 160ms ease; }\n.dt-segment:hover:not(:disabled), .dt-segment[aria-selected='true'] { color: var(--dsw-alias-label-primary); }\n.dt-segment[aria-selected='true'] { background: var(--dsw-alias-bg-layer-1); box-shadow: var(--dsw-elevation-soft); }\n.dt-segment:disabled { cursor: default; opacity: 0.4; }\n.dt-segment:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; }\n.dt-input { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 0; padding: 0 8px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.dt-input:focus-within { border-color: var(--dsw-alias-brand-primary); }\n.dt-input-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; color: var(--dsw-alias-label-tertiary); }\n.dt-input input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); }\n.dt-input input/* 占位符:label-dimmed 在浅色下只有 2.17(深色 3.81),必须能读出来才叫占位符。 */\n/* 往 label-tertiary 混 60%:浅色变深、深色变浅,两档都过 4.5。 */\n::placeholder { color: color-mix(in srgb, var(--dsw-alias-label-dimmed) 40%, var(--dsw-alias-label-tertiary)); }\n.dt-input input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }\n.dt-field .dt-input, .dt-search .dt-input, .dt-add-skill .dt-input { display: flex; width: 100%; }\n.dt-switch { box-sizing: border-box; flex: 0 0 auto; width: 36px; height: 20px; padding: 2px; border: 0; border-radius: 10px; background: var(--dsw-alias-border-l3); cursor: pointer; }\n.dt-switch[aria-checked='true'] { background: var(--dsw-alias-brand-primary); }\n.dt-switch:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-switch-thumb { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--dsw-alias-label-primary-foreground); transition: transform 120ms ease; }\n.dt-switch[aria-checked='true'] .dt-switch-thumb { transform: translateX(16px); }\n.dt-state-dot { position: relative; display: inline-block; flex: none; width: 10px; height: 10px; color: var(--dsw-alias-state-idle-primary); }\n.dt-state-dot::after { content: ''; position: absolute; inset: 20%; border-radius: 50%; background: currentColor; }\n.dt-state-dot[data-state='done'] { color: var(--dsw-alias-state-success-primary); }\n.dt-state-dot[data-state='warning'] { color: var(--dsw-alias-state-warn-primary); }\n.dt-state-dot[data-state='error'] { color: var(--dsw-alias-state-error-primary); }\n.dt-spinner { flex: none; color: var(--dsw-alias-label-tertiary); }\n.dt-spinner g { transform-origin: center; animation: dt-spin 1.5s linear infinite; }\n.dt-spinner circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.dt-spinner circle:first-child { opacity: 0.25; }\n.dt-spinner circle:last-child { stroke-dasharray: 18 150; }\n@keyframes dt-spin { to { transform: rotate(360deg); } }\n.dt-disclosure-row { display: flex; align-items: center; gap: 4px; min-height: 28px; min-width: 0; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); }\n.dt-disclosure-row:hover { color: var(--dsw-alias-label-primary); }\n.dt-disclosure-row:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-disclosure-lead { position: relative; display: inline-flex; flex: none; width: 24px; height: 24px; align-items: center; justify-content: center; }\n.dt-disclosure-icon { display: inline-flex; align-items: center; justify-content: center; }\n.dt-disclosure-chevron { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }\n.dt-disclosure-row:hover .dt-disclosure-icon, .dt-disclosure[data-open] .dt-disclosure-icon { visibility: hidden; }\n.dt-disclosure-row:hover .dt-disclosure-chevron, .dt-disclosure[data-open] .dt-disclosure-chevron { display: inline-flex; }\n.dt-disclosure-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-modal-root { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: max(24px, var(--dsh-frame-top-clearance, 24px)) 24px; }\n.dt-modal-mask { position: absolute; inset: 0; background: var(--dsw-alias-bg-mask-1); backdrop-filter: var(--dsw-mask-blur); }\n.dt-modal { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; width: min(380px, 100%); max-height: 100%; padding: 0 0 24px; overflow: hidden; border-radius: 24px; background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); color: var(--dsw-alias-label-primary); outline: none; }\n.dt-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 22px 14px 0 24px; }\n.dt-modal-header h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }\n.dt-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent; cursor: pointer; color: var(--dsw-alias-label-secondary); }\n.dt-modal-close:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-modal-description { margin: -8px 0 0; padding: 0 24px; font-size: 14px; line-height: 22px; }\n.dt-modal-body { min-width: 0; min-height: 0; overflow: auto; padding: 0 24px; }\n.dt-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 24px; }\n.dt-toast { position: fixed; top: 40px; left: 50%; z-index: 1100; pointer-events: none; width: max-content; max-width: min(640px, calc(100vw - 48px)); padding: 12px 16px; border-radius: 14px; background: var(--dsw-alias-toast-bg); color: var(--dsw-static-neutral-bluish-00); font-size: 14px; line-height: 22px; box-shadow: var(--dsw-shadow-lv3); transform: translateX(-50%); animation: dt-toast-in 160ms ease-out, dt-toast-fade 1000ms ease var(--dt-toast-hold, 3000ms) forwards; }\n@keyframes dt-toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }\n@keyframes dt-toast-fade { to { opacity: 0; visibility: hidden; } }\n@media (prefers-reduced-motion: reduce) {\n .dt-tab, .dt-segment, .dt-switch-thumb, .dt-spinner g, .dt-btn-busy .dt-btn-icon svg, .dt-tooltip { transition: none; animation: none; }\n .dt-toast { animation: dt-toast-fade 1000ms ease var(--dt-toast-hold, 3000ms) forwards; }\n}\n.dt-page .dt-tab { height: 34px; padding: 0 2px; border: 0; border-radius: 0; color: var(--dsw-alias-label-tertiary); font-size: 14px; }\n.dt-page .dt-tab[aria-selected='true'] { background: none; color: var(--dsw-alias-label-primary); font-weight: 500; box-shadow: inset 0 -1.5px 0 var(--dsw-alias-label-primary); }\n.dt-status-head { display: flex; align-items: center; gap: 8px; }\n.dt-status-title { margin: 0; flex: 1; display: flex; align-items: center; gap: 4px; font-size: 15px; line-height: 22px; font-weight: 600; }\n.dt-status-text { margin-left: auto; flex: none; font-size: 12px; font-weight: 400; color: var(--dsw-alias-label-secondary); }\n.dt-status-line .dt-status-text { margin-left: 0; }\n.dt-status-text[data-state='warning'] { color: var(--dsw-alias-state-warn-primary); }\n.dt-status-text[data-state='error'] { color: var(--dsw-alias-state-error-primary); }\n.dt-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n.dt-lv { white-space: nowrap; }\n.dt-lv-label { color: var(--dsw-alias-label-caption); }\n.dt-lv-value { color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }\n.dt-chip { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 6px; overflow: hidden; font-size: 11px; line-height: 18px; color: var(--dsw-alias-label-secondary); }\n.dt-chip-source { padding: 0 6px; color: var(--dsw-alias-label-tertiary); background: var(--dsw-alias-bg-module-platform); }\n.dt-chip-fact { padding: 0 6px; border-left: 0.5px solid var(--dsw-alias-border-l3); white-space: nowrap; }\n.dt-chip-label { margin-right: 4px; color: var(--dsw-alias-label-caption); }\n.dt-chip-link { position: relative; z-index: 1; text-decoration: none; cursor: pointer; transition: border-color 120ms ease; }\n.dt-chip-link:hover { border-color: var(--dsw-alias-brand-primary); }\n.dt-chip-link:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-chip-open { display: inline-flex; align-items: center; padding: 0 5px; border-left: 0.5px solid var(--dsw-alias-border-l3); color: var(--dsw-alias-brand-primary); }\n.dt-chip-problem, .dt-chip-problem .dt-chip-label { color: var(--dsw-alias-state-error-primary); }\n.dt-cards { gap: 8px; }\n.dt-att .dt-inline-link { font-size: 13px; font-weight: 500; }\n.dt-list > .dt-att { margin: 2px 8px; }\n.dt-att { padding: 10px 12px 10px 16px; border: 0; border-radius: 0; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-att::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: var(--dsw-alias-state-warn-primary); opacity: 0.7; }\n.dt-att-error::before { background: var(--dsw-alias-state-error-primary); }\n.dt-att-what { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-state-warn-primary); }\n.dt-att-error .dt-att-what, .dt-att-error .dt-att-what .dt-open { color: var(--dsw-alias-state-error-primary); }\n.dt-stats { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 10px 14px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 12px; background: var(--dsw-alias-bg-module-platform); }\n.dt-stat { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--dsw-alias-label-caption); }\n/* 可点的统计数字:去掉原生按钮外观,保留文字排版;选中时用浅底提示 */\n.dt-stat-btn { border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 8px; font: inherit; color: inherit; cursor: pointer; }\n.dt-stat-btn:hover { background: var(--dsw-alias-interactive-bg-hover); }\n/* 浅色下 interactive-bg-hover 与白底只差 1.03:点了统计数字在按筛选,零视觉反馈。 */\n/* 换成品牌色 12% 底 + 0.5px 品牌色描边(两个主题都分得开)。 */\n.dt-stat-btn[aria-pressed='true'] { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); box-shadow: inset 0 0 0 0.5px var(--dsw-alias-brand-primary); }\n.dt-stat-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n/* 统计条单位:按钮上的 color:inherit 会把单位染成数字色,所以单位单独一档。 */\n/* 浅色下 caption(#818b98)在白底只有 3.14–3.45,深色下同一档 4.34–5.07。 */\n/* 往 label-primary 混 30%:浅色变深、深色变浅,两个主题的对比度同时变好(不用新 token)。 */\n/* 注意选择器**不带** .dt-stat-btn 前缀 —— 带前缀就只作用于可点的格子,不可点的仍是旧色(真机踩过)。 */\n.dt-stat-unit { color: color-mix(in srgb, var(--dsw-alias-label-caption) 70%, var(--dsw-alias-label-primary)); }\n/* 选中的统计格:品牌色 12% 底会把单位压到 4.20,再往主色多混 10% 拉回来。 */\n.dt-stat-btn[aria-pressed='true'] .dt-stat-unit { color: color-mix(in srgb, var(--dsw-alias-label-caption) 58%, var(--dsw-alias-label-primary)); }\n.dt-stat-value { font-size: 14px; font-weight: 500; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }\n.dt-more-link { font-size: 12px; font-weight: 400; }\n.dt-settings { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; align-items: start; }\n.dt-settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }\n.dt-settings-link { padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; }\n.dt-settings-link:hover { color: var(--dsw-alias-label-primary); }\n.dt-settings-link[aria-current='page'] { background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-primary); font-weight: 500; }\n.dt-settings-link[data-stage] + .dt-settings-link:not([data-stage]) { margin-top: 10px; }\n.dt-settings-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 16px; background: var(--dsw-alias-bg-layer-1); }\n.dt-settings-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }\n.dt-settings-body .dt-section-title { font-size: 15px; line-height: 22px; }\n.dt-subtabs { display: flex; gap: 16px; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-subtab { padding: 0 0 6px; border: 0; background: none; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 13px; cursor: pointer; }\n.dt-subtab[aria-selected='true'] { color: var(--dsw-alias-label-primary); font-weight: 500; box-shadow: inset 0 -1.5px 0 var(--dsw-alias-label-primary); }\n.dt-part { display: flex; flex-direction: column; gap: 12px; }\n.dt-rows-summary { text-align: left; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }\n.dt-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 18px; }\n.dt-table th { text-align: left; font-weight: 400; color: var(--dsw-alias-label-caption); padding: 2px 8px 2px 0; }\n.dt-table td { padding: 4px 8px 4px 0; border-top: 0.5px solid var(--dsw-alias-border-l3); vertical-align: top; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }\n@container (max-width: 640px) {\n .dt-settings { grid-template-columns: 1fr; gap: 12px; }\n .dt-settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }\n .dt-settings-link[data-stage] + .dt-settings-link:not([data-stage]) { margin-top: 0; }\n .dt-page .dt-tabs { gap: 14px; }\n}\n.dt-list > .dt-ticket { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px; align-items: start; margin: 0; padding: 12px 8px 12px 18px; border-radius: 0; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-list > .dt-ticket[data-state]::before { content: ''; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; border-radius: 1px; background: var(--dsw-alias-state-warn-primary); opacity: 0.7; }\n.dt-list > .dt-ticket[data-state='error']::before { background: var(--dsw-alias-state-error-primary); }\n.dt-ticket-stage { align-self: stretch; padding-top: 1px; border-right: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-ticket-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }\n.dt-ticket-body .dt-row-title .dt-open { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-ticket-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }\n.dt-ticket-meta .dt-chip { flex: none; }\n.dt-ticket-meta .dt-ticket-actions { margin-top: 0; margin-left: auto; min-height: 0; flex-wrap: nowrap; }\n@container (max-width: 640px) { .dt-ticket-meta { flex-wrap: wrap; white-space: normal; } .dt-ticket-meta .dt-ticket-actions { flex-wrap: wrap; } }\n.dt-ticket-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--dsw-alias-label-primary); }\n.dt-ticket-note-error { color: var(--dsw-alias-state-error-primary); }\n.dt-ticket-note-pause { font-weight: 500; color: var(--dsw-alias-state-warn-primary); }\n.dt-ticket-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; margin-top: 2px; }\n/* Pass pointer events through action containers to the row link, keeping only child controls interactive. */\n.dt-ticket-actions, .dt-row-buttons, .dt-row-actions { pointer-events: none; }\n.dt-ticket-actions > *, .dt-row-buttons > *, .dt-row-actions > * { pointer-events: auto; }\n.dt-line { min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.dt-row-meta.dt-line { flex-wrap: nowrap; }\n.dt-line-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-error-text { color: var(--dsw-alias-state-error-primary); }\n.dt-stage { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }\n.dt-stage svg { flex: none; margin-top: 2px; }\n.dt-stage[data-state='warning'] { color: var(--dsw-alias-state-warn-primary); }\n.dt-stage[data-state='error'] { color: var(--dsw-alias-state-error-primary); }\n.dt-stage[data-state='ongoing'] { color: var(--dsw-alias-state-business-primary); }\n.dt-icon-link { display: inline-flex; align-items: center; gap: 4px; }\na.dt-btn, a.dt-btn:hover { text-decoration: none; }\n.dt-section-icon { display: inline-flex; align-self: center; color: var(--dsw-alias-label-tertiary); }\n.dt-trigger-link { display: flex; flex-direction: column; gap: 2px; width: 100%; margin: -4px 0 -4px -8px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }\n.dt-trigger-link:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-trigger-link:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-trigger-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n.dt-kv-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.dt-banner-actions { margin-top: 6px; }\n@container (max-width: 640px) {\n .dt-list > .dt-ticket { grid-template-columns: 1fr; row-gap: 4px; }\n .dt-ticket-stage { border-right: 0; }\n}\n.dt-nav-group { margin: 10px 10px 2px; font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-secondary); }\n.dt-nav-group:first-child { margin-top: 0; }\n.dt-prompt-nav .dt-nav-item { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }\n.dt-nav-item > span { display: inline-flex; align-items: center; gap: 6px; }\n.dt-nav-item small { font-size: 12px; line-height: 18px; font-weight: 400; color: var(--dsw-alias-label-caption); }\n.dt-preview-part[data-editable] { border-left-color: var(--dsw-alias-brand-primary); }\n.dt-preview-head b { font-weight: 500; }\n.dt-preview-head > span { font-size: 12px; color: var(--dsw-alias-label-caption); }\n.dt-changed-tag { margin-left: 6px; padding: 0 5px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 4px; font-size: 11px; line-height: 16px; font-weight: 400; color: var(--dsw-alias-label-secondary); }\n.dt-updated-tag { border-color: var(--dsw-alias-state-warn-primary); color: var(--dsw-alias-state-warn-primary); }\n.dt-default-updated { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--dsw-alias-state-warn-primary); }\n.dt-diff-fold { color: var(--dsw-alias-label-caption); font-style: italic; }\n.dt-compare { margin-left: auto; }\n.dt-admission th { white-space: nowrap; }\n.dt-admission thead tr:first-child th:not(:first-child) { color: var(--dsw-alias-label-secondary); font-weight: 500; }\n.dt-admission td { vertical-align: middle; }\n.dt-admission-scope { color: var(--dsw-alias-label-primary); font-size: 13px; }\n.dt-admission-scope small { display: block; font-size: 11px; color: var(--dsw-alias-label-caption); }\n.dt-admission-na { color: var(--dsw-alias-label-caption); }\n.dt-admission-cell { display: flex; align-items: center; gap: 4px; }\n.dt-admission-cell .dt-select { flex: 1; min-width: 0; }\n.dt-admission-slot { display: inline-flex; flex: none; width: 16px; }\n.dt-info-warn { color: var(--dsw-alias-state-warn-primary); }\n.dt-field-segmented { max-width: 240px; }\n/* 活跃时段:两个原生 time 选择器 + 全天按钮 */\n/* 表单控件不必满宽:短数字撑到 900px 只会显得空 */\n.dt-form > .dt-field > .dt-input { max-width: 480px; }\n.dt-error-card { border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 35%, var(--dsw-alias-border-l3)); }\n.dt-error-card .dt-card-title { color: var(--dsw-alias-state-error-primary); }\n/* 空态引导:圆形步骤号 + 标题 + 说明,替代「① + 列表符号」的重复 */\n.dt-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: none; }\n.dt-step { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }\n.dt-step-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }\n.dt-step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.dt-step-title { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--dsw-alias-label-primary); }\n.dt-empty { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 12px; }\n.dt-step-detail { font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }\n.dt-hours { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.dt-time { box-sizing: border-box; height: 32px; padding: 0 8px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }\n.dt-time:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-hours-sep { color: var(--dsw-alias-label-tertiary); }\n.dt-hours-hint { font-size: 12px; color: var(--dsw-alias-label-caption); }\n/* 分诊信号表(设置 → 诊断):左列「名字 + 两个标签」成组,右列 `+N 分` 定宽贴右、数字等宽。只挂局部类,全局 .dt-row-title 一行没动 —— 别的列表还在用它。 */\n.dt-signal-title { display: grid; grid-template-columns: minmax(0, 1fr) 4.5em; align-items: baseline; column-gap: 12px; }\n.dt-signal-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }\n.dt-signal-meta { display: block; justify-self: stretch; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }\n/* 同一个维度(默认开/关)的两档要等权:`默认关` 原本是 49×19 的裸字,`默认开` 是 51×21 的描边胶囊。 */\n.dt-signal-lead .dt-tag[data-tone='quiet'] { border: 0.5px solid var(--dsw-alias-border-l4); }\n";
120
+ const PORTED_CSS = "/* Panel layout and local UI controls styled with DSH `--dsw-alias-*` design tokens; one rule per line. */\n.dt-page { box-sizing: border-box; height: 100%; overflow: auto; scrollbar-gutter: stable; scroll-padding: 48px 0 72px; container-type: inline-size; padding: 28px clamp(24px, 4vw, 48px) 0; color: var(--dsw-alias-label-primary); }\n/* Deployment page rendered inside DSH Plugin Manager, which owns scrolling and padding. */\n.dt-embedded { container-type: inline-size; color: var(--dsw-alias-label-primary); }\n/* Disable sticky positioning inside DSH Plugin Manager, where the host container owns scrolling and bottom padding. */\n.dt-embedded .dt-savebar { position: static; }\n.dt-page > * + * { margin-top: 16px; }\n.dt-page > .dt-column { max-width: 960px; margin: 0 auto; padding-bottom: 48px; display: flex; flex-direction: column; gap: 24px; }\n.dt-head { position: relative; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }\n.dt-search { position: relative; width: 240px; max-width: 100%; }\n.dt-search-results { position: absolute; top: calc(100% + 6px); right: 0; width: min(560px, 90cqw); max-height: 60vh; overflow: auto; padding: 8px 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 12px; background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); z-index: 5; display: flex; flex-direction: column; gap: 8px; }\n.dt-mark { background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 25%, transparent); color: inherit; border-radius: 2px; }\n[data-platform='darwin'] .dt-page .dt-head { padding-top: var(--dsh-frame-top-clearance, 0px); }\n.dt-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--dsw-alias-label-secondary); }\n.dt-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }\n.dt-page .dt-tabs { overflow-x: auto; display: flex; gap: 20px; max-width: none; padding: 0; border-radius: 0; background: none; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-segmented { width: 100%; max-width: 420px; box-sizing: border-box; display: inline-grid; gap: 2px; padding: 3px; border-radius: 9px; background: var(--dsw-alias-interactive-bg-hover); }\n.dt-form.dt-block { padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 16px; gap: 16px; }\n.dt-block-title { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }\n.dt-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }\n.dt-section-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--dsw-alias-label-primary); }\n.dt-section-name { white-space: nowrap; }\n.dt-count { font-size: 14px; color: var(--dsw-alias-label-caption); font-variant-numeric: tabular-nums; font-weight: 400; } .dt-section-sub { font-size: 12px; line-height: 18px; font-weight: 400; color: var(--dsw-alias-label-caption); }\n.dt-hint { margin: 0; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-tertiary); }\n.dt-error { margin: 0; font-size: 13px; line-height: 20px; color: var(--dsw-alias-state-error-primary); }\n.dt-banner { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 20px; background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 10%, transparent); overflow-wrap: anywhere; }\n.dt-banner.dt-danger { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent); color: var(--dsw-alias-state-error-primary); }\n.dt-list { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }\n.dt-row { position: relative; min-width: 0; border-radius: 12px; padding: 10px 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-start; }\n.dt-row.dt-link:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-row-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }\n.dt-disclosure-body .dt-row-main { flex-basis: 0; }\n.dt-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; }\n.dt-open { max-width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-open::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }\n.dt-open:focus-visible { outline: none; }\n.dt-open-wrap { white-space: normal; }\n.dt-open:focus-visible::after { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-caption); overflow-wrap: anywhere; }\n.dt-row-quote { font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n/* Transparent block borders preserve vertical spacing when line clamping clips padding. */\n.dt-banner:is(.dt-clamp, .dt-clamp-8) { padding-block: 0; border-block: 8px solid transparent; }\n.dt-banner-label { font-weight: 500; }\n.dt-banner .dt-md { display: inline; }\n.dt-banner .dt-md > p:first-child { display: inline; }\n.dt-row-buttons { position: relative; z-index: 1; gap: 8px; margin-top: 4px; }\n.dt-row-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; font-size: 13px; line-height: 20px; }\n.dt-dot { flex: none; margin-top: 5px; }\n.dt-inline-link { position: relative; z-index: 1; color: var(--dsw-alias-link); text-decoration: none; }\n.dt-inline-link:hover { text-decoration: underline; }\n.dt-textlink { padding: 0; border: 0; background: none; font: inherit; color: var(--dsw-alias-link); cursor: pointer; text-align: left; }\n.dt-textlink:hover { text-decoration: underline; }\n.dt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 20px; }\n.dt-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; line-height: 20px; }\n.dt-kv dt { color: var(--dsw-alias-label-tertiary); }\n.dt-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }\n@container (max-width: 640px) { .dt-kv dt { margin-top: 4px; } .dt-kv dt:first-of-type { margin-top: 0; } }\n.dt-timeline-day { position: sticky; top: 0; z-index: 1; padding: 6px 0 2px; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); font-weight: 500; list-style: none; background: var(--dsw-alias-bg-base); }\n.dt-event-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }\n.dt-event-head .dt-event-time { margin-left: auto; flex: none; font-size: 12px; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }\n.dt-event-nums { color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }\n.dt-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }\n.dt-event { padding: 12px 0; border-bottom: 0.5px solid var(--dsw-alias-border-l2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }\n.dt-event:last-child { border-bottom: 0; }\n.dt-event.dt-highlight { background: var(--dsw-alias-interactive-bg-hover); border-radius: 8px; padding-inline: 8px; margin-inline: -8px; }\n.dt-event-text { margin: 0; font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }\n.dt-event-actor { font-weight: 500; color: var(--dsw-alias-label-secondary); }\n.dt-event-quiet .dt-event-text { color: var(--dsw-alias-label-tertiary); }\n.dt-flow { margin: 0; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); }\n.dt-clamp-8 { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }\n.dt-more { align-self: flex-start; font-size: 12px; }\n.dt-reveal { opacity: 0; }\n.dt-event:hover .dt-reveal, .dt-reveal:focus-visible { opacity: 1; }\n@media (hover: none) {\n .dt-reveal { opacity: 1; }\n}\n.dt-event-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }\n.dt-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.dt-filters .dt-search { margin-left: auto; }\n.dt-form { display: flex; flex-direction: column; gap: 24px; }\n.dt-fieldset { display: flex; flex-direction: column; gap: inherit; min-width: 0; margin: 0; padding: 0; border: 0; }\n.dt-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 20px; min-width: 0; }\n.dt-field small { color: var(--dsw-alias-label-caption); font-size: 12px; }\n.dt-textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-1, transparent); resize: vertical; }\n.dt-select { box-sizing: border-box; width: 100%; min-width: 0; height: 32px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 8px; padding: 0 28px 0 8px; text-overflow: ellipsis; font: inherit; font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-1, transparent); }\n.dt-textarea:focus-visible, .dt-select:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-mono { font-family: var(--ds-font-family-code, Menlo, monospace); font-size: 12px; overflow-wrap: anywhere; }\n.dt-detail { margin-top: 2px; color: var(--dsw-alias-label-secondary); }\n.dt-savebar .dt-error { white-space: pre-line; }\n.dt-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; font-size: 13px; }\n.dt-subhead-actions { display: inline-flex; align-items: center; gap: 4px; }\n.dt-btn-busy .dt-btn-icon svg { animation: dt-spin 1s linear infinite; }\n.dt-subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); }\n.dt-rules, .dt-changes { list-style: none; margin: 0; padding: 0; }\n.dt-field-head { display: inline-flex; align-items: center; gap: 4px; color: var(--dsw-alias-label-secondary); }\n.dt-info { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--dsw-alias-label-caption); cursor: help; }\n.dt-info:hover, .dt-info:focus-visible { color: var(--dsw-alias-label-secondary); }\n.dt-info:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; border-radius: 50%; }\n.dt-tooltip { position: fixed; z-index: 1100; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 3px 7px; border-radius: 8px; background: var(--dsw-alias-tooltip-bg); color: var(--dsw-static-neutral-bluish-00); font-size: 13px; line-height: 20px; overflow-wrap: break-word; pointer-events: none; animation: dt-tooltip-in 150ms ease-in-out; }\n@keyframes dt-tooltip-in { from { opacity: 0; } }\n.dt-rules { border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-rule { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; border-bottom: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-rule > :first-child { flex: 1; min-width: 0; }\n.dt-rule-preview { flex: 1; min-width: 0; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--dsw-alias-label-caption); }\n.dt-rule-switch { margin-top: 2px; flex: none; }\n.dt-rule-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dsw-alias-label-caption); }\n.dt-rule-dot[data-enabled] { background: var(--dsw-alias-brand-primary); }\n.dt-rule-body { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 8px 28px; }\n.dt-model { display: flex; flex-direction: column; gap: 6px; }\n.dt-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }\n.dt-changes { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 20px; }\n.dt-changes li::before { content: '· '; color: var(--dsw-alias-label-caption); }\n.dt-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }\n.dt-modal.dt-glossary-modal { width: min(680px, 100%); }\n.dt-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; }\n.dt-nav-item:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-nav-item[aria-current='true'] { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); font-weight: 500; }\n.dt-nav-item:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; }\n.dt-changed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dsw-alias-brand-primary); flex: none; }\n.dt-add-skill { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-prompt-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }\n.dt-editor { min-height: 360px; }\n.dt-inline-select { width: auto; }\n.dt-preview-part { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--dsw-alias-border-l3); }\n.dt-preview-head { font-size: 13px; line-height: 20px; display: flex; align-items: baseline; gap: 8px; }\ndiv.dt-preview-head { color: var(--dsw-alias-label-secondary); }\n.dt-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 16px; min-width: 0; }\n.dt-card-head { display: flex; align-items: center; gap: 12px; min-height: 28px; }\n.dt-card-head .dt-row-main { flex: 1 1 0; min-width: 64px; }\n.dt-card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }\n.dt-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }\n.dt-rows-item { display: grid; grid-template-columns: repeat(var(--dt-columns), minmax(0, 1fr)) auto; gap: 8px; align-items: center; }\n.dt-filter-gap { flex: 1; }\n.dt-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; width: 100%; }\n.dt-page-head > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }\n.dt-page-head .dt-toolbar { flex: 0 1 auto; margin-left: auto; }\n.dt-page-head > .dt-btn { margin-left: -10px; }\n.dt-page-title { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; width: 100%; }\n.dt-page-title h2 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 20px; line-height: 28px; font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }\n.dt-status-line { margin-top: -16px; }\n.dt-plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 20px; }\n.dt-plain-list > li { position: relative; padding-left: 12px; }\n.dt-plain-list > li::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 1px; background: currentColor; opacity: 0.45; }\n.dt-details { display: flex; flex-direction: column; gap: 2px; border-top: 0.5px solid var(--dsw-alias-border-l2); padding-top: 8px; }\n.dt-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-danger-zone .dt-btn { color: var(--dsw-alias-state-error-primary); }\n.dt-md { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }\n.dt-md p, .dt-md ul, .dt-md ol { margin: 0; }\n.dt-md ul, .dt-md ol { padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }\n.dt-md-heading { font-weight: 500; }\n.dt-code { font-family: var(--ds-font-family-code, Menlo, monospace); font-size: 12px; padding: 0 4px; border-radius: 4px; background: var(--dsw-alias-bg-module-platform); }\n.dt-dot-wrap { display: inline-flex; flex: none; }\n.dt-search-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }\n.dt-ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }\n.dt-legend-title { margin: 16px 0 6px; font-size: 13px; color: var(--dsw-alias-label-tertiary); }\n.dt-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }\n.dt-legend li { display: flex; align-items: center; gap: 6px; }\n.dt-legend .dt-dot { margin-top: 0; }\n.dt-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 0; background: var(--dsw-alias-bg-base, var(--dsw-alias-bg-layer-1)); border-top: 0.5px solid var(--dsw-alias-border-l2); }\n.dt-savebar .dt-hint { margin-right: auto; }\n.dt-card > .dt-savebar, .dt-block > .dt-savebar { margin: 0 -16px -16px; padding: 12px 16px; border-radius: 0 0 16px 16px; }\n.dt-glossary { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }\n.dt-glossary th, .dt-glossary td { text-align: left; padding: 6px 8px; border-bottom: 0.5px solid var(--dsw-alias-border-l2); vertical-align: top; }\n.dt-glossary th { color: var(--dsw-alias-label-tertiary); font-weight: 400; }\n.dt-glossary th.dt-glossary-group { color: var(--dsw-alias-label-secondary); font-weight: 600; padding-top: 14px; }\n.dt-glossary th:nth-child(-n+2), .dt-glossary td:nth-child(-n+2) { white-space: nowrap; }\n.dt-values { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0 0; font-size: 13px; }\n.dt-values dt { color: var(--dsw-alias-label-tertiary); }\n.dt-values dd { margin: 0; }\n.dt-pre { margin: 0; padding: 12px; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); font-family: var(--ds-font-family-code, Menlo, monospace); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; }\n.dt-pre ins { background: color-mix(in srgb, var(--dsw-alias-state-success-primary, green) 18%, transparent); text-decoration: none; }\n.dt-pre del { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 18%, transparent); text-decoration: none; }\n.dt-prompt { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }\n.dt-prompt-nav { display: flex; flex-direction: column; gap: 2px; }\n.dt-prompt-nav button { justify-content: flex-start; }\n.dt-disclosure-body { padding: 8px 0 8px 28px; display: flex; flex-direction: column; gap: 8px; }\n@container (max-width: 640px) {\n .dt-tab { padding: 0 8px; font-size: 13px; }\n .dt-segment { padding: 0 10px; }\n .dt-head { align-items: center; }\n .dt-search-results { right: auto; left: 0; width: 100%; }\n .dt-page-title h2 { font-size: 17px; line-height: 24px; }\n .dt-status-line { margin-top: -12px; }\n .dt-page .dt-tabs { display: flex; flex-wrap: nowrap; scrollbar-width: thin; }\n .dt-page .dt-tab { flex: none; }\n .dt-page .dt-tabs[data-more='end'] { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }\n .dt-page .dt-tabs[data-more='start'] { mask-image: linear-gradient(to right, transparent, #000 40px); }\n .dt-page .dt-tabs[data-more='both'] { mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }\n .dt-kv { grid-template-columns: 1fr; gap: 6px; }\n .dt-grid3, .dt-prompt { grid-template-columns: 1fr; }\n .dt-search { width: 100%; }\n .dt-filters .dt-search { margin-left: 0; }\n}\n/* Local UI primitive styles (see controls.tsx). */\n.dt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: none; border-radius: 18px; cursor: pointer; font: inherit; font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); background: transparent; padding: 0 14px; white-space: nowrap; }\n.dt-btn:disabled { cursor: not-allowed; opacity: 0.4; }\n.dt-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-btn-md { height: 36px; }\n.dt-btn-sm { height: 28px; font-size: 12px; line-height: 18px; padding: 0 10px; border-radius: 14px; }\n/* 主按钮:深色下 label-primary-foreground(深色)压绿底只有 4.09 —— 深色主题里前景该是浅的。 */\n/* 往白色混 70%:浅色下仍是浅字(4.5+),深色下变浅(>4.5),两边都过。 */\n.dt-btn-primary { background: var(--dsw-alias-button-primary-fill); color: var(--dsw-static-neutral-bluish-00); }\n.dt-btn-primary:hover:not(:disabled) { background: var(--dsw-alias-button-primary-hover); }\n.dt-btn-ghost { background: transparent; border: 0.5px solid var(--dsw-alias-border-l3); color: var(--dsw-alias-label-secondary); }\n.dt-btn-ghost:hover:not(:disabled), .dt-btn-outline:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-btn-ghost:active:not(:disabled) { background: var(--dsw-alias-interactive-bg-active); }\n.dt-btn-outline { border: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-btn-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }\n.dt-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 8px; font-size: 11px; line-height: 17px; font-weight: 500; white-space: nowrap; }\n.dt-tag[data-tone='outline'] { border: 0.5px solid var(--dsw-alias-border-l4); color: var(--dsw-alias-label-tertiary); }\n.dt-tag[data-tone='neutral'] { background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-secondary); }\n.dt-tag[data-tone='quiet'] { color: var(--dsw-alias-label-tertiary); }\n.dt-tag[data-tone='success'] { background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent); color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 72%, var(--dsw-alias-label-primary)); }\n.dt-tag[data-tone='info'] { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent); color: var(--dsw-alias-state-business-primary); }\n/* 胶囊是「暂停/退避/判断」唯一的状态色:文字与 12% 同色底叠起来,浅色下警告只有 4.17。 */\n/* 往 label-primary 混 28%:浅色变深、深色变浅,两档都留出余量。 */\n.dt-tag[data-tone='warning'] { background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent); color: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 72%, var(--dsw-alias-label-primary)); }\n.dt-tag[data-tone='danger'] { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent); color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 76%, var(--dsw-alias-label-primary)); }\n.dt-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: none; border-radius: 12px; font: inherit; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); cursor: pointer; }\n.dt-pill:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-pill-active, .dt-pill-active:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-button-ghost-active-fill); box-shadow: inset 0 0 0 1px var(--dsw-alias-button-ghost-active-border); }\n.dt-tabs { display: grid; padding: 4px; border-radius: 12px; background: var(--dsw-alias-bg-module-platform); }\n.dt-tab { box-sizing: border-box; height: 34px; padding: 0 12px; border: 0.5px solid transparent; border-radius: 8px; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 14px; line-height: 20px; white-space: nowrap; cursor: pointer; transition: color 180ms ease, background 180ms ease; }\n.dt-tab:hover { color: var(--dsw-alias-label-primary); }\n.dt-tab[aria-selected='true'] { color: var(--dsw-alias-label-primary); font-weight: 600; background: var(--dsw-alias-bg-layer-3); border-color: var(--dsw-alias-border-l3); }\n.dt-tab:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 4px; }\n.dt-segment { height: 28px; padding: 0 16px; border: 0; border-radius: 7px; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color 120ms ease, background 160ms ease; }\n.dt-segment:hover:not(:disabled), .dt-segment[aria-selected='true'] { color: var(--dsw-alias-label-primary); }\n.dt-segment[aria-selected='true'] { background: var(--dsw-alias-bg-layer-1); box-shadow: var(--dsw-elevation-soft); }\n.dt-segment:disabled { cursor: default; opacity: 0.4; }\n.dt-segment:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; }\n.dt-input { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 0; padding: 0 8px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.dt-input:focus-within { border-color: var(--dsw-alias-brand-primary); }\n.dt-input-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; color: var(--dsw-alias-label-tertiary); }\n.dt-input input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); }\n.dt-input input/* 占位符:label-dimmed 在浅色下只有 2.17(深色 3.81),必须能读出来才叫占位符。 */\n/* 往 label-tertiary 混 60%:浅色变深、深色变浅,两档都过 4.5。 */\n::placeholder { color: color-mix(in srgb, var(--dsw-alias-label-dimmed) 40%, var(--dsw-alias-label-tertiary)); }\n.dt-input input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }\n.dt-field .dt-input, .dt-search .dt-input, .dt-add-skill .dt-input { display: flex; width: 100%; }\n.dt-switch { box-sizing: border-box; flex: 0 0 auto; width: 36px; height: 20px; padding: 2px; border: 0; border-radius: 10px; background: var(--dsw-alias-border-l3); cursor: pointer; }\n.dt-switch[aria-checked='true'] { background: var(--dsw-alias-brand-primary); }\n.dt-switch:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-switch-thumb { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--dsw-alias-label-primary-foreground); transition: transform 120ms ease; }\n.dt-switch[aria-checked='true'] .dt-switch-thumb { transform: translateX(16px); }\n.dt-state-dot { position: relative; display: inline-block; flex: none; width: 10px; height: 10px; color: var(--dsw-alias-state-idle-primary); }\n.dt-state-dot::after { content: ''; position: absolute; inset: 20%; border-radius: 50%; background: currentColor; }\n.dt-state-dot[data-state='done'] { color: var(--dsw-alias-state-success-primary); }\n.dt-state-dot[data-state='warning'] { color: var(--dsw-alias-state-warn-primary); }\n.dt-state-dot[data-state='error'] { color: var(--dsw-alias-state-error-primary); }\n.dt-spinner { flex: none; color: var(--dsw-alias-label-tertiary); }\n.dt-spinner g { transform-origin: center; animation: dt-spin 1.5s linear infinite; }\n.dt-spinner circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.dt-spinner circle:first-child { opacity: 0.25; }\n.dt-spinner circle:last-child { stroke-dasharray: 18 150; }\n@keyframes dt-spin { to { transform: rotate(360deg); } }\n.dt-disclosure-row { display: flex; align-items: center; gap: 4px; min-height: 28px; min-width: 0; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary); }\n.dt-disclosure-row:hover { color: var(--dsw-alias-label-primary); }\n.dt-disclosure-row:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dt-disclosure-lead { position: relative; display: inline-flex; flex: none; width: 24px; height: 24px; align-items: center; justify-content: center; }\n.dt-disclosure-icon { display: inline-flex; align-items: center; justify-content: center; }\n.dt-disclosure-chevron { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }\n.dt-disclosure-row:hover .dt-disclosure-icon, .dt-disclosure[data-open] .dt-disclosure-icon { visibility: hidden; }\n.dt-disclosure-row:hover .dt-disclosure-chevron, .dt-disclosure[data-open] .dt-disclosure-chevron { display: inline-flex; }\n.dt-disclosure-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-modal-root { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: max(24px, var(--dsh-frame-top-clearance, 24px)) 24px; }\n.dt-modal-mask { position: absolute; inset: 0; background: var(--dsw-alias-bg-mask-1); backdrop-filter: var(--dsw-mask-blur); }\n.dt-modal { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; width: min(380px, 100%); max-height: 100%; padding: 0 0 24px; overflow: hidden; border-radius: 24px; background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); color: var(--dsw-alias-label-primary); outline: none; }\n.dt-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 22px 14px 0 24px; }\n.dt-modal-header h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }\n.dt-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent; cursor: pointer; color: var(--dsw-alias-label-secondary); }\n.dt-modal-close:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-modal-description { margin: -8px 0 0; padding: 0 24px; font-size: 14px; line-height: 22px; }\n.dt-modal-body { min-width: 0; min-height: 0; overflow: auto; padding: 0 24px; }\n.dt-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 24px; }\n.dt-toast { position: fixed; top: 40px; left: 50%; z-index: 1100; pointer-events: none; width: max-content; max-width: min(640px, calc(100vw - 48px)); padding: 12px 16px; border-radius: 14px; background: var(--dsw-alias-toast-bg); color: var(--dsw-static-neutral-bluish-00); font-size: 14px; line-height: 22px; box-shadow: var(--dsw-shadow-lv3); transform: translateX(-50%); animation: dt-toast-in 160ms ease-out, dt-toast-fade 1000ms ease var(--dt-toast-hold, 3000ms) forwards; }\n@keyframes dt-toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }\n@keyframes dt-toast-fade { to { opacity: 0; visibility: hidden; } }\n@media (prefers-reduced-motion: reduce) {\n .dt-tab, .dt-segment, .dt-switch-thumb, .dt-spinner g, .dt-btn-busy .dt-btn-icon svg, .dt-tooltip { transition: none; animation: none; }\n .dt-toast { animation: dt-toast-fade 1000ms ease var(--dt-toast-hold, 3000ms) forwards; }\n}\n.dt-page .dt-tab { height: 34px; padding: 0 2px; border: 0; border-radius: 0; color: var(--dsw-alias-label-tertiary); font-size: 14px; }\n.dt-page .dt-tab[aria-selected='true'] { background: none; color: var(--dsw-alias-label-primary); font-weight: 500; box-shadow: inset 0 -1.5px 0 var(--dsw-alias-label-primary); }\n.dt-status-head { display: flex; align-items: center; gap: 8px; }\n.dt-status-title { margin: 0; flex: 1; display: flex; align-items: center; gap: 4px; font-size: 15px; line-height: 22px; font-weight: 600; }\n.dt-status-text { margin-left: auto; flex: none; font-size: 12px; font-weight: 400; color: var(--dsw-alias-label-secondary); }\n.dt-status-line .dt-status-text { margin-left: 0; }\n.dt-status-text[data-state='warning'] { color: var(--dsw-alias-state-warn-primary); }\n.dt-status-text[data-state='error'] { color: var(--dsw-alias-state-error-primary); }\n.dt-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n.dt-lv { white-space: nowrap; }\n.dt-lv-label { color: var(--dsw-alias-label-caption); }\n.dt-lv-value { color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }\n.dt-chip { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 6px; overflow: hidden; font-size: 11px; line-height: 18px; color: var(--dsw-alias-label-secondary); }\n.dt-chip-source { padding: 0 6px; color: var(--dsw-alias-label-tertiary); background: var(--dsw-alias-bg-module-platform); }\n.dt-chip-fact { padding: 0 6px; border-left: 0.5px solid var(--dsw-alias-border-l3); white-space: nowrap; }\n.dt-chip-label { margin-right: 4px; color: var(--dsw-alias-label-caption); }\n.dt-chip-link { position: relative; z-index: 1; text-decoration: none; cursor: pointer; transition: border-color 120ms ease; }\n.dt-chip-link:hover { border-color: var(--dsw-alias-brand-primary); }\n.dt-chip-link:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-chip-open { display: inline-flex; align-items: center; padding: 0 5px; border-left: 0.5px solid var(--dsw-alias-border-l3); color: var(--dsw-alias-brand-primary); }\n.dt-chip-problem, .dt-chip-problem .dt-chip-label { color: var(--dsw-alias-state-error-primary); }\n.dt-cards { gap: 8px; }\n.dt-att .dt-inline-link { font-size: 13px; font-weight: 500; }\n.dt-list > .dt-att { margin: 2px 8px; }\n.dt-att { padding: 10px 12px 10px 16px; border: 0; border-radius: 0; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-att::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: var(--dsw-alias-state-warn-primary); opacity: 0.7; }\n.dt-att-error::before { background: var(--dsw-alias-state-error-primary); }\n.dt-att-what { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-state-warn-primary); }\n.dt-att-error .dt-att-what, .dt-att-error .dt-att-what .dt-open { color: var(--dsw-alias-state-error-primary); }\n.dt-stats { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 10px 14px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 12px; background: var(--dsw-alias-bg-module-platform); }\n.dt-stat { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--dsw-alias-label-caption); }\n/* 可点的统计数字:去掉原生按钮外观,保留文字排版;选中时用浅底提示 */\n.dt-stat-btn { border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 8px; font: inherit; color: inherit; cursor: pointer; }\n.dt-stat-btn:hover { background: var(--dsw-alias-interactive-bg-hover); }\n/* 浅色下 interactive-bg-hover 与白底只差 1.03:点了统计数字在按筛选,零视觉反馈。 */\n/* 换成品牌色 12% 底 + 0.5px 品牌色描边(两个主题都分得开)。 */\n.dt-stat-btn[aria-pressed='true'] { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); box-shadow: inset 0 0 0 0.5px var(--dsw-alias-brand-primary); }\n.dt-stat-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n/* 统计条单位:按钮上的 color:inherit 会把单位染成数字色,所以单位单独一档。 */\n/* 浅色下 caption(#818b98)在白底只有 3.14–3.45,深色下同一档 4.34–5.07。 */\n/* 往 label-primary 混 30%:浅色变深、深色变浅,两个主题的对比度同时变好(不用新 token)。 */\n/* 注意选择器**不带** .dt-stat-btn 前缀 —— 带前缀就只作用于可点的格子,不可点的仍是旧色(真机踩过)。 */\n.dt-stat-unit { color: color-mix(in srgb, var(--dsw-alias-label-caption) 70%, var(--dsw-alias-label-primary)); }\n/* 选中的统计格:品牌色 12% 底会把单位压到 4.20,再往主色多混 10% 拉回来。 */\n.dt-stat-btn[aria-pressed='true'] .dt-stat-unit { color: color-mix(in srgb, var(--dsw-alias-label-caption) 58%, var(--dsw-alias-label-primary)); }\n.dt-stat-value { font-size: 14px; font-weight: 500; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }\n.dt-more-link { font-size: 12px; font-weight: 400; }\n.dt-settings { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; align-items: start; }\n.dt-settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }\n.dt-settings-link { padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; }\n.dt-settings-link:hover { color: var(--dsw-alias-label-primary); }\n.dt-settings-link[aria-current='page'] { background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-primary); font-weight: 500; }\n.dt-settings-link[data-stage] + .dt-settings-link:not([data-stage]) { margin-top: 10px; }\n.dt-settings-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 16px; background: var(--dsw-alias-bg-layer-1); }\n.dt-settings-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }\n.dt-settings-body .dt-section-title { font-size: 15px; line-height: 22px; }\n.dt-subtabs { display: flex; gap: 16px; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-subtab { padding: 0 0 6px; border: 0; background: none; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 13px; cursor: pointer; }\n.dt-subtab[aria-selected='true'] { color: var(--dsw-alias-label-primary); font-weight: 500; box-shadow: inset 0 -1.5px 0 var(--dsw-alias-label-primary); }\n.dt-part { display: flex; flex-direction: column; gap: 12px; }\n.dt-rows-summary { text-align: left; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }\n.dt-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 18px; }\n.dt-table th { text-align: left; font-weight: 400; color: var(--dsw-alias-label-caption); padding: 2px 8px 2px 0; }\n.dt-table td { padding: 4px 8px 4px 0; border-top: 0.5px solid var(--dsw-alias-border-l3); vertical-align: top; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }\n@container (max-width: 640px) {\n .dt-settings { grid-template-columns: 1fr; gap: 12px; }\n .dt-settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }\n .dt-settings-link[data-stage] + .dt-settings-link:not([data-stage]) { margin-top: 0; }\n .dt-page .dt-tabs { gap: 14px; }\n}\n.dt-list > .dt-ticket { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px; align-items: start; margin: 0; padding: 12px 8px 12px 18px; border-radius: 0; border-bottom: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-list > .dt-ticket[data-state]::before { content: ''; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; border-radius: 1px; background: var(--dsw-alias-state-warn-primary); opacity: 0.7; }\n.dt-list > .dt-ticket[data-state='error']::before { background: var(--dsw-alias-state-error-primary); }\n.dt-ticket-stage { align-self: stretch; padding-top: 1px; border-right: 0.5px solid var(--dsw-alias-border-l3); }\n.dt-ticket-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }\n.dt-ticket-body .dt-row-title .dt-open { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dt-ticket-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }\n.dt-ticket-meta .dt-chip { flex: none; }\n.dt-ticket-meta .dt-ticket-actions { margin-top: 0; margin-left: auto; min-height: 0; flex-wrap: nowrap; }\n@container (max-width: 640px) { .dt-ticket-meta { flex-wrap: wrap; white-space: normal; } .dt-ticket-meta .dt-ticket-actions { flex-wrap: wrap; } }\n.dt-ticket-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--dsw-alias-label-primary); }\n.dt-ticket-note-error { color: var(--dsw-alias-state-error-primary); }\n.dt-ticket-note-pause { font-weight: 500; color: var(--dsw-alias-state-warn-primary); }\n.dt-ticket-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; margin-top: 2px; }\n/* Pass pointer events through action containers to the row link, keeping only child controls interactive. */\n.dt-ticket-actions, .dt-row-buttons, .dt-row-actions { pointer-events: none; }\n.dt-ticket-actions > *, .dt-row-buttons > *, .dt-row-actions > * { pointer-events: auto; }\n.dt-line { min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.dt-row-meta.dt-line { flex-wrap: nowrap; }\n.dt-line-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-label-secondary); }\n.dt-error-text { color: var(--dsw-alias-state-error-primary); }\n.dt-stage { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }\n.dt-stage svg { flex: none; margin-top: 2px; }\n.dt-stage[data-state='warning'] { color: var(--dsw-alias-state-warn-primary); }\n.dt-stage[data-state='error'] { color: var(--dsw-alias-state-error-primary); }\n.dt-stage[data-state='ongoing'] { color: var(--dsw-alias-state-business-primary); }\n.dt-icon-link { display: inline-flex; align-items: center; gap: 4px; }\na.dt-btn, a.dt-btn:hover { text-decoration: none; }\n.dt-section-icon { display: inline-flex; align-self: center; color: var(--dsw-alias-label-tertiary); }\n.dt-trigger-link { display: flex; flex-direction: column; gap: 2px; width: 100%; margin: -4px 0 -4px -8px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }\n.dt-trigger-link:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dt-trigger-link:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-trigger-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n.dt-kv-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.dt-banner-actions { margin-top: 6px; }\n@container (max-width: 640px) {\n .dt-list > .dt-ticket { grid-template-columns: 1fr; row-gap: 4px; }\n .dt-ticket-stage { border-right: 0; }\n}\n.dt-nav-group { margin: 10px 10px 2px; font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-secondary); }\n.dt-nav-group:first-child { margin-top: 0; }\n.dt-prompt-nav .dt-nav-item { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }\n.dt-nav-item > span { display: inline-flex; align-items: center; gap: 6px; }\n.dt-nav-item small { font-size: 12px; line-height: 18px; font-weight: 400; color: var(--dsw-alias-label-caption); }\n.dt-preview-part[data-editable] { border-left-color: var(--dsw-alias-brand-primary); }\n.dt-preview-head b { font-weight: 500; }\n.dt-preview-head > span { font-size: 12px; color: var(--dsw-alias-label-caption); }\n.dt-changed-tag { margin-left: 6px; padding: 0 5px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 4px; font-size: 11px; line-height: 16px; font-weight: 400; color: var(--dsw-alias-label-secondary); }\n.dt-updated-tag { border-color: var(--dsw-alias-state-warn-primary); color: var(--dsw-alias-state-warn-primary); }\n.dt-default-updated { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--dsw-alias-state-warn-primary); }\n.dt-diff-fold { color: var(--dsw-alias-label-caption); font-style: italic; }\n.dt-compare { margin-left: auto; }\n.dt-admission th { white-space: nowrap; }\n.dt-admission thead tr:first-child th:not(:first-child) { color: var(--dsw-alias-label-secondary); font-weight: 500; }\n.dt-admission td { vertical-align: middle; }\n.dt-admission-scope { color: var(--dsw-alias-label-primary); font-size: 13px; }\n.dt-admission-scope small { display: block; font-size: 11px; color: var(--dsw-alias-label-caption); }\n.dt-admission-na { color: var(--dsw-alias-label-caption); }\n.dt-admission-cell { display: flex; align-items: center; gap: 4px; }\n.dt-admission-cell .dt-select { flex: 1; min-width: 0; }\n.dt-admission-slot { display: inline-flex; flex: none; width: 16px; }\n.dt-info-warn { color: var(--dsw-alias-state-warn-primary); }\n.dt-field-segmented { max-width: 240px; }\n/* 活跃时段:两个原生 time 选择器 + 全天按钮 */\n/* 表单控件不必满宽:短数字撑到 900px 只会显得空 */\n.dt-form > .dt-field > .dt-input { max-width: 480px; }\n.dt-error-card { border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 35%, var(--dsw-alias-border-l3)); }\n.dt-error-card .dt-card-title { color: var(--dsw-alias-state-error-primary); }\n/* 空态引导:圆形步骤号 + 标题 + 说明,替代「① + 列表符号」的重复 */\n.dt-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: none; }\n.dt-step { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }\n.dt-step-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }\n.dt-step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.dt-step-title { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--dsw-alias-label-primary); }\n.dt-empty { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: 12px; }\n.dt-step-detail { font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }\n.dt-hours { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.dt-time { box-sizing: border-box; height: 32px; padding: 0 8px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }\n.dt-time:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }\n.dt-hours-sep { color: var(--dsw-alias-label-tertiary); }\n.dt-hours-hint { font-size: 12px; color: var(--dsw-alias-label-caption); }\n/* 分诊信号表(设置 → 诊断):左列「名字 + 两个标签」成组,右列 `+N 分` 定宽贴右、数字等宽。只挂局部类,全局 .dt-row-title 一行没动 —— 别的列表还在用它。 */\n.dt-signal-title { display: grid; grid-template-columns: minmax(0, 1fr) 4.5em; align-items: baseline; column-gap: 12px; }\n.dt-signal-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }\n.dt-signal-meta { display: block; justify-self: stretch; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }\n/* 同一个维度(默认开/关)的两档要等权:`默认关` 原本是 49×19 的裸字,`默认开` 是 51×21 的描边胶囊。 */\n.dt-signal-lead .dt-tag[data-tone='quiet'] { border: 0.5px solid var(--dsw-alias-border-l4); }\n";
121
121
 
122
122
  /** 把移植过来的样式挂到 document 上,只挂一次。 */
123
123
  /**
@@ -240,7 +240,7 @@ window.__ModuleLoader__.load({
240
240
  const cx = (...names) => names.filter(Boolean).join(' ')
241
241
 
242
242
  function Btn({ variant = 'ghost', size = 'md', icon, children, className, ...rest }) {
243
- // className 必须最后合并:之前 ...rest 直接覆盖,导致 ConfirmBtn 的删除按钮丢掉全部样式
243
+ // className 必须最后合并:之前 ...rest 直接覆盖,导致 ConfirmButton 的删除按钮丢掉全部样式
244
244
  return h('button', { type: 'button', ...rest, className: cx('dt-btn', 'dt-btn-' + variant, 'dt-btn-' + size, className) },
245
245
  icon !== undefined ? h('span', { className: 'dt-btn-icon' }, icon) : null,
246
246
  children)
@@ -287,10 +287,10 @@ window.__ModuleLoader__.load({
287
287
  h('input', rest))
288
288
  }
289
289
 
290
- function Toggle({ checked, onChange, label }) {
290
+ function Toggle({ checked, onChange, label, id, disabled }) {
291
291
  return h('button', {
292
- type: 'button', role: 'switch', 'aria-checked': !!checked, 'aria-label': label,
293
- className: 'dt-switch', onClick: () => onChange(!checked),
292
+ id, type: 'button', role: 'switch', 'aria-checked': !!checked, 'aria-label': label,
293
+ className: 'dt-switch', disabled, onClick: () => onChange(!checked),
294
294
  }, h('span', { className: 'dt-switch-thumb' }))
295
295
  }
296
296
 
@@ -432,6 +432,258 @@ window.__ModuleLoader__.load({
432
432
 
433
433
  const Hint = ({ children }) => h('p', { className: 'dt-hint' }, children)
434
434
 
435
+ // ── L84c WatcherForm:新增与行内编辑共用的一份字段 schema 与草稿控件 ──
436
+ // 这里刻意不引入 DSH InlineEditor:watcher 是多字段表单,不是单文本编辑器。
437
+ const AUTHOR_LIST_PLACEHOLDER = 'GitHub 登录名,逗号分隔,留空 = 谁都算'
438
+ const PRIORITY_LABEL = '优先级(在「单次最多唤醒条数」内先挑谁)'
439
+ const CREATE_WATCHER_VALUES = {
440
+ repo: '', intervalSec: '60', labels: '', ignoreLabels: '', assignee: '',
441
+ activeHours: '', goal: '', ackLabel: '', onlyAssigned: false, allowAuthors: '',
442
+ observe: false, isolated: false, workdir: '', batchLimit: '', maxWakesPerHour: '',
443
+ sessionMaxWakes: '', isolateKeepDays: '', maxIsolated: '',
444
+ priorityReopened: true, priorityComments: true, priorityLabels: true,
445
+ priorityUnassigned: false, priorityStale: false,
446
+ }
447
+ const watcherNumberText = (value) => value === undefined || value === null || value === '' ? '' : String(value)
448
+ const numberOrUndefined = (value) => {
449
+ if (value === undefined || value === null || String(value).trim() === '') return undefined
450
+ const parsed = Number(value)
451
+ return Number.isFinite(parsed) ? parsed : undefined
452
+ }
453
+ const watcherValuesFrom = (watcher) => ({
454
+ repo: watcher.repo || '',
455
+ intervalSec: watcherNumberText(watcher.intervalSec ?? 60),
456
+ labels: (watcher.filters && Array.isArray(watcher.filters.labels) ? watcher.filters.labels : []).join(','),
457
+ ignoreLabels: (watcher.filters && Array.isArray(watcher.filters.ignoreLabels) ? watcher.filters.ignoreLabels : []).join(','),
458
+ assignee: (watcher.filters && watcher.filters.assignee) || '',
459
+ activeHours: watcher.activeHours || '',
460
+ goal: watcher.note || (typeof watcher.goal === 'string' ? watcher.goal : (watcher.goal && watcher.goal.objective) || ''),
461
+ ackLabel: watcher.ackLabel || (watcher.provider === 'gitee' ? '主理鱼-已处理' : '主理鱼:已处理'),
462
+ onlyAssigned: !!(watcher.filters && watcher.filters.onlyAssigned),
463
+ allowAuthors: (watcher.filters && Array.isArray(watcher.filters.allowAuthors) ? watcher.filters.allowAuthors : []).join(', '),
464
+ observe: !!watcher.observe,
465
+ isolated: !!watcher.isolated,
466
+ workdir: watcher.workdir || '',
467
+ batchLimit: watcherNumberText(watcher.batchLimit),
468
+ maxWakesPerHour: watcherNumberText(watcher.maxWakesPerHour),
469
+ sessionMaxWakes: watcherNumberText(watcher.sessionMaxWakes),
470
+ isolateKeepDays: watcherNumberText(watcher.isolateKeepDays),
471
+ maxIsolated: watcherNumberText(watcher.maxIsolated),
472
+ priorityReopened: (watcher.priority && watcher.priority.reopened) !== false,
473
+ priorityComments: (watcher.priority && watcher.priority.comments) !== false,
474
+ priorityLabels: (watcher.priority && watcher.priority.labels) !== false,
475
+ priorityUnassigned: Boolean(watcher.priority && watcher.priority.unassigned) === true,
476
+ priorityStale: Boolean(watcher.priority && watcher.priority.stale) === true,
477
+ })
478
+ const watcherSameValue = (left, right) => String(left ?? '') === String(right ?? '')
479
+ const watcherDirty = (value, snapshot) => Object.keys(snapshot || {}).some((key) => !watcherSameValue(value && value[key], snapshot[key]))
480
+
481
+ // label/hint/note/control 的顺序只在这里声明一次;两个调用点只负责提供值与回调。
482
+ const WATCHER_FIELD_SCHEMA = [
483
+ { key: 'repo', label: '仓库', kind: 'text', modes: ['create'], required: true, placeholder: 'owner/name,或 gitee:owner/name' },
484
+ { key: 'intervalSec', label: '间隔(秒)', kind: 'number', min: 30, max: 3600, required: true, hint: '多长时间检查一次这个仓库,最小 30 秒' },
485
+ { key: 'labels', label: '只处理这些标签', kind: 'text', placeholder: '逗号分隔,留空 = 全部' },
486
+ { key: 'ignoreLabels', label: '排除这些标签', kind: 'text', placeholder: '逗号分隔,留空 = 不排除', hint: '命中任意一个就跳过,优先级高于上面的白名单' },
487
+ { key: 'allowAuthors', label: '只理这些人提的', kind: 'text', placeholder: AUTHOR_LIST_PLACEHOLDER, hint: '不在名单里的人提的 issue/PR 不会叫醒你(Gitee 也可以填)' },
488
+ { key: 'activeHours', label: '活跃时段', kind: 'hours', hint: '只在这个时间段内唤醒;窗口外只攒条目,不打扰' },
489
+ { key: 'goal', label: '目标/规则', kind: 'text', placeholder: '可选,会附在唤醒消息里' },
490
+ { key: 'ackLabel', label: '已处理标签', kind: 'text', placeholder: '主理鱼:已处理', hint: 'watch_ack 会把同名标签打到 issue/PR 上;改名字等于换一套已处理标记' },
491
+ { key: 'onlyAssigned', label: '只看已指派', kind: 'switch', hint: '只处理已指派给人的条目' },
492
+ { key: 'assignee', label: '只看指派给谁', kind: 'text', when: (value) => !!value.onlyAssigned, placeholder: 'GitHub 登录名,留空 = 只要有指派就行' },
493
+ { key: 'observe', label: '仅观察', kind: 'switch', hint: '仅观察(只记录本会唤醒哪几条,不真唤醒)' },
494
+ { key: 'isolated', label: '隔离执行', kind: 'switch', hint: ISOLATED_HINT },
495
+ { key: 'batchLimit', label: '单次最多唤醒条数', kind: 'number', advanced: true, min: 1, max: 20, placeholder: (defaults) => String(defaults.batchLimit ?? 5) + '(1-20)' },
496
+ { key: 'maxWakesPerHour', label: '每小时最多唤醒次数', kind: 'number', advanced: true, min: 1, max: 60, placeholder: (defaults) => String(defaults.maxWakesPerHour ?? 6) + '(1-60)' },
497
+ { key: 'sessionMaxWakes', label: '这条会话每小时最多被唤醒', kind: 'number', advanced: true, min: 1, max: 60, placeholder: (defaults) => String(defaults.sessionMaxWakes ?? 12) + '(1-60)', hint: '跨所有守累计:守 5 个仓库时,光有单守上限挡不住叠加' },
498
+ { key: 'priority', label: PRIORITY_LABEL, kind: 'priority', advanced: true, hint: '全部关掉时按 GitHub 的「最近更新」顺序处理' },
499
+ { key: 'workdir', label: '隔离工作目录', kind: 'text', advanced: true, when: (value) => !!value.isolated, placeholder: '绝对路径,留空 = 当前工作目录' },
500
+ { key: 'isolateKeepDays', label: '隔离区保留天数', kind: 'number', advanced: true, when: (value) => !!value.isolated, min: 1, max: 30, placeholder: (defaults) => String(defaults.isolateKeepDays ?? 3) + '(1-30)', hint: '每次唤醒前回收这个天数之前的一次性工作区;留空用默认天数' },
501
+ { key: 'maxIsolated', label: '最多保留几个隔离区', kind: 'number', advanced: true, when: (value) => !!value.isolated, min: 1, max: 50, placeholder: '5(1-50)', hint: '天数之外的第二道线:超出就回收最旧的(不影响正在用的那个)' },
502
+ ]
503
+
504
+ /** superagent Field 的 DOM:label 与 InfoTip 是兄弟节点,控件拿同一个唯一 id。 */
505
+ let watcherFieldSerial = 0
506
+ function Field({ id, label, hint, note, children }) {
507
+ const generated = useRef(null)
508
+ if (!generated.current) {
509
+ watcherFieldSerial += 1
510
+ generated.current = id || ('dt-watcher-field-' + watcherFieldSerial)
511
+ }
512
+ const fieldId = id || generated.current
513
+ const child = Array.isArray(children) ? children[0] : children
514
+ const control = child && typeof child === 'object'
515
+ ? { ...child, props: { ...(child.props || {}), id: (child.props && child.props.id) || fieldId } }
516
+ : child
517
+ return h('div', { className: 'dt-field' },
518
+ h('span', { className: 'dt-field-head' },
519
+ h('label', { htmlFor: fieldId }, label),
520
+ hint ? h(InfoTip, { text: hint }) : null),
521
+ control,
522
+ note ? h('small', null, note) : null)
523
+ }
524
+
525
+ /** superagent Fields:保存期间由原生 fieldset 统一禁用所有字段。 */
526
+ function Fields({ disabled, children }) {
527
+ return h('fieldset', { className: 'dt-fieldset', disabled: !!disabled }, children)
528
+ }
529
+
530
+ /** superagent SaveBar 的精简草稿状态:clean 不挂载,dirty/busy/error 才挂载。 */
531
+ function SaveBar({ dirty, busy, error, disabled, onDiscard, onSave, saveLabel = '保存' }) {
532
+ if (!dirty && !busy && !error) return null
533
+ return h('div', { className: 'dt-savebar' },
534
+ error
535
+ ? h('p', { className: 'dt-error', role: 'alert' }, error)
536
+ : h('p', { className: 'dt-hint', 'aria-live': 'polite' }, busy ? '保存中…' : '未保存'),
537
+ h(Btn, { size: 'sm', variant: 'ghost', disabled: !dirty || !!busy || !!disabled, onClick: onDiscard }, '放弃'),
538
+ h(Btn, { size: 'sm', variant: 'primary', type: 'submit', disabled: !dirty || !!busy || !!disabled, onClick: onSave }, busy ? '保存中…' : saveLabel))
539
+ }
540
+
541
+ /** derived HoursField:两个原生时间控件,Field 的 label 只关联起始控件。 */
542
+ function HoursField({ value, onChange, id, disabled }) {
543
+ const match = String(value || '').match(/^(\d{1,2}):(\d{2})\s*-\s*(\d{1,2}):(\d{2})$/)
544
+ const start = match ? String(match[1]).padStart(2, '0') + ':' + match[2] : ''
545
+ const end = match ? String(match[3]).padStart(2, '0') + ':' + match[4] : ''
546
+ const write = (nextStart, nextEnd) => onChange(nextStart && nextEnd ? nextStart + '-' + nextEnd : '')
547
+ const overnight = Boolean(start && end && end <= start)
548
+ return h('div', { className: 'dt-hours' },
549
+ h('input', {
550
+ id, type: 'time', className: 'dt-time', value: start, 'aria-label': '起始时间', disabled,
551
+ onChange: (event) => write(event.target.value, end || '23:00'),
552
+ }),
553
+ h('span', { className: 'dt-hours-sep' }, '→'),
554
+ h('input', {
555
+ id: id ? id + '-end' : undefined, type: 'time', className: 'dt-time', value: end, 'aria-label': '结束时间', disabled,
556
+ onChange: (event) => write(start || '09:00', event.target.value),
557
+ }),
558
+ value
559
+ ? h('button', {
560
+ type: 'button', className: 'dt-btn dt-btn-sm dt-btn-ghost', disabled,
561
+ onClick: () => onChange(''),
562
+ }, '全天')
563
+ : h('span', { className: 'dt-hours-hint' }, '留空 = 全天'),
564
+ overnight ? h('span', { className: 'dt-hours-hint' }, '跨夜窗口') : null)
565
+ }
566
+
567
+ function WatcherSwitch({ spec, value, onChange, disabled, id }) {
568
+ return h('div', { className: 'dt-switch-row' },
569
+ h('div', { className: 'dt-field-head' }, h('span', null, spec.label), spec.hint ? h(InfoTip, { text: spec.hint }) : null),
570
+ h(Toggle, { id, checked: !!value, onChange, label: spec.label, disabled }),
571
+ // 隔离的回收语义原本是可见说明,不能因迁移到 SwitchRow 而藏进 tooltip。
572
+ spec.key === 'isolated' ? h('span', { className: 'dt-hint' }, spec.hint) : null)
573
+ }
574
+
575
+ function WatcherPriority({ value, onChange, disabled, idPrefix }) {
576
+ const items = [
577
+ ['priorityReopened', '重开优先', '被重开的排最前'],
578
+ ['priorityComments', '评论优先', '有人在等回应的靠前'],
579
+ ['priorityLabels', '标签优先', '带标签的靠前'],
580
+ ['priorityUnassigned', '未认领优先', '没人认领的靠前(默认关:这是我们的判断,不是规则)'],
581
+ ['priorityStale', '积压优先', '躺了 30 天以上的靠前(默认关,只展示)'],
582
+ ]
583
+ return h('div', { className: 'dt-actions' },
584
+ h('div', { className: 'dt-field-head' }, h('span', null, PRIORITY_LABEL),
585
+ h(InfoTip, { text: '全部关掉时按 GitHub 的「最近更新」顺序处理' })),
586
+ h('div', { className: 'dt-actions' }, items.map(([key, label, hint]) => h('div', { className: 'dt-switch-row', key },
587
+ h('div', { className: 'dt-field-head' }, h('span', null, hint)),
588
+ h(Toggle, { id: idPrefix + '-' + key, checked: key === 'priorityUnassigned' || key === 'priorityStale' ? value[key] === true : value[key] !== false,
589
+ onChange: (next) => onChange(key, next), label, disabled })))))
590
+ }
591
+
592
+ function WatcherForm({ mode = 'edit', idPrefix = 'watcher', value, snapshot, defaults = {}, disabled = false,
593
+ onChange, onSave, onDiscard, submitLabel = '保存', sessionId }) {
594
+ const [advancedOpen, setAdvancedOpen] = useState(false)
595
+ const [busy, setBusy] = useState(false)
596
+ const [error, setError] = useState(null)
597
+ const busyRef = useRef(false)
598
+ const values = value || {}
599
+ const opening = snapshot || values
600
+ const dirty = watcherDirty(values, opening)
601
+ const change = (key, next) => { setError(null); onChange(key, next) }
602
+ const submit = async (event) => {
603
+ if (event && typeof event.preventDefault === 'function') event.preventDefault()
604
+ // 原生点击保存时仍执行 constraints;测试桩没有 form,直接走同一提交函数。
605
+ const form = event && event.currentTarget && event.currentTarget.form
606
+ if (form && typeof form.checkValidity === 'function' && !form.checkValidity()) return false
607
+ if (busyRef.current || disabled || (mode === 'edit' && !dirty)) return false
608
+ if (mode === 'create' && (!sessionId || !String(values.repo || '').trim())) return false
609
+ busyRef.current = true
610
+ setBusy(true)
611
+ setError(null)
612
+ try {
613
+ const result = await onSave(values)
614
+ if (result === false) throw new Error('保存失败,请重试')
615
+ return result
616
+ } catch (failure) {
617
+ setError(String((failure && failure.message) || failure || '保存失败,请重试'))
618
+ return false
619
+ } finally {
620
+ busyRef.current = false
621
+ setBusy(false)
622
+ }
623
+ }
624
+ const discard = () => {
625
+ if (busyRef.current) return
626
+ setError(null)
627
+ onDiscard(opening)
628
+ }
629
+ const renderField = (spec) => {
630
+ if (spec.modes && !spec.modes.includes(mode)) return null
631
+ if (spec.when && !spec.when(values)) return null
632
+ const id = idPrefix + '-' + spec.key
633
+ if (spec.kind === 'switch') {
634
+ return h(WatcherSwitch, { key: spec.key, spec, value: values[spec.key], disabled: busy || disabled, id,
635
+ onChange: (next) => change(spec.key, next) })
636
+ }
637
+ if (spec.kind === 'priority') {
638
+ return h(WatcherPriority, { key: spec.key, value: values, disabled: busy || disabled, idPrefix,
639
+ onChange: change })
640
+ }
641
+ const common = {
642
+ value: spec.kind === 'hours' ? (values[spec.key] || '') : watcherNumberText(values[spec.key]),
643
+ disabled: busy || disabled,
644
+ onChange: (next) => change(spec.key, next),
645
+ }
646
+ const control = spec.kind === 'hours'
647
+ ? h(HoursField, common)
648
+ : h(Input, {
649
+ type: spec.kind === 'number' ? 'number' : 'text',
650
+ value: common.value,
651
+ min: spec.min, max: spec.max, step: spec.kind === 'number' ? 1 : undefined,
652
+ required: !!spec.required,
653
+ placeholder: typeof spec.placeholder === 'function' ? spec.placeholder(defaults) : spec.placeholder,
654
+ disabled: busy || disabled,
655
+ onChange: (event) => change(spec.key, event.target.value),
656
+ })
657
+ return h(Field, { key: spec.key, id, label: spec.label, hint: spec.hint, note: spec.note }, control)
658
+ }
659
+ const basic = WATCHER_FIELD_SCHEMA.filter((spec) => !spec.advanced).map(renderField)
660
+ const advanced = WATCHER_FIELD_SCHEMA.filter((spec) => spec.advanced).map(renderField)
661
+ const collapsedAdvanced = h('span', { className: 'dt-row-meta' },
662
+ h('span', { className: 'dt-hint' }, '限额、优先级与隔离保留策略'),
663
+ // 收起时只展示默认值摘要,不挂载高级 input;默认值仍来自 /state.defaults。
664
+ WATCHER_FIELD_SCHEMA.filter((spec) => spec.advanced && spec.kind === 'number').map((spec) => {
665
+ const placeholder = typeof spec.placeholder === 'function' ? spec.placeholder(defaults) : spec.placeholder
666
+ return h('span', { key: spec.key, className: 'dt-hint', placeholder }, spec.label + ' ' + placeholder)
667
+ }))
668
+ const submitFromClick = (event) => submit(event)
669
+ return h('form', { id: idPrefix, className: 'dt-form', 'data-mode': mode, onSubmit: submit },
670
+ h(Fields, { disabled: busy || disabled },
671
+ basic,
672
+ h(DisclosureRow, {
673
+ icon: h(Icon, { name: 'settings' }), title: '高级设置', open: advancedOpen,
674
+ onToggle: () => { if (!busy && !disabled) setAdvancedOpen(!advancedOpen) },
675
+ collapsedContent: collapsedAdvanced,
676
+ }, h('div', { className: 'dt-disclosure-body' }, advanced))),
677
+ h(SaveBar, { dirty, busy, error, disabled, onDiscard: discard, onSave: submitFromClick, saveLabel: submitLabel }),
678
+ // 新建空白表单也要给入口;开始输入后由 SaveBar 接管,不在屏幕上重复两个提交按钮。
679
+ mode === 'create' && !dirty && !busy && !error
680
+ ? h('div', { className: 'dt-actions' }, h(Btn, {
681
+ variant: 'primary', icon: h(Icon, { name: 'plus' }), type: 'submit', onClick: submitFromClick,
682
+ 'aria-label': submitLabel, disabled: disabled || !String(values.repo || '').trim(),
683
+ }, submitLabel))
684
+ : null)
685
+ }
686
+
435
687
  function KeyValues({ rows }) {
436
688
  return h('dl', { className: 'dt-kv' },
437
689
  rows.filter(Boolean).flatMap(([key, value]) => [
@@ -455,9 +707,12 @@ window.__ModuleLoader__.load({
455
707
  }
456
708
  }
457
709
 
458
- function Modal({ open, title, children, onClose }) {
710
+ function Modal({ open, title, description, footer, className, children, onClose }) {
459
711
  const dialog = useRef(null)
460
712
  const restoreTo = useRef(null)
713
+ // 与官方 controls.tsx 一致:回调放 ref,父组件轮询重渲染不能重建 effect、抢走弹层里的焦点。
714
+ const close = useRef(onClose)
715
+ close.current = onClose
461
716
  useEffect(() => {
462
717
  if (!open || typeof document === 'undefined') return undefined
463
718
  restoreTo.current = document.activeElement
@@ -469,7 +724,7 @@ window.__ModuleLoader__.load({
469
724
  ;(first || node).focus()
470
725
  }, 0)
471
726
  const onKey = (event) => {
472
- if (event.key === 'Escape') { event.preventDefault(); onClose(); return }
727
+ if (event.key === 'Escape') { event.preventDefault(); close.current(); return }
473
728
  if (event.key === 'Tab' && dialog.current) trapTab(event, dialog.current)
474
729
  }
475
730
  document.addEventListener('keydown', onKey)
@@ -479,38 +734,70 @@ window.__ModuleLoader__.load({
479
734
  const back = restoreTo.current
480
735
  if (back && typeof back.focus === 'function') { try { back.focus() } catch {} }
481
736
  }
482
- }, [open, onClose])
737
+ }, [open])
483
738
  if (!open) return null
484
739
  // class 必须与移植来的官方 CSS 对齐:dt-modal-root / dt-modal-mask / dt-modal-header
485
740
  return h('div', { className: 'dt-modal-root' },
486
741
  h('div', { className: 'dt-modal-mask', role: 'presentation', onClick: onClose }),
487
742
  h('div', {
488
743
  ref: dialog, tabIndex: -1,
489
- className: 'dt-modal', role: 'dialog', 'aria-modal': 'true',
744
+ className: cx('dt-modal', className), role: 'dialog', 'aria-modal': 'true',
490
745
  'aria-label': typeof title === 'string' ? title : undefined,
491
746
  },
492
747
  h('div', { className: 'dt-modal-header' },
493
748
  h('span', { className: 'dt-title' }, title),
494
749
  h('button', { type: 'button', className: 'dt-modal-close', onClick: onClose, 'aria-label': '关闭' }, h(Icon, { name: 'close' }))),
495
- h('div', { className: 'dt-modal-body' }, children)))
750
+ description ? h('p', { className: 'dt-modal-description' }, description) : null,
751
+ children !== undefined && children !== null ? h('div', { className: 'dt-modal-body' }, children) : null,
752
+ footer !== undefined ? h('div', { className: 'dt-modal-footer' }, footer) : null))
496
753
  }
497
754
 
498
- /** 危险操作二次确认:点一次变成「确定吗」,再点才执行。 */
499
- function ConfirmBtn({ label, confirmLabel = '确定执行', onConfirm, variant = 'ghost', icon, size }) {
500
- const [armed, setArmed] = useState(false)
501
- return h(Btn, {
502
- variant,
503
- size,
504
- className: armed ? 'dt-danger' : undefined,
505
- icon,
506
- 'aria-label': armed ? confirmLabel : label,
507
- onClick: () => {
508
- if (!armed) { setArmed(true); return }
509
- setArmed(false)
510
- onConfirm()
511
- },
512
- onBlur: () => setArmed(false),
513
- }, armed ? confirmLabel : label)
755
+ /** 官方 ConfirmButton 动线:触发按钮只开 Modal,取消不执行,确认期间 busy 防重复。 */
756
+ function ConfirmButton({ label, confirmLabel = '确定执行', title = confirmLabel, message, onConfirm, variant = 'ghost', icon, size }) {
757
+ const [open, setOpen] = useState(false)
758
+ const [busy, setBusy] = useState(false)
759
+ const busyRef = useRef(false)
760
+ const close = useCallback(() => setOpen(false), [])
761
+ const confirm = async () => {
762
+ // state 还没来得及重渲染时也可能连点;同步 ref 是第二道锁。
763
+ if (busyRef.current) return false
764
+ busyRef.current = true
765
+ setBusy(true)
766
+ try {
767
+ const done = await onConfirm()
768
+ if (done) setOpen(false)
769
+ return done
770
+ } finally {
771
+ busyRef.current = false
772
+ setBusy(false)
773
+ }
774
+ }
775
+ return h(React.Fragment, null,
776
+ h(Btn, {
777
+ variant,
778
+ size,
779
+ icon,
780
+ 'aria-label': label,
781
+ 'aria-haspopup': 'dialog',
782
+ onClick: () => setOpen(true),
783
+ }, label),
784
+ h(Modal, {
785
+ open,
786
+ title,
787
+ description: message || ('确定要执行「' + label + '」操作吗?'),
788
+ onClose: close,
789
+ children: null,
790
+ footer: h(React.Fragment, null,
791
+ h(Btn, { variant: 'ghost', onClick: close }, '取消'),
792
+ h(Btn, {
793
+ variant: 'primary',
794
+ className: cx('dt-danger', busy && 'dt-btn-busy'),
795
+ disabled: busy,
796
+ 'aria-label': confirmLabel,
797
+ 'aria-busy': busy ? 'true' : undefined,
798
+ onClick: confirm,
799
+ }, confirmLabel)),
800
+ }))
514
801
  }
515
802
 
516
803
  const watcherId = (w) => (w && w.id) || String((w && w.repo) || '') + '#' + String((w && w.sessionId) || '')
@@ -820,14 +1107,14 @@ window.__ModuleLoader__.load({
820
1107
  const bottom = anchor ? Math.max(8, (window.innerHeight || 800) - anchor.y + 8) : 64
821
1108
 
822
1109
  const act = async (w, action) => {
823
- // 删除只走 ConfirmBtn 的二段确认;不要再叠一层原生确认框(同一动作问两次)。
1110
+ // 删除只走 ConfirmButton + Modal;不要再叠一层原生确认框(同一动作问两次)。
824
1111
  // 审核 M4:两层空 catch 让写操作遇 409/404/503/断网时**完全静默** ——
825
1112
  // 界面不变、无提示,客户以为按钮坏了。失败必须说出来。
826
1113
  try {
827
1114
  await call('/watch', { method: 'POST', body: JSON.stringify({ action, id: watcherId(w) }) })
828
1115
  } catch (error) {
829
1116
  setOrbitError(String((error && error.message) || error).slice(0, 160))
830
- return
1117
+ return false
831
1118
  }
832
1119
  try {
833
1120
  const body = await call('/state')
@@ -836,6 +1123,8 @@ window.__ModuleLoader__.load({
836
1123
  } catch (error) {
837
1124
  setOrbitError('写成功了,但刷新列表失败:' + String((error && error.message) || error).slice(0, 120))
838
1125
  }
1126
+ // 刷新失败不等于删除失败:动作已成功,确认框仍应关闭。
1127
+ return true
839
1128
  }
840
1129
 
841
1130
  // 悬浮面板也走移植来的 dt-* 设计系统(以前这里是一套自成体系的 inline style,
@@ -887,8 +1176,9 @@ window.__ModuleLoader__.load({
887
1176
  h(Btn, { size: 'sm', variant: 'ghost', onClick: () => act(w, 'poll') }, '立刻'),
888
1177
  h(Btn, { size: 'sm', variant: 'ghost', onClick: () => act(w, w.enabled ? 'pause' : 'resume') },
889
1178
  w.enabled ? '暂停' : '恢复'),
890
- h(ConfirmBtn, {
1179
+ h(ConfirmButton, {
891
1180
  label: '删除', confirmLabel: '确认删除', variant: 'ghost', size: 'sm',
1181
+ icon: h(Icon, { name: 'trash' }),
892
1182
  onConfirm: () => act(w, 'delete'),
893
1183
  })))
894
1184
  })
@@ -1018,18 +1308,10 @@ window.__ModuleLoader__.load({
1018
1308
  'cap-watcher': '撞单守上限',
1019
1309
  busy: '会话忙',
1020
1310
  }
1021
- // 新建与编辑共用:同一个输入提示写两份,改一处忘另一处就会漂移(文案门禁会拦)。
1022
- const AUTHOR_LIST_PLACEHOLDER = 'GitHub 登录名,逗号分隔,留空 = 谁都算'
1023
-
1024
1311
  const [snap, setSnap] = useState({ loading: true, error: null, body: null })
1025
1312
  const [tab, setTab] = useState('overview')
1026
1313
  const [notice, setNotice] = useState(null)
1027
- const [form, setForm] = useState({
1028
- repo: '', intervalSec: '60', goal: '', labels: '', onlyAssigned: false,
1029
- activeHours: '', isolated: false, workdir: '',
1030
- // 新建时就要能定:先建再改会多一步,尤其隔离区天数/数量不该先用默认值跑一轮。
1031
- allowAuthors: '', sessionMaxWakes: '', isolateKeepDays: '', maxIsolated: '',
1032
- })
1314
+ const [form, setForm] = useState({ ...CREATE_WATCHER_VALUES })
1033
1315
  const [token, setToken] = useState('')
1034
1316
  const [goalDraft, setGoalDraft] = useState('')
1035
1317
  const [goalTouched, setGoalTouched] = useState(false)
@@ -1050,12 +1332,22 @@ window.__ModuleLoader__.load({
1050
1332
  // 审核 M2:记下「这次编辑真的改过哪些字段」—— 保存时只发改过的,
1051
1333
  // 否则全量 PUT 会把别处刚改的值按打开那一刻的旧快照写回(lost update)。
1052
1334
  const touchedRef = useRef(new Set())
1335
+ const createTouchedRef = useRef(new Set())
1336
+ const createSnapshotRef = useRef({ ...CREATE_WATCHER_VALUES })
1337
+ const editSnapshotRef = useRef(null)
1053
1338
  const setField = (next) => {
1339
+ const opening = editSnapshotRef.current && editSnapshotRef.current.values
1054
1340
  for (const key of Object.keys(next)) {
1055
- if (next[key] !== draft[key]) touchedRef.current.add(key)
1341
+ if (opening && watcherSameValue(next[key], opening[key])) touchedRef.current.delete(key)
1342
+ else if (next[key] !== draft[key]) touchedRef.current.add(key)
1056
1343
  }
1057
1344
  setDraft(next)
1058
1345
  }
1346
+ const setCreateField = (key, value) => {
1347
+ if (watcherSameValue(value, createSnapshotRef.current[key])) createTouchedRef.current.delete(key)
1348
+ else createTouchedRef.current.add(key)
1349
+ setForm({ ...form, [key]: value })
1350
+ }
1059
1351
  const [search, setSearch] = useState('')
1060
1352
  const [glossary, setGlossary] = useState(false)
1061
1353
  // 版本检查结果(只读):面板里直接告诉客户「有没有新版本、该跑什么命令」
@@ -1132,16 +1424,22 @@ window.__ModuleLoader__.load({
1132
1424
  }, [goalTouched, sessionGoal])
1133
1425
 
1134
1426
  const busyRef = useRef(false)
1135
- const run = async (work, done) => {
1427
+ const run = async (work, done, options = {}) => {
1136
1428
  // 审核 T22 B3:上一件事没跑完时点了会**静默丢弃**(界面毫无反应,客户以为按钮坏了)。
1137
1429
  // 至少说一句「还在处理」—— 不说的话没人知道该等。
1138
- if (busyRef.current) { setNotice({ ok: false, text: '上一件事还在处理,请稍等再点' }); return }
1430
+ if (busyRef.current) {
1431
+ const error = new Error('上一件事还在处理,请稍等再点')
1432
+ setNotice({ ok: false, text: error.message })
1433
+ if (options.rethrow) throw error
1434
+ return false
1435
+ }
1139
1436
  busyRef.current = true
1140
1437
  setNotice(null)
1141
1438
  try {
1142
1439
  await work()
1143
1440
  if (done) notify(done)
1144
1441
  await load()
1442
+ return true
1145
1443
  } catch (error) {
1146
1444
  const text = String((error && error.message) || error)
1147
1445
  setNotice({ ok: false, text })
@@ -1149,6 +1447,9 @@ window.__ModuleLoader__.load({
1149
1447
  // 审核 T22 B3:失败后不回读 —— 批量操作「一半成功一半失败」时 UI 停在旧状态,
1150
1448
  // 客户看到的是「全都失败了」。回读一次,让已经成功的那些如实显示。
1151
1449
  try { await load() } catch { /* 回读失败不影响错误提示本身 */ }
1450
+ // WatcherForm 需要原始错误来留在自己的 SaveBar;其它动作保留旧的 false 契约。
1451
+ if (options.rethrow) throw error
1452
+ return false
1152
1453
  } finally {
1153
1454
  busyRef.current = false
1154
1455
  }
@@ -1158,30 +1459,28 @@ window.__ModuleLoader__.load({
1158
1459
  const saveEdit = (watcher) => run(async () => {
1159
1460
  await call('/watch', {
1160
1461
  method: 'POST',
1161
- // 审核 M2:只发**真的改过**的字段(打开编辑器后没动过的键一律不发,服务端保持原值)。
1162
- // 以前是全量 PUT:别处刚改的 intervalSec / goal 会被打开那一刻的旧快照静默覆盖。
1462
+ // 只发 touched 字段;repo/sessionId 只是现有 /watch 的定位键,不是全量快照。
1163
1463
  body: JSON.stringify((() => {
1164
- const full = {
1464
+ const full = {
1165
1465
  repo: watcher.repo,
1166
1466
  sessionId: watcher.sessionId,
1167
- intervalSec: Number(draft.intervalSec) || watcher.intervalSec,
1467
+ intervalSec: numberOrUndefined(draft.intervalSec) ?? watcher.intervalSec,
1168
1468
  filters: {
1169
- labels: String(draft.labels || '').split(',').map((v) => v.trim()).filter(Boolean),
1469
+ labels: String(draft.labels ?? '').split(',').map((v) => v.trim()).filter(Boolean),
1170
1470
  // filters 整块发送,三个名单都必须带上,否则改标签会顺带清空另外两项。
1171
- ignoreLabels: String(draft.ignoreLabels || '').split(',').map((v) => v.trim()).filter(Boolean),
1471
+ ignoreLabels: String(draft.ignoreLabels ?? '').split(',').map((v) => v.trim()).filter(Boolean),
1172
1472
  onlyAssigned: !!draft.onlyAssigned,
1173
- assignee: String(draft.assignee || '').trim().replace(/^@/, '') || null,
1174
- allowAuthors: String(draft.allowAuthors || '').split(',').map((v) => v.trim().replace(/^@/, '')).filter(Boolean),
1473
+ assignee: String(draft.assignee ?? '').trim().replace(/^@/, '') || null,
1474
+ allowAuthors: String(draft.allowAuthors ?? '').split(',').map((v) => v.trim().replace(/^@/, '')).filter(Boolean),
1175
1475
  },
1176
1476
  activeHours: draft.activeHours || '',
1177
1477
  goal: draft.goal || '',
1178
- // 自定义 ack 标签是可写配置;未传时服务端保持原值。
1179
- ackLabel: String(draft.ackLabel || '').trim() || undefined,
1478
+ ackLabel: String(draft.ackLabel ?? '').trim() || undefined,
1180
1479
  isolated: !!draft.isolated,
1181
1480
  workdir: draft.workdir || '',
1182
1481
  observe: !!draft.observe,
1183
- isolateKeepDays: Number(draft.isolateKeepDays) || undefined,
1184
- maxIsolated: Number(draft.maxIsolated) || undefined,
1482
+ isolateKeepDays: numberOrUndefined(draft.isolateKeepDays),
1483
+ maxIsolated: numberOrUndefined(draft.maxIsolated),
1185
1484
  priority: {
1186
1485
  reopened: draft.priorityReopened !== false,
1187
1486
  comments: draft.priorityComments !== false,
@@ -1189,13 +1488,11 @@ window.__ModuleLoader__.load({
1189
1488
  unassigned: draft.priorityUnassigned === true,
1190
1489
  stale: draft.priorityStale === true,
1191
1490
  },
1192
- batchLimit: Number(draft.batchLimit) || undefined,
1193
- maxWakesPerHour: Number(draft.maxWakesPerHour) || undefined,
1194
- sessionMaxWakes: Number(draft.sessionMaxWakes) || undefined,
1491
+ batchLimit: numberOrUndefined(draft.batchLimit),
1492
+ maxWakesPerHour: numberOrUndefined(draft.maxWakesPerHour),
1493
+ sessionMaxWakes: numberOrUndefined(draft.sessionMaxWakes),
1195
1494
  }
1196
- // 审核 T24 M1:touchedRef 里是**控件名**(labels / onlyAssigned / priorityReopened…),
1197
- // 而 full 的键是**字段名**(filters / priority)—— 两套名字对不上,这几个控件就永远发不出去,
1198
- // 而 Toast 照样说「已保存」。这里显式做一次「控件名 → 字段名」的映射。
1495
+ // 控件名 → API 字段名:一个 filters/priority 子项被触碰时保留整块其它原值。
1199
1496
  const CONTROL_TO_FIELD = {
1200
1497
  labels: "filters",
1201
1498
  ignoreLabels: "filters",
@@ -1220,7 +1517,9 @@ window.__ModuleLoader__.load({
1220
1517
  })()),
1221
1518
  })
1222
1519
  setEditing(null)
1223
- }, '已保存:' + watcher.repo)
1520
+ touchedRef.current = new Set()
1521
+ editSnapshotRef.current = null
1522
+ }, '已保存:' + watcher.repo, { rethrow: true })
1224
1523
 
1225
1524
  const act = (watcher, action) => run(async () => {
1226
1525
  await call('/watch', { method: 'POST', body: JSON.stringify({ action, id: watcherId(watcher) }) })
@@ -1242,37 +1541,55 @@ window.__ModuleLoader__.load({
1242
1541
  }, action === 'pause' ? '全部已暂停' : '全部已恢复')
1243
1542
 
1244
1543
  const addWatcher = () => run(async () => {
1544
+ const value = { ...CREATE_WATCHER_VALUES, ...form }
1245
1545
  const created = await call('/watch', {
1246
1546
  method: 'POST',
1247
- body: JSON.stringify({
1248
- repo: form.repo.trim(),
1249
- intervalSec: Number(form.intervalSec) || 60,
1250
- goal: form.goal,
1251
- sessionId,
1252
- filters: {
1253
- labels: String(form.labels || '').split(',').map((v) => v.trim()).filter(Boolean),
1254
- onlyAssigned: !!form.onlyAssigned,
1255
- allowAuthors: String(form.allowAuthors || '').split(',').map((v) => v.trim().replace(/^@/, '')).filter(Boolean),
1256
- },
1257
- activeHours: form.activeHours || '',
1258
- isolated: !!form.isolated,
1259
- workdir: form.workdir || '',
1260
- observe: !!form.observe,
1261
- batchLimit: Number(form.batchLimit) || undefined,
1262
- maxWakesPerHour: Number(form.maxWakesPerHour) || undefined,
1263
- sessionMaxWakes: Number(form.sessionMaxWakes) || undefined,
1264
- isolateKeepDays: Number(form.isolateKeepDays) || undefined,
1265
- maxIsolated: Number(form.maxIsolated) || undefined,
1266
- }),
1547
+ body: JSON.stringify((() => {
1548
+ const valueDirty = (key) => createTouchedRef.current.has(key) || !watcherSameValue(value[key], createSnapshotRef.current[key])
1549
+ const payload = { repo: value.repo.trim(), sessionId }
1550
+ // 新建也必须只提交实际输入过的配置;服务端负责未提供项的默认值。
1551
+ if (valueDirty('intervalSec')) payload.intervalSec = numberOrUndefined(value.intervalSec) ?? 60
1552
+ if (valueDirty('goal')) payload.goal = value.goal || ''
1553
+ if (['labels', 'ignoreLabels', 'onlyAssigned', 'assignee', 'allowAuthors'].some(valueDirty)) {
1554
+ payload.filters = {
1555
+ labels: String(value.labels ?? '').split(',').map((v) => v.trim()).filter(Boolean),
1556
+ ignoreLabels: String(value.ignoreLabels ?? '').split(',').map((v) => v.trim()).filter(Boolean),
1557
+ onlyAssigned: !!value.onlyAssigned,
1558
+ assignee: String(value.assignee ?? '').trim().replace(/^@/, '') || null,
1559
+ allowAuthors: String(value.allowAuthors ?? '').split(',').map((v) => v.trim().replace(/^@/, '')).filter(Boolean),
1560
+ }
1561
+ }
1562
+ if (valueDirty('activeHours')) payload.activeHours = value.activeHours || ''
1563
+ if (valueDirty('ackLabel')) payload.ackLabel = String(value.ackLabel ?? '').trim() || undefined
1564
+ if (valueDirty('isolated')) payload.isolated = !!value.isolated
1565
+ if (valueDirty('workdir')) payload.workdir = value.workdir || ''
1566
+ if (valueDirty('observe')) payload.observe = !!value.observe
1567
+ if (['priorityReopened', 'priorityComments', 'priorityLabels', 'priorityUnassigned', 'priorityStale'].some(valueDirty)) {
1568
+ payload.priority = {
1569
+ reopened: value.priorityReopened !== false,
1570
+ comments: value.priorityComments !== false,
1571
+ labels: value.priorityLabels !== false,
1572
+ unassigned: value.priorityUnassigned === true,
1573
+ stale: value.priorityStale === true,
1574
+ }
1575
+ }
1576
+ for (const key of ['batchLimit', 'maxWakesPerHour', 'sessionMaxWakes', 'isolateKeepDays', 'maxIsolated']) {
1577
+ if (valueDirty(key)) payload[key] = numberOrUndefined(value[key])
1578
+ }
1579
+ return payload
1580
+ })()),
1267
1581
  })
1268
- // 只清仓库相关的内容;限额、隔离策略保留,连续添加多个仓库时不用重填。
1269
- setForm({ ...form, repo: '', goal: '', labels: '', onlyAssigned: false, allowAuthors: '' })
1270
- // 添加前体检的警告直接说出来:填错仓库名 / 只读 / 归档,这一刻讲最省事
1582
+ // 只重置既定仓库相关字段;限额、隔离策略和时段保留,连续添加不用重填。
1583
+ const nextForm = { ...form, repo: '', goal: '', labels: '', onlyAssigned: false, allowAuthors: '' }
1584
+ setForm(nextForm)
1585
+ // 这些保留下来的值已经由本次 /watch 保存,成为下一次新增的全新基线。
1586
+ createSnapshotRef.current = { ...CREATE_WATCHER_VALUES, ...nextForm }
1587
+ createTouchedRef.current = new Set()
1271
1588
  const warnings = (created && Array.isArray(created.warnings)) ? created.warnings : []
1272
1589
  if (warnings.length > 0) notify('已添加,但注意:' + warnings.join(' / '), 'error')
1273
1590
  else notify('已添加,首轮立即开始轮询', 'info')
1274
1591
  return warnings
1275
- }, null)
1592
+ }, null, { rethrow: true })
1276
1593
 
1277
1594
  const saveCredentials = () => run(async () => {
1278
1595
  const payload = {}
@@ -1347,8 +1664,9 @@ window.__ModuleLoader__.load({
1347
1664
  'aria-expanded': editing === key, onClick: () => {
1348
1665
  setEditing(editing === key ? null : key)
1349
1666
  touchedRef.current = new Set()
1667
+ editSnapshotRef.current = editing === key ? null : { key, values: watcherValuesFrom(watcher) }
1350
1668
  setDraft({
1351
- intervalSec: String(watcher.intervalSec ?? 60),
1669
+ intervalSec: watcherNumberText(watcher.intervalSec ?? 60),
1352
1670
  labels: (watcher.filters && watcher.filters.labels ? watcher.filters.labels : []).join(','),
1353
1671
  ignoreLabels: (watcher.filters && watcher.filters.ignoreLabels ? watcher.filters.ignoreLabels : []).join(','),
1354
1672
  assignee: (watcher.filters && watcher.filters.assignee) || '',
@@ -1363,11 +1681,11 @@ window.__ModuleLoader__.load({
1363
1681
  observe: !!watcher.observe,
1364
1682
  isolated: !!watcher.isolated,
1365
1683
  workdir: watcher.workdir || '',
1366
- batchLimit: watcher.batchLimit ? String(watcher.batchLimit) : '',
1367
- maxWakesPerHour: watcher.maxWakesPerHour ? String(watcher.maxWakesPerHour) : '',
1368
- sessionMaxWakes: watcher.sessionMaxWakes ? String(watcher.sessionMaxWakes) : '',
1369
- isolateKeepDays: watcher.isolateKeepDays ? String(watcher.isolateKeepDays) : '',
1370
- maxIsolated: watcher.maxIsolated ? String(watcher.maxIsolated) : '',
1684
+ batchLimit: watcherNumberText(watcher.batchLimit),
1685
+ maxWakesPerHour: watcherNumberText(watcher.maxWakesPerHour),
1686
+ sessionMaxWakes: watcherNumberText(watcher.sessionMaxWakes),
1687
+ isolateKeepDays: watcherNumberText(watcher.isolateKeepDays),
1688
+ maxIsolated: watcherNumberText(watcher.maxIsolated),
1371
1689
  priorityReopened: (watcher.priority && watcher.priority.reopened) !== false,
1372
1690
  priorityComments: (watcher.priority && watcher.priority.comments) !== false,
1373
1691
  priorityLabels: (watcher.priority && watcher.priority.labels) !== false,
@@ -1457,39 +1775,27 @@ window.__ModuleLoader__.load({
1457
1775
  label: watcher.enabled ? '暂停' : '恢复',
1458
1776
  onClick: () => act(watcher, watcher.enabled ? 'pause' : 'resume'),
1459
1777
  }, watcher.enabled ? '暂停' : '恢复'),
1460
- h(ConfirmBtn, {
1778
+ h(ConfirmButton, {
1461
1779
  size: 'sm', variant: 'ghost', icon: h(Icon, { name: 'trash' }), label: '删除',
1462
1780
  confirmLabel: '确认删除', onConfirm: () => act(watcher, 'delete'),
1463
1781
  })))
1782
+ const opening = editSnapshotRef.current && editSnapshotRef.current.key === key
1783
+ ? editSnapshotRef.current.values
1784
+ : watcherValuesFrom(watcher)
1785
+ const editorValue = { ...opening, ...draft }
1464
1786
  const editor = editing === key
1465
- ? h('div', { className: 'dt-fieldset' },
1466
- field('间隔(秒)', h(Input, { value: draft.intervalSec, onChange: (e) => setField({ ...draft, intervalSec: e.target.value }) }), '多长时间检查一次这个仓库,最小 30 秒'),
1467
- field('只处理这些标签', h(Input, { value: draft.labels, placeholder: '逗号分隔,留空 = 全部', onChange: (e) => setField({ ...draft, labels: e.target.value }) })),
1468
- field('排除这些标签', h(Input, { value: draft.ignoreLabels || '', placeholder: '逗号分隔,留空 = 不排除', onChange: (e) => setField({ ...draft, ignoreLabels: e.target.value }) }), '命中任意一个就跳过,优先级高于上面的白名单'),
1469
- field('活跃时段', h(HoursField, { value: draft.activeHours, onChange: (next) => setField({ ...draft, activeHours: next }) }), '只在这个时间段内唤醒;窗口外只攒条目,不打扰'),
1470
- // 官方原型的 Policy 第一件事是「谁可以给你派活」。单人场景也要:别人随手提的 issue 不该叫醒你。
1471
- field('只理这些人提的', h(Input, { value: draft.allowAuthors || '', placeholder: AUTHOR_LIST_PLACEHOLDER, onChange: (e) => setField({ ...draft, allowAuthors: e.target.value }) }), '不在名单里的人提的 issue/PR 不会叫醒你(Gitee 也可以填)'),
1472
- field('目标/规则', h(Input, { value: draft.goal || '', placeholder: '可选,会附在唤醒消息里', onChange: (e) => setField({ ...draft, goal: e.target.value }) })),
1473
- field('已处理标签', h(Input, { value: draft.ackLabel || '', placeholder: '主理鱼:已处理', onChange: (e) => setField({ ...draft, ackLabel: e.target.value }) }), 'watch_ack 会把同名标签打到 issue/PR 上;改名字等于换一套已处理标记'),
1474
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: !!draft.onlyAssigned, onChange: (v) => setField({ ...draft, onlyAssigned: v }), label: '只看已指派' }), '只处理已指派给人的条目'),
1475
- draft.onlyAssigned ? field('只看指派给谁', h(Input, { value: draft.assignee || '', placeholder: 'GitHub 登录名,留空 = 只要有指派就行', onChange: (e) => setField({ ...draft, assignee: e.target.value }) })) : null,
1476
- field('单次最多唤醒条数', h(Input, { value: draft.batchLimit || '', placeholder: String(DEFAULTS.batchLimit || 5) + '(1-20)', onChange: (e) => setField({ ...draft, batchLimit: e.target.value }) })),
1477
- field('每小时最多唤醒次数', h(Input, { value: draft.maxWakesPerHour || '', placeholder: String(DEFAULTS.maxWakesPerHour || 6) + '(1-60)', onChange: (e) => setField({ ...draft, maxWakesPerHour: e.target.value }) })),
1478
- field('这条会话每小时最多被唤醒', h(Input, { value: draft.sessionMaxWakes || '', placeholder: String(DEFAULTS.sessionMaxWakes || 12) + '(1-60)', onChange: (e) => setField({ ...draft, sessionMaxWakes: e.target.value }) }), '跨所有守累计:守 5 个仓库时,光有单守上限挡不住叠加'),
1479
- field('优先级(在「单次最多唤醒条数」内先挑谁)', h('div', { className: 'dt-actions' },
1480
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: draft.priorityReopened !== false, onChange: (v) => setField({ ...draft, priorityReopened: v }), label: '重开优先' }), '被重开的排最前'),
1481
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: draft.priorityComments !== false, onChange: (v) => setField({ ...draft, priorityComments: v }), label: '评论优先' }), '有人在等回应的靠前'),
1482
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: draft.priorityLabels !== false, onChange: (v) => setField({ ...draft, priorityLabels: v }), label: '标签优先' }), '带标签的靠前'),
1483
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: draft.priorityUnassigned === true, onChange: (v) => setField({ ...draft, priorityUnassigned: v }), label: '未认领优先' }), '没人认领的靠前(默认关:这是我们的判断,不是规则)'),
1484
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: draft.priorityStale === true, onChange: (v) => setField({ ...draft, priorityStale: v }), label: '积压优先' }), '躺了 30 天以上的靠前(默认关,只展示)')), '全部关掉时按 GitHub 的「最近更新」顺序处理'),
1485
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: !!draft.observe, onChange: (v) => setField({ ...draft, observe: v }), label: '仅观察' }), '仅观察(只记录不唤醒)'),
1486
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: !!draft.isolated, onChange: (v) => setField({ ...draft, isolated: v }), label: '隔离执行' }), ISOLATED_HINT),
1487
- draft.isolated ? field('隔离工作目录', h(Input, { value: draft.workdir || '', placeholder: '绝对路径,留空 = 当前工作目录', onChange: (e) => setField({ ...draft, workdir: e.target.value }) })) : null,
1488
- draft.isolated ? field('隔离区保留天数', h(Input, { value: draft.isolateKeepDays || '', placeholder: String(DEFAULTS.isolateKeepDays || 3) + '(1-30)', onChange: (e) => setField({ ...draft, isolateKeepDays: e.target.value }) }), '每次唤醒前回收这个天数之前的一次性工作区;留空用默认 ' + (DEFAULTS.isolateKeepDays || 3) + ' 天') : null,
1489
- draft.isolated ? field('最多保留几个隔离区', h(Input, { value: draft.maxIsolated || '', placeholder: '5(1-50)', onChange: (e) => setField({ ...draft, maxIsolated: e.target.value }) }), '天数之外的第二道线:超出就回收最旧的(不影响正在用的那个)') : null,
1490
- h('div', { className: 'dt-actions' },
1491
- h(Btn, { size: 'sm', variant: 'primary', onClick: () => saveEdit(watcher) }, '保存'),
1492
- h(Btn, { size: 'sm', onClick: () => setEditing(null) }, '放弃')))
1787
+ ? h(WatcherForm, {
1788
+ mode: 'edit', idPrefix: 'watcher-edit-' + encodeURIComponent(key),
1789
+ value: editorValue, snapshot: opening, defaults: DEFAULTS, sessionId,
1790
+ submitLabel: '保存',
1791
+ onChange: (name, next) => setField({ ...draft, [name]: next }),
1792
+ onSave: () => saveEdit(watcher),
1793
+ onDiscard: (snapshot) => {
1794
+ setDraft({ ...snapshot })
1795
+ touchedRef.current = new Set()
1796
+ setNotice(null)
1797
+ },
1798
+ })
1493
1799
  : null
1494
1800
  // 官方 TicketLine 是 <li class="dt-row dt-link dt-ticket"> 里套「状态列 + 正文列」,
1495
1801
  // 展开的表单跟在正文列里,不破坏两列网格。
@@ -1711,9 +2017,9 @@ window.__ModuleLoader__.load({
1711
2017
  : h('ul', { className: 'dt-list' }, visible.map(row))),
1712
2018
  ]
1713
2019
 
1714
- // 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全
1715
- // 判定页用官方的时间线结构(dt-timeline / dt-event / dt-event-foot),
1716
- // 官方在 thread.tsx 与 settings-kit.tsx 里就是这么铺「发生过什么」的。
2020
+ // 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全。
2021
+ // 结构对齐官方 rows.tsx DecisionLine:ul.dt-list > li.dt-row.dt-ticket;
2022
+ // ol.dt-timeline 只保留给追溯与运行时事件,不再把不同语义混成一种列表。
1717
2023
  // 跳过原因分布:把「为什么没叫醒」做成可读的统计(客户最常问的问题)
1718
2024
  const reasonTotals = (() => {
1719
2025
  const merged = {}
@@ -1791,22 +2097,28 @@ window.__ModuleLoader__.load({
1791
2097
  h('p', { className: 'dt-step-detail' }, '添加一条主理鱼之后,每轮判定都会记在这里:唤醒、仅观察,或跳过及其原因。'),
1792
2098
  h('div', { className: 'dt-actions' },
1793
2099
  h(Btn, { size: 'sm', variant: 'primary', onClick: () => setTab('trigger') }, '去添加第一条')))
1794
- : h('ol', { className: 'dt-timeline' },
1795
- (() => {
1796
- // 跨守按时间倒序合并,再按「今天 / 昨天 / 具体日期」分组:
1797
- // 20 条平铺时,读者不知道哪条是刚才、哪条是两天前。
1798
- const merged = watchers
1799
- .flatMap((watcher) => (watcher.history || []).slice(-6).map((entry) => ({ watcher, entry })))
1800
- .sort((a, b) => String(b.entry.at || '').localeCompare(String(a.entry.at || '')))
1801
- let lastDay = ''
1802
- return merged.map(({ watcher, entry }, index) => {
1803
- const day = String(entry.at || '').slice(0, 10)
1804
- const head = day !== lastDay
1805
- ? (() => { lastDay = day; return h('li', { key: 'day-' + day, className: 'dt-timeline-day' }, dayLabel(entry.at)) })()
1806
- : null
1807
- return [head, eventRow(watcher, entry, index)]
1808
- }).flat().filter(Boolean)
1809
- })()))
2100
+ : (() => {
2101
+ // 跨守按时间倒序合并,再按「今天 / 昨天 / 具体日期」分组:
2102
+ // 每天独立 Section + ul,日期标题不是事件 li,列表语义不再混用。
2103
+ const merged = watchers
2104
+ .flatMap((watcher) => (watcher.history || []).slice(-6).map((entry) => ({ watcher, entry })))
2105
+ .sort((a, b) => String(b.entry.at || '').localeCompare(String(a.entry.at || '')))
2106
+ const groups = []
2107
+ merged.forEach(({ watcher, entry }, index) => {
2108
+ const day = String(entry.at || '').slice(0, 10)
2109
+ let group = groups[groups.length - 1]
2110
+ if (!group || group.day !== day) {
2111
+ group = { day, label: dayLabel(entry.at), items: [] }
2112
+ groups.push(group)
2113
+ }
2114
+ group.items.push({ watcher, entry, index })
2115
+ })
2116
+ return groups.map((group) => h(Section, {
2117
+ key: 'day-' + group.day,
2118
+ title: h('span', { className: 'dt-timeline-day' }, group.label),
2119
+ }, h('ul', { className: 'dt-list' },
2120
+ group.items.map(({ watcher, entry, index }) => eventRow(watcher, entry, index)))))
2121
+ })())
1810
2122
 
1811
2123
  /** 时间线分组标题:今天 / 昨天 / 具体日期(本地时区)。 */
1812
2124
  function dayLabel(iso) {
@@ -1821,22 +2133,32 @@ window.__ModuleLoader__.load({
1821
2133
  }
1822
2134
 
1823
2135
  function eventRow(watcher, entry, index) {
1824
- const label = entry.ok ? '已唤醒' : entry.reason === 'observe' ? '仅观察(未唤醒)' : '跳过:' + (entry.reason || '未知')
1825
- return h('li', {
1826
- key: watcher.repo + '#' + watcher.sessionId + entry.at + index,
1827
- className: 'dt-event' + (entry.ok ? '' : ' dt-event-quiet'),
1828
- },
1829
- // 两行封顶:① 编号 + 仓库(强)…… 右侧时间(弱、等宽)
1830
- // ② 结果 + 该轮的编号
1831
- // 原来是三行(仓库/时间、结果、编号/会话),扫一眼看不出发生了什么。
1832
- h('div', { className: 'dt-event-head' },
1833
- h('strong', { className: 'dt-event-actor' }, watcher.repo),
1834
- h('span', { className: 'dt-event-time' }, ageText(entry.at))),
1835
- h('p', { className: 'dt-event-text' },
1836
- label,
1837
- (entry.numbers || []).length > 0
1838
- ? h('span', { className: 'dt-event-nums' }, ' · ', (entry.numbers || []).map((n) => '#' + n).join(' '))
1839
- : null))
2136
+ const label = entry.ok ? '已唤醒' : entry.reason === 'observe' ? '仅观察(未唤醒)' : '跳过:' + (entry.reason || '未知')
2137
+ const mark = entry.ok
2138
+ ? { state: 'done', icon: 'decision', label: '已唤醒' }
2139
+ : entry.reason === 'observe'
2140
+ ? { state: 'idle', icon: 'clock', label: '仅观察' }
2141
+ : { state: 'warning', icon: 'alert', label: '跳过' }
2142
+ const reason = entry.ok ? '判定通过' : entry.reason === 'observe' ? '仅观察(未唤醒)' : '原因:' + (entry.reason || '未知')
2143
+ const numbers = (entry.numbers || []).map((n) => '#' + n).join(' ')
2144
+ return h('li', {
2145
+ key: watcher.repo + '#' + watcher.sessionId + entry.at + index,
2146
+ className: 'dt-row dt-link dt-ticket',
2147
+ 'data-state': mark.state,
2148
+ },
2149
+ h('div', { className: 'dt-ticket-stage' },
2150
+ h('span', { className: 'dt-stage', 'data-state': mark.state },
2151
+ h(Icon, { name: mark.icon, size: 14 }), mark.label)),
2152
+ h('div', { className: 'dt-ticket-body' },
2153
+ // dt-event-head 仅为旧主题兼容保留;语义与布局均以 DecisionLine 的 dt-row-title 为准。
2154
+ h('div', { className: 'dt-row-title' },
2155
+ h('div', { className: 'dt-event-head' },
2156
+ h('strong', { className: 'dt-event-actor' }, watcher.repo))),
2157
+ h('div', { className: 'dt-row-quote dt-line' },
2158
+ label, ' · ', h('span', { className: 'dt-event-nums' }, numbers || '无编号')),
2159
+ h('div', { className: 'dt-row-meta dt-line' },
2160
+ h('span', { className: 'dt-line-text' }, reason),
2161
+ h('time', { className: 'dt-event-time', dateTime: entry.at, title: entry.at }, ageText(entry.at)))))
1840
2162
  }
1841
2163
 
1842
2164
  // 迷你时间线:回答"为什么这一轮没叫醒我"
@@ -1913,25 +2235,18 @@ window.__ModuleLoader__.load({
1913
2235
  group.errors > 0 ? h('span', { className: 'dt-error-text' }, group.errors + ' 条报错') : null))))))
1914
2236
 
1915
2237
  const trigger = h(Section, { title: '新增主理鱼' },
1916
- h('div', { className: 'dt-form' },
1917
- field('仓库', h(Input, { value: form.repo, placeholder: 'owner/name,或 gitee:owner/name', onChange: (e) => setForm({ ...form, repo: e.target.value }) })),
1918
- field('间隔(秒)', h(Input, { value: form.intervalSec, onChange: (e) => setForm({ ...form, intervalSec: e.target.value }) })),
1919
- field('单次最多唤醒条数', h(Input, { value: form.batchLimit || '', placeholder: String(DEFAULTS.batchLimit || 5) + '(1-20)', onChange: (e) => setForm({ ...form, batchLimit: e.target.value }) })),
1920
- field('每小时最多唤醒次数', h(Input, { value: form.maxWakesPerHour || '', placeholder: String(DEFAULTS.maxWakesPerHour || 6) + '(1-60)', onChange: (e) => setForm({ ...form, maxWakesPerHour: e.target.value }) })),
1921
- field('这条会话每小时最多被唤醒', h(Input, { value: form.sessionMaxWakes || '', placeholder: String(DEFAULTS.sessionMaxWakes || 12) + '(1-60)', onChange: (e) => setForm({ ...form, sessionMaxWakes: e.target.value }) }), '跨所有主理鱼累计,守多个仓库时尤其要设'),
1922
- field('只处理这些标签', h(Input, { value: form.labels, placeholder: '逗号分隔,留空 = 全部', onChange: (e) => setForm({ ...form, labels: e.target.value }) })),
1923
- field('只理这些人提的', h(Input, { value: form.allowAuthors || '', placeholder: AUTHOR_LIST_PLACEHOLDER, onChange: (e) => setForm({ ...form, allowAuthors: e.target.value }) }), '不在名单里的人提的 issue/PR 不会叫醒你'),
1924
- field('活跃时段', h(HoursField, { value: form.activeHours, onChange: (next) => setForm({ ...form, activeHours: next }) }), '只在这个时间段内唤醒;不填 = 全天'),
1925
- field('目标/规则', h(Input, { value: form.goal || '', placeholder: '可选,会附在唤醒消息里', onChange: (e) => setForm({ ...form, goal: e.target.value }) })),
1926
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: form.onlyAssigned, onChange: (v) => setForm({ ...form, onlyAssigned: v }), label: '只看已指派' }), '只处理已指派给人的条目'),
1927
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: !!form.observe, onChange: (v) => setForm({ ...form, observe: v }), label: '仅观察' }), '仅观察(只记录本会唤醒哪几条,不真唤醒)'),
1928
- h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: form.isolated, onChange: (v) => setForm({ ...form, isolated: v }), label: '隔离执行' }), ISOLATED_HINT),
1929
- form.isolated ? field('隔离工作目录', h(Input, { value: form.workdir, placeholder: '绝对路径,留空 = 当前工作目录', onChange: (e) => setForm({ ...form, workdir: e.target.value }) })) : null,
1930
- form.isolated ? field('隔离区保留天数', h(Input, { value: form.isolateKeepDays || '', placeholder: String(DEFAULTS.isolateKeepDays || 3) + '(1-30)', onChange: (e) => setForm({ ...form, isolateKeepDays: e.target.value }) }), '每次唤醒前回收这个天数之前的一次性工作区') : null,
1931
- form.isolated ? field('最多保留几个隔离区', h(Input, { value: form.maxIsolated || '', placeholder: '5(1-50)', onChange: (e) => setForm({ ...form, maxIsolated: e.target.value }) }), '超出就回收最旧的,不影响正在使用的那个') : null,
1932
- h('div', { className: 'dt-actions' },
1933
- h(Btn, { variant: 'primary', icon: h(Icon, { name: 'plus' }), onClick: addWatcher, disabled: !sessionId || !form.repo.trim() },
1934
- sessionId ? '添加到当前会话' : '先打开一个会话'))))
2238
+ h(WatcherForm, {
2239
+ mode: 'create', idPrefix: 'watcher-new', value: { ...CREATE_WATCHER_VALUES, ...form },
2240
+ snapshot: createSnapshotRef.current, defaults: DEFAULTS, disabled: !sessionId, sessionId,
2241
+ submitLabel: sessionId ? '添加到当前会话' : '先打开一个会话',
2242
+ onChange: setCreateField,
2243
+ onSave: addWatcher,
2244
+ onDiscard: () => {
2245
+ setForm({ ...createSnapshotRef.current })
2246
+ createTouchedRef.current = new Set()
2247
+ setNotice(null)
2248
+ },
2249
+ }))
1935
2250
 
1936
2251
  // 「仓库」行:先给条数,再看名字;超过 3 条截断成「… 等」。
1937
2252
  // 原先用 ", " 把三个 owner/name 粘成一行(实测 518px / 可用 541px),
@@ -2195,42 +2510,9 @@ window.__ModuleLoader__.load({
2195
2510
  return (value / 1024 / 1024 / 1024).toFixed(2) + ' GB'
2196
2511
  }
2197
2512
 
2198
- // 官方 settings-kit.tsx 的 Field:label + hint(InfoTip) + 控件 + note(small)。
2199
- // 我们之前只有 label,说明只能塞进 placeholder —— 用户看不到「这个字段到底什么意思」。
2200
- /**
2201
- * 活跃时段:两个原生时间选择器(起 / 止),不再让人手打 "09:00-23:00"。
2202
- * 空 = 全天;止 <= 起 表示跨夜(22:00-06:00),提示里会写出来。
2203
- */
2204
- function HoursField({ value, onChange }) {
2205
- const match = String(value || '').match(/^(\d{1,2}):(\d{2})\s*-\s*(\d{1,2}):(\d{2})$/)
2206
- const start = match ? String(match[1]).padStart(2, '0') + ':' + match[2] : ''
2207
- const end = match ? String(match[3]).padStart(2, '0') + ':' + match[4] : ''
2208
- const write = (nextStart, nextEnd) => onChange(nextStart && nextEnd ? nextStart + '-' + nextEnd : '')
2209
- const overnight = Boolean(start && end && end <= start)
2210
- return h('div', { className: 'dt-hours' },
2211
- h('input', {
2212
- type: 'time', className: 'dt-time', value: start, 'aria-label': '起始时间',
2213
- onChange: (e) => write(e.target.value, end || '23:00'),
2214
- }),
2215
- h('span', { className: 'dt-hours-sep' }, '→'),
2216
- h('input', {
2217
- type: 'time', className: 'dt-time', value: end, 'aria-label': '结束时间',
2218
- onChange: (e) => write(start || '09:00', e.target.value),
2219
- }),
2220
- value
2221
- ? h('button', {
2222
- type: 'button', className: 'dt-btn dt-btn-sm dt-btn-ghost',
2223
- onClick: () => onChange(''),
2224
- }, '全天')
2225
- : h('span', { className: 'dt-hours-hint' }, '留空 = 全天'),
2226
- overnight ? h('span', { className: 'dt-hours-hint' }, '跨夜窗口') : null)
2227
- }
2228
-
2513
+ // 设置页的旧调用面保留,但 DOM 也统一走共享 Field,避免再生成嵌套 label。
2229
2514
  function field(label, control, hint, note) {
2230
- return h('label', { className: 'dt-field', key: label },
2231
- h('span', { className: 'dt-field-head' }, label, hint ? h(InfoTip, { text: hint }) : null),
2232
- control,
2233
- note ? h('small', null, note) : null)
2515
+ return h(Field, { key: label, label, hint, note }, control)
2234
2516
  }
2235
2517
 
2236
2518
  return h('div', { className: 'dt-page' },