/*
 * 多戏格子动漫 · Shared Design System
 * Canonical source for WanWeb (3000) and LangGraph (3456).
 * Scope: design tokens, semantic state colors, common controls and accessible
 * interaction feedback. Page layouts remain owned by each application.
 */
:root {
  /* Both products default to dark mode; WanWeb only marks light explicitly. */
  color-scheme: dark;

  /* Typography */
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ui-font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;

  /* Semantic colors: these are the only cross-product status colors. */
  --ui-accent: #0a84ff;
  --ui-accent-strong: #0077ed;
  --ui-success: #30d158;
  --ui-warning: #ff9f0a;
  --ui-danger: #ff453a;
  --ui-info: #64d2ff;

  /* Neutral material system — default dark workspace */
  --ui-page: #000000;
  --ui-page-elevated: #171719;
  --ui-surface: rgba(28, 28, 30, .74);
  --ui-surface-raised: rgba(44, 44, 46, .76);
  --ui-control: rgba(118, 118, 128, .20);
  --ui-control-hover: rgba(118, 118, 128, .30);
  --ui-text: #f5f5f7;
  --ui-text-secondary: rgba(235, 235, 245, .64);
  --ui-text-tertiary: rgba(235, 235, 245, .42);
  --ui-line: rgba(255, 255, 255, .14);
  --ui-line-strong: rgba(255, 255, 255, .23);

  /* Metrics */
  --ui-control-height: 36px;
  --ui-radius-control: 11px;
  --ui-radius-module: 14px;
  --ui-radius-overlay: 18px;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;

  /* Interaction */
  --ui-ease-out: cubic-bezier(.23, 1, .32, 1);
  --ui-ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ui-focus-ring: 0 0 0 3px rgba(10, 132, 255, .28);
  --ui-shadow-overlay: 0 18px 44px rgba(0, 0, 0, .16);
}

/* WanWeb stores theme on html; LangGraph stores it on body. */
html[data-theme="light"], body[data-theme="light"] {
  color-scheme: light;
  --ui-page: #f5f5f7;
  --ui-page-elevated: #ffffff;
  --ui-surface: rgba(255, 255, 255, .72);
  --ui-surface-raised: rgba(255, 255, 255, .88);
  --ui-control: rgba(118, 118, 128, .12);
  --ui-control-hover: rgba(118, 118, 128, .18);
  --ui-text: #1d1d1f;
  --ui-text-secondary: rgba(60, 60, 67, .68);
  --ui-text-tertiary: rgba(60, 60, 67, .46);
  --ui-line: rgba(60, 60, 67, .16);
  --ui-line-strong: rgba(60, 60, 67, .24);
  --ui-shadow-overlay: 0 18px 44px rgba(0, 0, 0, .12);
}

/* Global baseline. Individual products may set page-level layout and surfaces. */
html, body { font-family: var(--ui-font); }
.mono, .mono *, code, pre { font-family: var(--ui-font-mono); }

button, input, select, textarea { font: inherit; }
button:not(:disabled) {
  min-height: var(--ui-control-height);
  border-radius: var(--ui-radius-control);
  transition: transform 120ms var(--ui-ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}
button:not(:disabled):active { transform: scale(.97); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring);
}

/* Quiet, product-consistent semantic labels. Existing applications retain
   their status class names while consuming the same semantic palette. */
