/* 来源：docs/design-system/components/bundle.css；工件版本 1792798083-12be。保留全部公共 ty-* 类。 */
/* 汇智助手 控制台 — 组件样式。只引用 tokens.json 的变量；文字大小来自类型样式类（.body .label .caption …）。 */

body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 22px; color: var(--ink); background: var(--bg-page); -webkit-font-smoothing: antialiased; }

/* ---------- 通用 ---------- */
.ty-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ty-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ty-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.ty-demo { padding: var(--space-5); }
.ty-icon { display: inline-block; flex: none; vertical-align: middle; }
.ty-muted { color: var(--ink-muted); }
.ty-link { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ty-kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-muted); font-family: var(--font-mono); font-size: 11px; line-height: 16px; box-sizing: border-box; }

.ty-btn:focus-visible, .ty-nav-item:focus-visible, .ty-tab:focus-visible, .ty-input:focus-visible,
.ty-id-copy:focus-visible, .ty-check input:focus-visible, .ty-link:focus-visible, .ty-msg-bubble:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* ---------- 标志 ---------- */
.ty-logo { display: block; flex: none; }
.ty-logo-t, .ty-logo-s { fill: var(--brand); }
.ty-logo-word { fill: var(--logo-word); }
.ty-logo-mono .ty-logo-t, .ty-logo-mono .ty-logo-s, .ty-logo-mono .ty-logo-word { fill: currentColor; }

/* ---------- 状态标记：形状随语气变化，不只靠颜色 ---------- */
.ty-mark { display: inline-block; flex: none; width: 8px; height: 8px; box-sizing: border-box; }
.ty-mark-success { background: var(--success); border-radius: var(--radius-full); }
.ty-mark-info { width: 7px; height: 7px; margin: 0 1px; background: var(--info); border-radius: 1px; transform: rotate(45deg); }
.ty-mark-warning { width: 10px; height: 9px; background: var(--warning); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ty-mark-danger { background: var(--danger); border-radius: 1px; }
.ty-mark-neutral { border: 2px solid var(--neutral); border-radius: var(--radius-full); background: transparent; }

/* ---------- AppShell ---------- */
.ty-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; background: var(--bg-page); }
.ty-shell-side { position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--surface); border-right: 1px solid var(--line); box-sizing: border-box; }
.ty-shell-main { display: flex; flex-direction: column; min-width: 0; }
.ty-content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--space-6) var(--space-8) var(--space-10); box-sizing: border-box; }

/* ---------- SideNav ---------- */
.ty-nav { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-4) var(--space-3) var(--space-6); }
.ty-nav-brand { display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2); }
.ty-nav-brand small { padding-top: 3px; color: var(--ink-muted); font-size: 12px; line-height: 18px; font-weight: 500; }
.ty-nav-identity { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); }
.ty-nav-identity-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); }
.ty-nav-identity-text { display: flex; flex-direction: column; min-width: 0; }
.ty-nav-identity-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-nav-identity-text > span + span { color: var(--ink-muted); }
.ty-nav-groups { display: flex; flex-direction: column; gap: var(--space-4); }
.ty-nav-group { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ty-nav-group-label { padding: 0 var(--space-2) var(--space-1); color: var(--ink-muted); }
.ty-nav-item { display: flex; align-items: center; gap: var(--space-2); width: 100%; height: var(--control-md); padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font-family: var(--font-sans); text-align: left; cursor: pointer; box-sizing: border-box; }
.ty-nav-item .ty-icon { color: var(--ink-muted); }
.ty-nav-item:hover { background: var(--surface-hover); }
.ty-nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.ty-nav-item[aria-current="page"] .ty-icon { color: var(--brand-ink); }
.ty-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; box-sizing: border-box; }
.ty-nav-item[aria-current="page"] .ty-count { background: var(--surface); }

/* ---------- TopBar ---------- */
.ty-topbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--space-4); height: var(--topbar-height); padding: 0 var(--space-8); background: var(--surface); border-bottom: 1px solid var(--line); box-sizing: border-box; }
.ty-crumbs { display: flex; align-items: center; gap: var(--space-1); min-width: 0; margin: 0; padding: 0; list-style: none; color: var(--ink-muted); }
.ty-crumbs li { display: flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.ty-crumbs li:last-child { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ty-crumbs a { color: inherit; text-decoration: none; }
.ty-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.ty-search { position: relative; display: flex; align-items: center; width: 300px; max-width: 40%; margin-left: auto; }
.ty-search > .ty-icon { position: absolute; left: var(--space-3); color: var(--ink-muted); pointer-events: none; }
.ty-search > .ty-kbd { position: absolute; right: var(--space-2); pointer-events: none; }
.ty-search .ty-input { padding-left: 34px; padding-right: 30px; background: var(--surface-sunken); }
.ty-topbar-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.ty-topbar-search-off .ty-topbar-actions { margin-left: auto; }

/* ---------- PageHeader ---------- */
.ty-pagehead { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); }
.ty-pagehead-text { flex: 1; min-width: 0; }
.ty-pagehead-text h1 { margin: 0; color: var(--ink); }
.ty-pagehead-text p { margin: var(--space-1) 0 0; max-width: 720px; color: var(--ink-muted); }
.ty-pagehead-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: none; }

