/*! AIDC Developer · 界面 SDK v1.4.1 · https://www.ai-dc.ai/developer/docs/ui
 *  由 developer/sdk/ui-tokens.ts + developer/sdk/ui.css 生成（npm run developer:build），请勿手改。 */
@layer aidc.tokens, aidc.base, aidc.components;

@layer aidc.tokens {
:root {
  color-scheme: light;
  --radius: 0.375rem;
  --font-sans: "Archivo", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --background: #ffffff;
  --foreground: #171717;
  --card: #ffffff;
  --card-foreground: #171717;
  --popover: #ffffff;
  --popover-foreground: #171717;
  --primary: #171717;
  --primary-foreground: #ffffff;
  --secondary: #f2f2f2;
  --secondary-foreground: #171717;
  --muted: #f2f2f2;
  --muted-foreground: #666666;
  --accent: #f2f2f2;
  --accent-foreground: #171717;
  --destructive: #d8001b;
  --destructive-foreground: #ffffff;
  --success: #0f7a3d;
  --warning: #a15c00;
  --border: rgba(0, 0, 0, 0.09);
  --input: rgba(0, 0, 0, 0.12);
  --ring: #006bff;
  --signal: #e34400;
  --signal-foreground: #ffffff;
  --chart-1: #ffc2a3;
  --chart-2: #ff8a4c;
  --chart-3: #ff4d00;
  --chart-4: #e34400;
  --chart-5: #a83200;
}

.dark {
  color-scheme: dark;
  --background: #0a0a0a;
  --foreground: #ededed;
  --card: #111111;
  --card-foreground: #ededed;
  --popover: #111111;
  --popover-foreground: #ededed;
  --primary: #ededed;
  --primary-foreground: #0a0a0a;
  --secondary: #1a1a1a;
  --secondary-foreground: #ededed;
  --muted: #1a1a1a;
  --muted-foreground: #a1a1a1;
  --accent: #1f1f1f;
  --accent-foreground: #ededed;
  --destructive: #ff4d5e;
  --destructive-foreground: #0a0a0a;
  --success: #3fb96b;
  --warning: #e5a44b;
  --border: rgba(255, 255, 255, 0.11);
  --input: rgba(255, 255, 255, 0.15);
  --ring: #006bff;
  --signal: #ff4d00;
  --signal-foreground: #ffffff;
  --chart-1: #ffc2a3;
  --chart-2: #ff8a4c;
  --chart-3: #ff6b2e;
  --chart-4: #ff4d00;
  --chart-5: #e34400;
}

@media (prefers-color-scheme: dark) {
  [data-aidc-mode="system"] {
    color-scheme: dark;
    --background: #0a0a0a;
    --foreground: #ededed;
    --card: #111111;
    --card-foreground: #ededed;
    --popover: #111111;
    --popover-foreground: #ededed;
    --primary: #ededed;
    --primary-foreground: #0a0a0a;
    --secondary: #1a1a1a;
    --secondary-foreground: #ededed;
    --muted: #1a1a1a;
    --muted-foreground: #a1a1a1;
    --accent: #1f1f1f;
    --accent-foreground: #ededed;
    --destructive: #ff4d5e;
    --destructive-foreground: #0a0a0a;
    --success: #3fb96b;
    --warning: #e5a44b;
    --border: rgba(255, 255, 255, 0.11);
    --input: rgba(255, 255, 255, 0.15);
    --ring: #006bff;
    --signal: #ff4d00;
    --signal-foreground: #ffffff;
    --chart-1: #ffc2a3;
    --chart-2: #ff8a4c;
    --chart-3: #ff6b2e;
    --chart-4: #ff4d00;
    --chart-5: #e34400;
  }
}

[data-aidc-theme="signal"] {
  --primary: #e34400;
  --primary-foreground: #ffffff;
  --ring: #e34400;
}

.dark[data-aidc-theme="signal"],
.dark [data-aidc-theme="signal"],
[data-aidc-theme="signal"] .dark {
  --primary: #ff4d00;
  --primary-foreground: #ffffff;
  --ring: #ff4d00;
}

@media (prefers-color-scheme: dark) {
  [data-aidc-mode="system"][data-aidc-theme="signal"] {
    --primary: #ff4d00;
    --primary-foreground: #ffffff;
    --ring: #ff4d00;
  }
}
}