.status-pending_confirmation, .status-pending, .badge.p1, .badge.warning { color: #9a5a00; }
.status-executing, .status-running, .badge.p2, .badge.running { color: #075da3; }
.status-executed, .status-completed, .badge.ok, .badge.success { color: #147a36; }
.status-failed, .status-blocked, .badge.p0, .badge.failed { color: #b42318; }

html[data-theme="dark"] .status-pending_confirmation, body[data-theme="dark"] .status-pending_confirmation,
html[data-theme="dark"] .status-pending, body[data-theme="dark"] .status-pending,
html[data-theme="dark"] .badge.p1, body[data-theme="dark"] .badge.p1,
html[data-theme="dark"] .badge.warning, body[data-theme="dark"] .badge.warning { color: #ffd08a; }
html[data-theme="dark"] .status-executing, body[data-theme="dark"] .status-executing,
html[data-theme="dark"] .status-running, body[data-theme="dark"] .status-running,
html[data-theme="dark"] .badge.p2, body[data-theme="dark"] .badge.p2,
html[data-theme="dark"] .badge.running, body[data-theme="dark"] .badge.running { color: #8dccff; }
html[data-theme="dark"] .status-executed, body[data-theme="dark"] .status-executed,
html[data-theme="dark"] .status-completed, body[data-theme="dark"] .status-completed,
html[data-theme="dark"] .badge.ok, body[data-theme="dark"] .badge.ok,
html[data-theme="dark"] .badge.success, body[data-theme="dark"] .badge.success { color: #78e39b; }
html[data-theme="dark"] .status-failed, body[data-theme="dark"] .status-failed,
html[data-theme="dark"] .status-blocked, body[data-theme="dark"] .status-blocked,
html[data-theme="dark"] .badge.p0, body[data-theme="dark"] .badge.p0,
html[data-theme="dark"] .badge.failed, body[data-theme="dark"] .badge.failed { color: #ff9b93; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   WanWeb UI Contract v1 · A 银灰 + 鸢尾紫 · 票据卡语言
   这是跨 WanWeb / LangGraph / 控场 / 审阅中心的共享合同。
   页面只能改变布局；状态色、密度、控件反馈和卡片形态从这里继承。
   ───────────────────────────────────────────────────────────── */
:root {
  --wx-font-system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --wx-font-code: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wx-page: #f2f7fd;
  --wx-surface: #ffffff;
  --wx-surface-raised: #f7fbff;
  --wx-text: #0a1a2b;
  --wx-muted: #4d6b8a;
  --wx-quiet: #6d87a3;
  --wx-line: rgba(10,60,110,.12);
  --wx-accent: #0a94c9;
  --wx-accent-soft: #e0f7fd;
  --wx-control-height: 32px;
  --wx-radius-control: 7px;
  --wx-radius-card: 10px;
  --wx-radius-pill: 999px;
  --wx-space-1: 4px;
  --wx-space-2: 8px;
  --wx-space-3: 12px;
  --wx-space-4: 16px;
  --wx-tile-w: 264px;
  --wx-tile-h: 164px;
  --wx-motion-fast: 90ms;
  --wx-motion-base: 160ms;
  --wx-motion-state: 240ms;
  --wx-ease-out: cubic-bezier(.23, 1, .32, 1);
  --wx-shadow-card: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 20px rgba(15, 23, 42, .05);
  --wx-shadow-overlay: 0 28px 80px rgba(6, 10, 20, .45), 0 6px 18px rgba(6, 10, 20, .28);
  /* Shared semantic status palette. The surface palette must not redefine these. */
  --wx-status-await: #E8890C;
  --wx-status-confirmed: #0F766E;
  --wx-status-running: #2D7FF9;
  --wx-status-blocked: #7C5CFC;
  --wx-status-failed: #E5484D;
  --wx-status-done: #16A34A;
  --wx-status-cancelled: #64748B;
  --wx-status-info: #2563EB;
}
html[data-theme="dark"], body[data-theme="dark"], html[data-theme="night"], html[data-skin="neon"][data-theme="night"] {
  --wx-page: #04070f;
  --wx-surface: #0a1020;
  --wx-surface-raised: #101a2f;
  --wx-text: #d8ecff;
  --wx-muted: #7fa2c4;
  --wx-quiet: #8faaca;
  --wx-line: rgba(90,200,255,.16);
  --wx-accent: #3ddcff;
  --wx-accent-soft: #07222e;
  --wx-shadow-card: 0 1px 2px rgba(0, 0, 0, .36), 0 8px 20px rgba(0, 0, 0, .28);
  --wx-shadow-overlay: 0 28px 80px rgba(0, 0, 0, .55), 0 6px 18px rgba(0, 0, 0, .36);
}
html[data-density="xs"] { --wx-tile-w: 248px; --wx-tile-h: 148px; }
html[data-density="s"], html:not([data-density]) { --wx-tile-w: 264px; --wx-tile-h: 164px; }
html[data-density="m"] { --wx-tile-w: 292px; --wx-tile-h: 196px; }

.wx-page { background: var(--wx-page); color: var(--wx-text); font-family: var(--wx-font-system); }
.wx-mono { font-family: var(--wx-font-code); font-variant-numeric: tabular-nums; }
.wx-toolbar { display: flex; align-items: center; gap: var(--wx-space-2); padding: var(--wx-space-2) 10px; border: 1px solid var(--wx-line); border-radius: var(--wx-radius-card); background: var(--wx-surface); }
.wx-toolbar > input, .wx-toolbar > select { min-height: var(--wx-control-height); padding: 5px 9px; border: 1px solid var(--wx-line); border-radius: var(--wx-radius-control); background: var(--wx-surface-raised); color: var(--wx-text); font: inherit; }
.wx-toolbar > .wx-grow { flex: 1 1 auto; min-width: 0; }
.wx-card { position: relative; width: var(--wx-tile-w); height: var(--wx-tile-h); padding: 9px 10px 8px; display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--wx-line); border-left: 0; border-radius: var(--wx-radius-card); background: var(--wx-surface); color: var(--wx-text); box-shadow: var(--wx-shadow-card); overflow: hidden; transition: transform var(--wx-motion-fast) var(--wx-ease-out), border-color var(--wx-motion-base) ease, box-shadow var(--wx-motion-base) ease; }
.wx-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: var(--wx-radius-pill) 0 0 var(--wx-radius-pill); background: var(--wx-card-status, var(--wx-status-await)); }
.wx-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--wx-card-status, var(--wx-accent)) 42%, var(--wx-line)); box-shadow: 0 3px 8px rgba(15, 23, 42, .10), 0 14px 30px color-mix(in srgb, var(--wx-card-status, var(--wx-accent)) 22%, transparent); }
.wx-card[data-status="confirmed"] { --wx-card-status: var(--wx-status-confirmed); }
.wx-card[data-status="running"] { --wx-card-status: var(--wx-status-running); }
.wx-card[data-status="blocked"] { --wx-card-status: var(--wx-status-blocked); }
.wx-card[data-status="failed"] { --wx-card-status: var(--wx-status-failed); }
.wx-card[data-status="done"] { --wx-card-status: var(--wx-status-done); }
.wx-card[data-status="cancelled"] { --wx-card-status: var(--wx-status-cancelled); }
.wx-pill { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 2px 8px; border-radius: var(--wx-radius-pill); background: color-mix(in srgb, var(--wx-pill-color, var(--wx-status-await)) 13%, transparent); color: color-mix(in srgb, var(--wx-pill-color, var(--wx-status-await)) 82%, var(--wx-text)); font-size: 10.5px; font-weight: 720; white-space: nowrap; }
.wx-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wx-pill-color, var(--wx-status-await)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wx-pill-color, var(--wx-status-await)) 22%, transparent); }
.wx-pill[data-tone="running"] { --wx-pill-color: var(--wx-status-running); }
.wx-pill[data-tone="failed"] { --wx-pill-color: var(--wx-status-failed); }
.wx-pill[data-tone="done"] { --wx-pill-color: var(--wx-status-done); }
.wx-pill[data-tone="blocked"] { --wx-pill-color: var(--wx-status-blocked); }
.wx-pill[data-tone="confirmed"] { --wx-pill-color: var(--wx-status-confirmed); }
.wx-chip { display: inline-flex; align-items: center; width: max-content; max-width: 100%; padding: 1px 6px; border: 1px solid var(--wx-line); border-radius: var(--wx-radius-pill); color: var(--wx-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-chip[data-project] { color: var(--wx-accent); border-color: color-mix(in srgb, var(--wx-accent) 42%, transparent); background: color-mix(in srgb, var(--wx-accent) 10%, transparent); }
.wx-stat { min-width: 120px; padding: 10px 12px; border-radius: var(--wx-radius-card); background: var(--wx-stat-color, var(--wx-status-cancelled)); color: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.10); }
.wx-stat > span { display: block; font-size: 11px; font-weight: 700; opacity: .92; }
.wx-stat > strong { display: block; font-size: 25px; line-height: 1.15; font-weight: 820; font-variant-numeric: tabular-nums; }
.wx-stat[data-tone="await"] { --wx-stat-color: var(--wx-status-await); }
.wx-stat[data-tone="running"] { --wx-stat-color: var(--wx-status-running); }
.wx-stat[data-tone="failed"] { --wx-stat-color: var(--wx-status-failed); }
.wx-stat[data-tone="done"] { --wx-stat-color: var(--wx-status-done); }
.wx-button { min-height: var(--wx-control-height); padding: 5px 10px; border: 1px solid transparent; border-radius: var(--wx-radius-control); background: var(--wx-accent); color: #fff; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: transform var(--wx-motion-fast) var(--wx-ease-out), filter var(--wx-motion-base) ease, box-shadow var(--wx-motion-base) ease; }
.wx-button:hover { filter: brightness(1.05); box-shadow: 0 4px 12px color-mix(in srgb, var(--wx-accent) 28%, transparent); }
.wx-button:active { transform: scale(.97); }
.wx-button:focus-visible, .wx-toolbar :is(input, select):focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wx-accent) 28%, transparent); }
.wx-table-row { display: grid; grid-template-columns: 108px 120px minmax(160px, 1fr) minmax(180px, 1fr); gap: 12px; align-items: center; min-height: 42px; padding: 8px 10px; border-bottom: 1px solid var(--wx-line); color: var(--wx-text); }
.wx-table-row:hover { background: color-mix(in srgb, var(--wx-accent) 6%, var(--wx-surface)); }
.wx-empty { display: grid; place-items: center; min-height: 120px; padding: 20px; border: 1px dashed var(--wx-line); border-radius: var(--wx-radius-card); color: var(--wx-muted); text-align: center; }
.wx-focusable:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wx-accent) 28%, transparent); }
@media (prefers-reduced-motion: reduce) { .wx-card, .wx-button { transition: none; } .wx-card:hover { transform: none; } }