/* ---------- Tabs ---------- */
.ty-tabs { display: flex; gap: var(--space-1); margin-bottom: var(--space-4); border-bottom: 1px solid var(--line); overflow-x: auto; }
.ty-tab { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-3); border: 0; background: none; color: var(--ink-muted); font-family: var(--font-sans); cursor: pointer; white-space: nowrap; }
.ty-tab:hover { color: var(--ink); }
.ty-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.ty-tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: 2px; background: var(--brand); border-radius: 1px; }
.ty-tab .ty-count { margin-left: 0; background: var(--neutral-soft); color: var(--ink-muted); }
.ty-tab[aria-selected="true"] .ty-count { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Button ---------- */
.ty-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md); font-family: var(--font-sans); white-space: nowrap; cursor: pointer; box-sizing: border-box; text-decoration: none; }
.ty-btn-primary { background: var(--brand); color: var(--on-brand); }
.ty-btn-primary:hover { background: var(--brand-hover); }
.ty-btn-secondary { background: var(--surface); border-color: var(--line-control); color: var(--ink); }
.ty-btn-secondary:hover { background: var(--surface-hover); }
.ty-btn-ghost { background: transparent; color: var(--ink); }
.ty-btn-ghost:hover { background: var(--surface-hover); }
.ty-btn-danger { background: var(--danger); color: var(--on-danger); }
.ty-btn-danger:hover { background: var(--danger-ink); }
.ty-btn-sm { height: var(--control-sm); padding: 0 var(--space-2); gap: var(--space-1); }
.ty-btn-lg { height: var(--control-lg); padding: 0 var(--space-4); }
.ty-btn-icon { width: var(--control-md); padding: 0; }
.ty-btn-sm.ty-btn-icon { width: var(--control-sm); }
.ty-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ty-spin { display: inline-block; flex: none; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--radius-full); box-sizing: border-box; animation: ty-spin 0.8s linear infinite; }
@keyframes ty-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ty-spin { animation: none; border-right-color: currentColor; border-style: dotted; } }

/* ---------- Field / Input ---------- */
.ty-field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.ty-field-label { color: var(--ink); }
.ty-field-label em { margin-left: var(--space-1); color: var(--ink-muted); font-style: normal; font-weight: 400; }
.ty-field-hint { color: var(--ink-muted); }
.ty-field-error { display: flex; align-items: center; gap: var(--space-1); color: var(--danger-ink); }
.ty-input { display: block; width: 100%; height: var(--control-md); margin: 0; padding: 0 var(--space-3); border: 1px solid var(--line-control); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-family: var(--font-sans); box-sizing: border-box; }
.ty-input::placeholder { color: var(--ink-muted); }
.ty-input[aria-invalid="true"] { border-color: var(--danger); }
.ty-input:disabled { background: var(--surface-sunken); color: var(--ink-disabled); cursor: not-allowed; }
textarea.ty-input { height: auto; min-height: 88px; padding: var(--space-2) var(--space-3); resize: vertical; }
textarea.ty-input-mono { font-family: var(--font-mono); }
.ty-select { position: relative; display: block; }
.ty-select select.ty-input { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.ty-select > .ty-icon { position: absolute; top: 50%; right: var(--space-2); margin-top: -8px; color: var(--ink-muted); pointer-events: none; }

/* ---------- Checkbox ---------- */
.ty-check { display: inline-flex; align-items: flex-start; gap: var(--space-2); color: var(--ink); cursor: pointer; }
.ty-check input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); cursor: pointer; }
.ty-check-hint { display: block; color: var(--ink-muted); }

/* ---------- SettingsRow ---------- */
.ty-setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 320px); gap: var(--space-6); align-items: center; padding: var(--space-4) var(--space-5); border-top: 1px solid var(--line); }
.ty-setting:first-child { border-top: 0; }
.ty-setting-text { min-width: 0; }
.ty-setting-text > * { display: block; }
.ty-setting-text > span + span { margin-top: 2px; color: var(--ink-muted); }
.ty-setting-control { min-width: 0; }
.ty-setting-control .ty-field { margin-bottom: 0; }