/*
 * AIDC Developer SDK · 界面（ui）的组件样式——源文件。
 * 构建时在前面拼上设计令牌（developer/sdk/ui-tokens.ts），产出 /developer/sdk/v1/ui.css。
 * 外观对齐 shadcn/ui（new-york），变量名也一样；全部在 @layer 里，应用自己的 CSS（不分层）永远能覆盖。
 * 每个类都在 developer/sdk/ui-catalog.ts 登记（ui.test.ts 双向校验），文档与样例页由登记表生成。
 */

@layer aidc.base {
  *, *::before, *::after { box-sizing: border-box; }
  :where(html) { -webkit-text-size-adjust: 100%; }
  :where(body) {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  :where(h1, h2, h3, h4) { font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
  :where(code, kbd, pre, samp) { font-family: var(--font-mono); }
  :where(button, input, select, textarea) { font: inherit; color: inherit; }
  :where([hidden]) { display: none !important; }
  ::selection { background: color-mix(in oklab, var(--signal) 22%, transparent); }
}

@layer aidc.components {
  /* ── 页面骨架 ─────────────────────────────────────────────────────────── */
  .aidc-appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--background) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
  }
  .aidc-appbar__title { font-size: 0.9375rem; font-weight: 600; }
  .aidc-appbar__actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
  .aidc-page { width: 100%; max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
  .aidc-page--narrow { max-width: 42rem; }
  .aidc-stack { display: flex; flex-direction: column; gap: 1rem; }
  .aidc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
  .aidc-muted { color: var(--muted-foreground); }

  /* ── 按钮 ────────────────────────────────────────────────────────────── */
  .aidc-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  }
  .aidc-btn:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }
  .aidc-btn:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
  .aidc-btn:disabled, .aidc-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
  .aidc-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; pointer-events: none; }
  .aidc-btn .aidc-loader { color: inherit; }
  .aidc-btn--secondary { background: var(--secondary); color: var(--secondary-foreground); }
  .aidc-btn--secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, transparent); }
  .aidc-btn--outline { border-color: var(--border); background: var(--background); color: var(--foreground); }
  .aidc-btn--outline:hover { background: var(--accent); color: var(--accent-foreground); }
  .dark .aidc-btn--outline { border-color: var(--input); background: color-mix(in oklab, var(--input) 30%, transparent); }
  .dark .aidc-btn--outline:hover { background: color-mix(in oklab, var(--input) 50%, transparent); }
  .aidc-btn--ghost { background: transparent; color: var(--foreground); box-shadow: none; }
  .aidc-btn--ghost:hover { background: var(--accent); color: var(--accent-foreground); }
  .aidc-btn--destructive { background: var(--destructive); color: #ffffff; }
  .aidc-btn--destructive:hover { background: color-mix(in oklab, var(--destructive) 90%, transparent); }
  .aidc-btn--destructive:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 25%, transparent); }
  .aidc-btn--link { height: auto; padding: 0; border: 0; background: none; color: var(--primary); box-shadow: none; text-underline-offset: 4px; }
  .aidc-btn--link:hover { background: none; text-decoration: underline; }
  .aidc-btn--sm { height: 2rem; gap: 0.375rem; padding: 0 0.75rem; }
  .aidc-btn--lg { height: 2.5rem; padding: 0 1.5rem; }
  .aidc-btn--icon { width: 2.25rem; padding: 0; }
  .aidc-btn--sm.aidc-btn--icon { width: 2rem; }
  .aidc-btn--block { width: 100%; }

  /* ── 表单 ────────────────────────────────────────────────────────────── */
  .aidc-input, .aidc-textarea, .aidc-select {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 2.25rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: transparent;
    color: var(--foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
  }
  @media (min-width: 768px) { .aidc-input, .aidc-textarea, .aidc-select { font-size: 0.875rem; } }
  .aidc-input::placeholder, .aidc-textarea::placeholder { color: var(--muted-foreground); }
  .aidc-input:focus-visible, .aidc-textarea:focus-visible, .aidc-select:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
  .aidc-input[aria-invalid="true"], .aidc-textarea[aria-invalid="true"], .aidc-select[aria-invalid="true"] { border-color: var(--destructive); box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent); }
  .aidc-input:disabled, .aidc-textarea:disabled, .aidc-select:disabled { opacity: 0.5; cursor: not-allowed; }
  .dark .aidc-input, .dark .aidc-textarea, .dark .aidc-select { background: color-mix(in oklab, var(--input) 30%, transparent); }
  .aidc-input[type="file"] { padding: 0.25rem; }
  .aidc-input::file-selector-button { height: 1.75rem; margin-right: 0.5rem; padding: 0 0.5rem; border: 0; border-radius: calc(var(--radius) - 2px); background: var(--secondary); color: var(--secondary-foreground); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
  .aidc-textarea { height: auto; min-height: 4rem; padding: 0.5rem 0.75rem; resize: vertical; }
  .aidc-select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1rem;
    cursor: pointer;
  }
  .aidc-checkbox, .aidc-radio {
    appearance: none;
    display: inline-grid;
    flex-shrink: 0;
    place-content: center;
    width: 1rem;
    height: 1rem;
    margin: 0;
    border: 1px solid var(--input);
    border-radius: 4px;
    background: var(--background);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    vertical-align: middle;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
  }
  .aidc-radio { border-radius: 9999px; }
  .dark .aidc-checkbox, .dark .aidc-radio { background: color-mix(in oklab, var(--input) 30%, transparent); }
  .aidc-checkbox:checked { border-color: var(--primary); background: var(--primary); }
  .aidc-checkbox:checked::after {
    content: "";
    width: 0.625rem;
    height: 0.625rem;
    background: var(--primary-foreground);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .aidc-radio:checked::after { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: var(--primary); }
  .aidc-checkbox:focus-visible, .aidc-radio:focus-visible, .aidc-switch:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
  .aidc-checkbox:disabled, .aidc-radio:disabled, .aidc-switch:disabled { opacity: 0.5; cursor: not-allowed; }
  .aidc-switch {
    appearance: none;
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 2rem;
    height: 1.15rem;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: var(--input);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    vertical-align: middle;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s, box-shadow 0.15s;
  }
  .aidc-switch::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 1px;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background: var(--background);
    transform: translateY(-50%);
    transition: transform 0.15s;
  }
  .aidc-switch:checked { background: var(--primary); }
  .aidc-switch:checked::before { transform: translate(calc(2rem - 1rem - 4px), -50%); }
  .dark .aidc-switch::before { background: var(--foreground); }
  .dark .aidc-switch:checked::before { background: var(--primary-foreground); }
  .aidc-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; line-height: 1; user-select: none; }
  .aidc-label:has(:disabled) { opacity: 0.5; cursor: not-allowed; }
  .aidc-field { display: grid; gap: 0.5rem; }
  .aidc-field__description { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
  .aidc-field__error { margin: 0; color: var(--destructive); font-size: 0.875rem; }

  /* ── 卡片 ────────────────────────────────────────────────────────────── */
  .aidc-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    background: var(--card);
    color: var(--card-foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  }
  .aidc-card__header { display: grid; grid-auto-rows: min-content; align-items: start; gap: 0.375rem; padding: 0 1.5rem; }
  .aidc-card__header:has(.aidc-card__action) { grid-template-columns: 1fr auto; }
  .aidc-card__title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.2; }
  .aidc-card__description { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
  .aidc-card__action { grid-column: 2; grid-row: 1 / span 2; align-self: start; justify-self: end; }
  .aidc-card__content { padding: 0 1.5rem; }
  .aidc-card__footer { display: flex; align-items: center; gap: 0.5rem; padding: 0 1.5rem; }

  /* ── 徽章 / 提示 ─────────────────────────────────────────────────────── */
  .aidc-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: fit-content;
    padding: 0.125rem 0.5rem;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.33;
    white-space: nowrap;
  }
  .aidc-badge svg { width: 0.75rem; height: 0.75rem; pointer-events: none; }
  .aidc-badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
  .aidc-badge--outline { border-color: var(--border); background: transparent; color: var(--foreground); }
  .aidc-badge--destructive { background: var(--destructive); color: #ffffff; }
  .aidc-badge--signal { border-color: color-mix(in oklab, var(--signal) 30%, transparent); background: color-mix(in oklab, var(--signal) 10%, transparent); color: var(--signal); }
  .aidc-badge--success { border-color: color-mix(in oklab, var(--success) 30%, transparent); background: color-mix(in oklab, var(--success) 10%, transparent); color: var(--success); }
  .aidc-alert {
    position: relative;
    display: grid;
    grid-template-columns: 0 1fr;
    align-items: start;
    gap: 0.125rem 0;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
    color: var(--card-foreground);
    font-size: 0.875rem;
  }
  .aidc-alert:has(> svg) { grid-template-columns: 1rem 1fr; column-gap: 0.75rem; }
  .aidc-alert > svg { width: 1rem; height: 1rem; transform: translateY(2px); color: currentColor; }
  .aidc-alert__title { grid-column: 2; min-height: 1rem; font-weight: 500; line-height: 1.25; }
  .aidc-alert__description { grid-column: 2; display: grid; gap: 0.25rem; color: var(--muted-foreground); line-height: 1.6; }
  .aidc-alert--destructive { color: var(--destructive); }
  .aidc-alert--destructive .aidc-alert__description { color: color-mix(in oklab, var(--destructive) 90%, transparent); }

  /* ── 表格 ────────────────────────────────────────────────────────────── */
  .aidc-table-wrap { position: relative; width: 100%; overflow-x: auto; }
  .aidc-table { width: 100%; border-collapse: collapse; caption-side: bottom; font-size: 0.875rem; }
  .aidc-table thead tr { border-bottom: 1px solid var(--border); }
  .aidc-table th { height: 2.5rem; padding: 0 0.5rem; color: var(--foreground); font-weight: 500; text-align: left; vertical-align: middle; white-space: nowrap; }
  .aidc-table td { padding: 0.5rem; vertical-align: middle; white-space: nowrap; }
  .aidc-table tbody tr { border-bottom: 1px solid var(--border); transition: background-color 0.15s; }
  .aidc-table tbody tr:last-child { border-bottom: 0; }
  .aidc-table tbody tr:hover { background: color-mix(in oklab, var(--muted) 50%, transparent); }
  .aidc-table tbody tr[aria-selected="true"] { background: var(--muted); }
  .aidc-table tfoot { border-top: 1px solid var(--border); background: color-mix(in oklab, var(--muted) 50%, transparent); font-weight: 500; }
  .aidc-table caption { margin-top: 1rem; color: var(--muted-foreground); font-size: 0.875rem; }
  .aidc-table--wrap th, .aidc-table--wrap td { white-space: normal; }
  .aidc-num, .aidc-table .aidc-num { text-align: right; font-variant-numeric: tabular-nums; }

  /* ── 标签页 ──────────────────────────────────────────────────────────── */
  .aidc-tabs { display: flex; flex-direction: column; gap: 0.5rem; }
  .aidc-tabs__list { display: inline-flex; align-items: center; justify-content: center; width: fit-content; height: 2.25rem; padding: 3px; border-radius: calc(var(--radius) + 2px); background: var(--muted); color: var(--muted-foreground); }
  .aidc-tabs__trigger {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: calc(100% - 1px);
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    transition: color 0.15s, box-shadow 0.15s, background-color 0.15s;
  }
  .aidc-tabs__trigger[aria-selected="true"] { background: var(--background); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
  .aidc-tabs__trigger:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
  .aidc-tabs__trigger:disabled { opacity: 0.5; pointer-events: none; }
  .dark .aidc-tabs__trigger { color: var(--muted-foreground); }
  .dark .aidc-tabs__trigger[aria-selected="true"] { border-color: var(--input); background: color-mix(in oklab, var(--input) 30%, transparent); color: var(--foreground); }
  .aidc-tabs__panel { flex: 1; outline: none; }

  /* ── 对话框（原生 <dialog>）────────────────────────────────────────────── */
  .aidc-dialog {
    width: calc(100% - 2rem);
    max-width: 32rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    background: var(--background);
    color: var(--foreground);
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.02), 0 8px 16px -4px rgb(0 0 0 / 0.04), 0 24px 32px -8px rgb(0 0 0 / 0.06);
  }
  .aidc-dialog[open] { display: grid; gap: 1rem; animation: aidc-dialog-in 0.2s ease-out; }
  .aidc-dialog::backdrop { background: rgb(0 0 0 / 0.32); backdrop-filter: blur(2px); }
  .aidc-dialog__header { display: flex; flex-direction: column; gap: 0.5rem; text-align: center; }
  .aidc-dialog__title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.2; }
  .aidc-dialog__description { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
  .aidc-dialog__footer { display: flex; flex-direction: column-reverse; gap: 0.5rem; }
  @media (min-width: 640px) {
    .aidc-dialog__header { text-align: left; }
    .aidc-dialog__footer { flex-direction: row; justify-content: flex-end; }
  }

  /* ── Toast ───────────────────────────────────────────────────────────── */
  .aidc-toaster {
    position: fixed;
    z-index: 100;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(22rem, calc(100vw - 2rem));
    transform: translateX(-50%);
    pointer-events: none;
  }
  @media (min-width: 640px) { .aidc-toaster { right: 1rem; left: auto; transform: none; } }
  .aidc-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--popover);
    color: var(--popover-foreground);
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.02), 0 4px 8px -4px rgb(0 0 0 / 0.04), 0 16px 24px -8px rgb(0 0 0 / 0.06);
    font-size: 0.875rem;
    pointer-events: auto;
    animation: aidc-toast-in 0.2s ease-out;
  }
  .aidc-toast > svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
  .aidc-toast[data-variant="success"] > svg { color: var(--success); }
  .aidc-toast[data-variant="error"] > svg { color: var(--destructive); }
  .aidc-toast__body { display: grid; flex: 1; gap: 0.125rem; min-width: 0; }
  .aidc-toast__title { font-weight: 500; }
  .aidc-toast__description { color: var(--muted-foreground); }
  .aidc-toast__action { flex-shrink: 0; align-self: center; }
  .aidc-toast[data-leaving] { animation: aidc-toast-out 0.15s ease-in forwards; }

  /* ── 加载动效：品牌斜杆 //（skewX -20°），只动 transform / opacity ─────── */
  .aidc-loader { display: inline-flex; flex: none; align-items: center; gap: 0.3em; height: 1em; color: var(--signal); vertical-align: middle; }
  .aidc-loader > i, .aidc-loader [data-slot="train"] > i, .aidc-loader [data-slot="runner"] > i { display: block; flex: none; width: 0.26em; height: 1em; border-radius: 0.04em; background: currentColor; transform: skewX(-20deg); }
  .aidc-loader[data-variant="cadence"] > i { animation: aidc-loader-cadence 1.1s ease-in-out infinite; }
  .aidc-loader[data-variant="cadence"] > i:nth-child(2) { animation-delay: 0.55s; }
  .aidc-loader[data-variant="sequence"] > i { animation: aidc-loader-seq1 1.2s linear infinite; }
  .aidc-loader[data-variant="sequence"] > i:nth-child(2) { animation-name: aidc-loader-seq2; }
  .aidc-loader[data-variant="sweep"] > i { animation: aidc-loader-sweep 1s ease-in-out infinite; }
  .aidc-loader[data-variant="sweep"] > i:nth-child(2) { animation-delay: 0.15s; }
  .aidc-loader[data-variant="march"] { width: 1.38em; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent); mask: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent); }
  .aidc-loader[data-variant="march"] > [data-slot="train"] { display: flex; gap: 0.3em; animation: aidc-loader-train 0.55s linear infinite; }
  .aidc-loader[data-variant="pulse"] > i { transform-origin: 50% 50%; animation: aidc-loader-pulse 0.75s ease-in-out infinite; }
  .aidc-loader[data-variant="pulse"] > i:nth-child(2) { animation-delay: -0.375s; }
  .aidc-loader[data-variant="breathe"] { animation: aidc-loader-breathe 1.8s ease-in-out infinite; }
  .aidc-loader[data-variant="track"] { position: relative; display: inline-block; width: 8.25em; height: 2px; border-radius: 1px; background: var(--border); }
  .aidc-loader[data-variant="track"] > [data-slot="lane"] { position: absolute; inset: 0; animation: aidc-loader-run 1.15s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
  .aidc-loader[data-variant="track"] [data-slot="runner"] { position: absolute; top: 50%; left: 0; display: flex; gap: 0.3em; height: 1em; font-size: 0.5625em; transform: translateY(-50%); }
  .aidc-loader[data-variant="dial"] { position: relative; display: inline-block; width: 1em; height: 1em; }
  .aidc-loader[data-variant="dial"] > i { position: absolute; top: calc(50% - 0.13em); left: calc(50% - 0.045em); width: 0.09em; height: 0.26em; border-radius: 0.03em; animation: aidc-loader-tick 0.8s linear infinite; }
  .aidc-loader[data-variant="dial"] > i:nth-child(1) { transform: rotate(0deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.8s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(2) { transform: rotate(45deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.7s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(3) { transform: rotate(90deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.6s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(4) { transform: rotate(135deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.5s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(5) { transform: rotate(180deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.4s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(6) { transform: rotate(225deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.3s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(7) { transform: rotate(270deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.2s; }
  .aidc-loader[data-variant="dial"] > i:nth-child(8) { transform: rotate(315deg) translateY(-0.36em) skewX(-20deg); animation-delay: -0.1s; }

  /* ── 标识 ────────────────────────────────────────────────────────────── */
  .aidc-logo { display: inline-flex; align-items: center; gap: 0.35em; color: var(--foreground); font-weight: 800; letter-spacing: 0.06em; line-height: 1; text-decoration: none; }
  .aidc-mark { flex-shrink: 0; width: 1.4em; height: 1.4em; color: #ff4d00; }

  /* ── 其余小件 ────────────────────────────────────────────────────────── */
  .aidc-skeleton { border-radius: var(--radius); background: var(--accent); animation: aidc-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
  .aidc-separator { flex-shrink: 0; width: 100%; height: 1px; margin: 0; border: 0; background: var(--border); }
  .aidc-separator--vertical { align-self: stretch; width: 1px; height: auto; }
  .aidc-kbd { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 1.25rem; height: 1.25rem; padding: 0 0.25rem; border-radius: calc(var(--radius) - 2px); background: var(--muted); color: var(--muted-foreground); font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500; pointer-events: none; user-select: none; }
  .aidc-avatar { position: relative; display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 2rem; height: 2rem; overflow: hidden; border-radius: 9999px; background: var(--muted); color: var(--foreground); font-size: 0.75rem; font-weight: 500; }
  .aidc-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .aidc-progress { appearance: none; display: block; width: 100%; height: 0.5rem; overflow: hidden; border: 0; border-radius: 9999px; background: color-mix(in oklab, var(--primary) 20%, transparent); }
  .aidc-progress::-webkit-progress-bar { background: color-mix(in oklab, var(--primary) 20%, transparent); }
  .aidc-progress::-webkit-progress-value { border-radius: 9999px; background: var(--primary); }
  .aidc-progress::-moz-progress-bar { border-radius: 9999px; background: var(--primary); }
  .aidc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-width: 0; padding: 3rem 1.5rem; border: 1px dashed var(--border); border-radius: calc(var(--radius) + 6px); text-align: center; }
  .aidc-empty__media { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: calc(var(--radius) + 2px); background: var(--muted); color: var(--foreground); }
  .aidc-empty__media svg { width: 1.5rem; height: 1.5rem; }
  .aidc-empty__title { margin: 0; font-size: 1.125rem; font-weight: 500; }
  .aidc-empty__description { max-width: 24rem; margin: 0; color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.6; }
}

@keyframes aidc-dialog-in { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
@keyframes aidc-toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes aidc-toast-out { to { opacity: 0; transform: translateY(4px); } }
@keyframes aidc-pulse { 50% { opacity: 0.5; } }
@keyframes aidc-loader-cadence { 0%, 50%, 100% { opacity: 0.25; } 25% { opacity: 1; } }
@keyframes aidc-loader-seq1 { 0%, 6% { opacity: 0.15; } 10%, 88% { opacity: 1; } 94%, 100% { opacity: 0.15; } }
@keyframes aidc-loader-seq2 { 0%, 46% { opacity: 0.15; } 50%, 88% { opacity: 1; } 94%, 100% { opacity: 0.15; } }
@keyframes aidc-loader-sweep { 0%, 45%, 100% { opacity: 0.3; } 18% { opacity: 1; } }
@keyframes aidc-loader-train { to { transform: translateX(-0.56em); } }
@keyframes aidc-loader-pulse { 0%, 100% { transform: skewX(-20deg) scaleY(0.5); } 50% { transform: skewX(-20deg) scaleY(1); } }
@keyframes aidc-loader-breathe { 0%, 100% { opacity: 0.35; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1); } }
@keyframes aidc-loader-run { 0% { opacity: 0; transform: translateX(-8%); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(102%); } }
@keyframes aidc-loader-tick { 0% { opacity: 1; } 100% { opacity: 0.12; } }

@media (prefers-reduced-motion: reduce) {
  .aidc-loader > i, .aidc-loader > [data-slot="train"], .aidc-loader > [data-slot="lane"] { animation: none; }
  .aidc-loader { animation: aidc-loader-breathe 2.4s ease-in-out infinite; }
  .aidc-dialog[open], .aidc-toast, .aidc-toast[data-leaving], .aidc-skeleton { animation: none; }
}