/* ─────────────────────────────────────────────────────────────
   WanWeb UI Contract v2 · 克制专业版（B 方向，2026-09-30 用户确认）
   规则：白天浅底白卡为主；夜间为中灰绿，不做近黑；强调色只用于
   状态点、进度、主按钮与选中态；卡片=1px 描边 + 极浅阴影，不用整卡染色。
   ───────────────────────────────────────────────────────────── */
:root {
  --wx2-page:#f2f3f0; --wx2-surface:#ffffff; --wx2-raised:#f7f8f5;
  --wx2-ink:#1f251f; --wx2-muted:#69736a; --wx2-quiet:#8a938a;
  --wx2-line:#e2e6dd; --wx2-line-strong:#cfd6c9;
  --wx2-accent:#8a6d2f; --wx2-accent-soft:#f3ecdc;
  --wx2-card-border:#e3e7dd;
  --wx2-shadow:0 1px 2px rgba(25,35,25,.05), 0 8px 20px rgba(25,35,25,.06);
  --wx2-shadow-hover:0 10px 24px rgba(25,35,25,.12);
}
html[data-theme="dark"], body[data-theme="dark"], html[data-theme="night"] {
  --wx2-page:#1e2622; --wx2-surface:#2a332e; --wx2-raised:#222a26;
  --wx2-ink:#e8ece4; --wx2-muted:#a2afa3; --wx2-quiet:#8b9a8d;
  --wx2-line:#ffffff1c; --wx2-line-strong:#ffffff2b;
  --wx2-accent:#cfa964; --wx2-accent-soft:#3a3527;
  --wx2-card-border:#ffffff1f;
  --wx2-shadow:0 1px 2px rgba(0,0,0,.28), 0 10px 22px rgba(0,0,0,.22);
  --wx2-shadow-hover:0 12px 28px rgba(0,0,0,.34);
}
.wx2-card { position:relative; display:flex; flex-direction:column; background:var(--wx2-surface); color:var(--wx2-ink); border:1px solid var(--wx2-card-border); border-radius:10px; box-shadow:var(--wx2-shadow); transition:transform .18s cubic-bezier(.23,1,.32,1), box-shadow .18s ease, border-color .18s ease; }
.wx2-card:hover { transform:translateY(-3px); box-shadow:var(--wx2-shadow-hover); }
.wx2-pill { display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:999px; font-size:10.5px; font-weight:750; white-space:nowrap; background:color-mix(in srgb, var(--wx2-pill, var(--wx2-accent)) 14%, var(--wx2-surface)); color:color-mix(in srgb, var(--wx2-pill, var(--wx2-accent)) 88%, var(--wx2-ink)); }
.wx2-pill::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--wx2-pill, var(--wx2-accent)); }
@media (prefers-reduced-motion: reduce) { .wx2-card, .wx2-card:hover { transition:none; transform:none; } }