/* ---------- Card ---------- */
.ty-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.ty-card-head { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.ty-card-head-text { flex: 1; min-width: 0; }
.ty-card-head h3 { margin: 0; color: var(--ink); }
.ty-card-head p { margin: 2px 0 0; color: var(--ink-muted); }
.ty-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: none; }
.ty-card-body { padding: var(--space-5); }
.ty-card-body > :first-child { margin-top: 0; }
.ty-card-body > :last-child { margin-bottom: 0; }
.ty-card-flush > .ty-card-body { padding: 0; }
.ty-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--surface-sunken); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.ty-card-danger { border-color: var(--danger); }
.ty-card-danger > .ty-card-head h3 { color: var(--danger-ink); }
.ty-card-danger > .ty-card-foot { background: var(--danger-soft); border-top-color: var(--danger); }

/* ---------- DataTable ---------- */
.ty-table-wrap { max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.ty-card-flush > .ty-card-body > .ty-table-wrap { border: 0; border-radius: 0; margin: 0; background: transparent; }
.ty-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--line); }
.ty-table-toolbar > .ty-search { margin-left: 0; width: 260px; max-width: 100%; }
.ty-table-scroll { overflow-x: auto; }
.ty-table { width: 100%; border-collapse: collapse; }
.ty-table th { padding: var(--space-2) var(--space-3); text-align: left; font-weight: 600; color: var(--ink-muted); background: var(--surface-sunken); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ty-table-wrap > .ty-table-scroll:first-child .ty-table thead th:first-child { border-top-left-radius: var(--radius-lg); }
.ty-table-wrap > .ty-table-scroll:first-child .ty-table thead th:last-child { border-top-right-radius: var(--radius-lg); }
.ty-table td { padding: 10px var(--space-3); border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; color: var(--ink); }
.ty-table tbody tr:first-child td { border-top: 0; }
.ty-table tbody tr:hover td { background: var(--surface-hover); }
.ty-table td.mono-small { padding-top: 12px; }
.ty-table td.ty-actions-cell { padding-top: 6px; padding-bottom: 6px; }
.ty-table td.ty-nowrap { white-space: nowrap; overflow-wrap: normal; }
.ty-table .ty-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ty-table .ty-actions-cell { width: 1%; white-space: nowrap; text-align: right; }
.ty-table .ty-actions-cell .ty-btn + .ty-btn { margin-left: var(--space-1); }
.ty-cell-empty { color: var(--ink-muted); }
.ty-table-foot { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--line); color: var(--ink-muted); }

/* ---------- MetricTile ---------- */
.ty-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.ty-metric { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ty-metric-label { color: var(--ink-muted); }
.ty-metric-value { display: flex; align-items: baseline; gap: var(--space-1); color: var(--ink); font-variant-numeric: tabular-nums; }
.ty-metric-value > span + span { color: var(--ink-muted); }
.ty-metric-unknown .ty-metric-value > span:first-child { color: var(--ink-muted); }
.ty-metric-hint { color: var(--ink-muted); }

/* ---------- KeyValue ---------- */
.ty-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-6); margin: 0; }
.ty-kv dt { color: var(--ink-muted); }
.ty-kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ty-kv dd.ty-cell-empty { color: var(--ink-muted); }

/* ---------- StatusBadge ---------- */
.ty-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-weight: 500; white-space: nowrap; vertical-align: middle; box-sizing: border-box; }
.ty-status-success { background: var(--success-soft); color: var(--success-ink); }
.ty-status-info { background: var(--info-soft); color: var(--info-ink); }
.ty-status-warning { background: var(--warning-soft); color: var(--warning-ink); }
.ty-status-danger { background: var(--danger-soft); color: var(--danger-ink); }
.ty-status-neutral { background: var(--neutral-soft); color: var(--ink-muted); }
.ty-status-plain { padding: 0; background: transparent; }

/* ---------- IdText ---------- */
.ty-id { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0 2px 0 var(--space-1); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink); vertical-align: middle; box-sizing: border-box; }
.ty-id-nocopy { padding-right: var(--space-1); }
.ty-id-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-id-copy { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); cursor: pointer; }
.ty-id-copy:hover { background: var(--surface-hover); color: var(--ink); }

/* ---------- Timeline ---------- */
.ty-timeline { margin: 0; padding: 0; list-style: none; }
.ty-timeline > li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: var(--space-3); padding-bottom: var(--space-4); }
.ty-timeline > li::before { content: ""; position: absolute; left: 7.5px; top: 20px; bottom: 4px; width: 1px; background: var(--line-strong); }
.ty-timeline > li:last-child { padding-bottom: 0; }
.ty-timeline > li:last-child::before { display: none; }
.ty-timeline > li > .ty-mark { justify-self: center; margin-top: 7px; }
.ty-timeline-ts { display: block; color: var(--ink-muted); }
.ty-timeline-text { margin: 0; overflow-wrap: anywhere; }

/* ---------- EmptyState ---------- */
.ty-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-10) var(--space-6); text-align: center; color: var(--ink-muted); }
.ty-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: var(--space-1); border-radius: var(--radius-lg); background: var(--surface-sunken); color: var(--ink-muted); }
.ty-empty-title { margin: 0; color: var(--ink); }
.ty-empty p { margin: 0; max-width: 420px; }
.ty-empty-action { margin-top: var(--space-2); }

/* ---------- Banner ---------- */
.ty-banner { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid; border-radius: var(--radius-lg); margin-bottom: var(--space-4); color: var(--ink); }
.ty-banner > .ty-icon { margin-top: 3px; }
.ty-banner-text { flex: 1; min-width: 0; }
.ty-banner-text > * { margin: 0; }
.ty-banner-action { display: flex; gap: var(--space-2); flex: none; margin: -3px 0; }
.ty-banner-info { background: var(--info-soft); border-color: var(--info); }
.ty-banner-info > .ty-icon, .ty-banner-info .ty-banner-title { color: var(--info-ink); }
.ty-banner-success { background: var(--success-soft); border-color: var(--success); }
.ty-banner-success > .ty-icon, .ty-banner-success .ty-banner-title { color: var(--success-ink); }
.ty-banner-warning { background: var(--warning-soft); border-color: var(--warning); }
.ty-banner-warning > .ty-icon, .ty-banner-warning .ty-banner-title { color: var(--warning-ink); }
.ty-banner-danger { background: var(--danger-soft); border-color: var(--danger); }
.ty-banner-danger > .ty-icon, .ty-banner-danger .ty-banner-title { color: var(--danger-ink); }

/* ---------- ExternalData ---------- */
.ty-external { margin: 0 0 var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-sunken); }
.ty-external-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); padding: var(--space-2) var(--space-4); border-bottom: 1px dashed var(--line-strong); color: var(--ink-muted); }
.ty-external-tag { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--warning-ink); font-weight: 600; }
.ty-external-note { margin-left: auto; }
.ty-external-body { padding: var(--space-3) var(--space-4); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ty-external-body > :first-child { margin-top: 0; }
.ty-external-body > :last-child { margin-bottom: 0; }

/* ---------- ConfirmDialog ---------- */
.ty-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: var(--space-4); background: var(--backdrop); }
.ty-dialog { width: 100%; max-width: var(--dialog-width); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-dialog); box-sizing: border-box; }
.ty-dialog-head { padding: var(--space-5) var(--space-6) 0; }
.ty-dialog-head h2 { margin: 0; color: var(--ink); }
.ty-dialog-body { padding: var(--space-2) var(--space-6) var(--space-5); }
.ty-dialog-body > p { margin: 0 0 var(--space-4); color: var(--ink); }
.ty-dialog-body > :last-child { margin-bottom: 0; }
.ty-dialog-foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--line); background: var(--surface-sunken); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Drawer ---------- */
.ty-drawer { position: fixed; top: 0; right: 0; z-index: 9; display: flex; flex-direction: column; width: min(var(--drawer-width), 95vw); height: 100vh; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-drawer); box-sizing: border-box; }
.ty-drawer-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--line); }
.ty-drawer-head h2 { flex: 1; min-width: 0; margin: 0; color: var(--ink); }
.ty-drawer-body { flex: 1; overflow: auto; padding: var(--space-6); }
.ty-drawer-body > :last-child { margin-bottom: 0; }
.ty-drawer-foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--line); background: var(--surface-sunken); }
.ty-section-title { margin: var(--space-6) 0 var(--space-3); color: var(--ink); }

/* ---------- ChatMessage ---------- */
.ty-thread { display: flex; flex-direction: column; gap: var(--space-4); }
.ty-msg { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); max-width: min(680px, 85%); }
.ty-msg-user { align-self: flex-end; align-items: flex-end; }
.ty-msg-meta { display: flex; gap: var(--space-2); color: var(--ink-muted); }
.ty-msg-meta strong { color: var(--ink); font-weight: 600; }
.ty-msg-bubble { padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ty-msg-user .ty-msg-bubble { background: var(--brand-soft); border-color: var(--brand-soft); }
.ty-msg-cites { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); color: var(--ink-muted); }

/* ---------- 窄屏 ---------- */
@media (max-width: 700px) {
  .ty-shell { grid-template-columns: 1fr; }
  .ty-shell-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .ty-nav { gap: var(--space-3); }
  .ty-nav-groups { flex-direction: row; flex-wrap: wrap; gap: var(--space-1); }
  .ty-nav-group { flex-direction: row; flex-wrap: wrap; }
  .ty-nav-group-label { display: none; }
  .ty-nav-item { width: auto; }
  .ty-topbar { padding: 0 var(--space-4); }
  .ty-search { display: none; }
  .ty-content { padding: var(--space-4); }
  .ty-pagehead { flex-direction: column; }
  .ty-setting { grid-template-columns: 1fr; gap: var(--space-2); }
}
