/* 共用交互组件：颜色随当前系统主题变化。 */
:root { --component-surface: #fff; --component-tint: #f4f7fa; }
body.nav-theme-green { --component-surface: var(--care-surface); --component-tint: #edf3e9; }
.component-button, .column-settings > summary, .saved-views > summary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--component-surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.column-settings > summary, .saved-views > summary, .row-more > summary { list-style: none; }
.column-settings > summary::-webkit-details-marker, .saved-views > summary::-webkit-details-marker, .row-more > summary::-webkit-details-marker { display: none; }
.component-button:hover, .column-settings > summary:hover, .saved-views > summary:hover { background: var(--component-tint); }
.component-caption { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.table-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 12px 0 9px; }
.table-hint { margin-right: auto; color: var(--muted); font-size: 12px; }
.column-settings, .saved-views { position: relative; }
.column-panel, .saved-view-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: min(310px, calc(100vw - 48px));
  padding: 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--component-surface); box-shadow: 0 12px 32px rgba(30, 50, 40, .14);
  max-height: 460px; overflow-y: auto;
}
.column-option { display: flex; align-items: center; gap: 5px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.column-option > label { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.column-move { border: 1px solid var(--line); background: var(--component-surface); color: var(--text); border-radius: 6px; width: 28px; height: 28px; flex-shrink: 0; }
.column-move:disabled { opacity: .3; cursor: default; }
.column-pin { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 12px; }
.interactive-table-scroll { width: 100%; min-width: 0; max-height: 66vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 11px; scrollbar-gutter: stable; }
.interactive-table-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
table.data.interactive-table { table-layout: fixed; border: 0; border-radius: 0; overflow: visible; border-collapse: separate; border-spacing: 0; margin: 0; }
.data.interactive-table th { position: sticky; top: 0; z-index: 3; padding-right: 20px; background: var(--component-tint); }
.data.interactive-table :is(th, td) { overflow-wrap: anywhere; white-space: normal; min-width: 0; max-width: none; }
.data.interactive-table td { background: var(--component-surface); }
.data.interactive-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--component-tint) 35%, var(--component-surface)); }
.data.interactive-table .pinned-first { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.data.interactive-table .pinned-last { position: sticky; right: 0; z-index: 2; box-shadow: -1px 0 0 var(--line); }
.data.interactive-table thead .pinned-first, .data.interactive-table thead .pinned-last { z-index: 5; }
.data.interactive-table[data-density=compact] td { padding-top: 8px; padding-bottom: 8px; }
.column-title { display: block; min-width: 0; }
.column-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; border-radius: 0; }
.column-resize:after { content: ''; position: absolute; top: 25%; bottom: 25%; left: 5px; width: 2px; background: var(--line); }
.column-resize:hover:after, .column-resize:focus-visible:after { background: var(--primary); }
.is-resizing { user-select: none; }
.data.interactive-table .ops > button { margin-bottom: 5px; }
.row-more { display: inline-block; vertical-align: top; margin-left: 6px; font-size: 12px; color: var(--primary); }
.row-more > summary { cursor: pointer; padding: 0 5px; }
.row-more-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 10px 0 4px; }
.row-more-actions button { text-align: left; }
.expandable-cell { max-height: 3.2em; overflow: hidden; }
.expandable-cell.is-expanded { max-height: none; }
.cell-expand { border: 0; background: transparent; color: var(--primary); font-size: 12px; padding: 4px 0; }
.filter-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
.filter-chip { padding: 5px 10px; border: 0; border-radius: 14px; background: var(--component-tint); color: var(--primary); font-size: 12px; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.live-filter-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.filter-action-divider { align-self: stretch; width: 1px; background: var(--line); margin: 2px 3px; }
.saved-view-row { display: flex; gap: 8px; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.saved-view-row button { border: 0; background: transparent; color: var(--primary); padding: 3px; font-size: 12px; text-align: left; }
.saved-view-panel > input { display: block; width: 100%; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--component-surface); color: var(--text); }
.saved-view-panel > button { padding: 7px 12px; border: 0; border-radius: 16px; background: var(--primary); color: #fff; margin-bottom: 10px; }
.list-results { position: relative; }
.list-updating { color: var(--primary); font-size: 12px; padding: 7px 0; }
.list-results[aria-busy=true] .interactive-table { opacity: .6; }
.searchable-select { display: inline-block; position: relative; min-width: 130px; max-width: 100%; vertical-align: middle; }
.enhanced-native-select { position: absolute !important; opacity: 0; pointer-events: none; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; }
.select-trigger { display: block; text-align: left; width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--component-surface); color: var(--text); font: inherit; font-size: 13px; white-space: normal; }
.select-trigger:disabled { opacity: .55; cursor: not-allowed; }
.select-popover { position: fixed; inset: auto; margin: 0; padding: 10px; max-height: 310px; border: 1px solid var(--line); border-radius: 12px; background: var(--component-surface); color: var(--text); box-shadow: 0 12px 32px rgba(30, 50, 40, .16); }
.select-popover > input { display: block; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--component-surface); color: var(--text); font: inherit; margin: 0 0 8px; }
.select-options { max-height: 235px; overflow-y: auto; }
.select-option { display: block; width: 100%; border: 0; padding: 9px 10px; border-radius: 6px; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 13px; }
.select-option:hover, .select-option[aria-selected=true] { background: var(--component-tint); color: var(--primary); }
.select-option:disabled { opacity: .5; }
.dialog .searchable-select { display: block; width: 100%; margin-top: 6px; }
.dialog .dialog-actions { position: sticky; bottom: -20px; z-index: 12; background: var(--component-surface); padding-bottom: 10px; box-shadow: 0 -6px 12px var(--component-surface); }
.dialog [aria-invalid=true] { border-color: #a33e36 !important; }
.dialog .form-section { grid-column: 1 / -1; padding-top: 15px; margin: 8px 0 0; border-top: 1px solid var(--line-soft); color: var(--primary); font-size: 13px; }
.dialog .form-section:first-child { margin-top: 0; padding-top: 0; border: 0; }
body.nav-theme-green .q-bar .select-trigger { border-radius: 9px; background: #f7f8f2; color: var(--text); padding: 7px 11px; }
body.nav-theme-green .q-bar .select-option { border: 0; border-radius: 6px; background: transparent; color: var(--text); padding: 9px 10px; min-height: 0; }
body.nav-theme-green .q-bar .select-option:hover, body.nav-theme-green .q-bar .select-option[aria-selected=true] { background: var(--care-tint); color: var(--primary); }
.mask:has(.detail-drawer) { justify-content: flex-end; }
.dialog.detail-drawer { height: 100dvh; max-height: 100dvh; width: min(880px, 90vw); max-width: 100vw; border-radius: 20px 0 0 20px; margin: 0; }
.detail-drawer h4 { color: var(--text); padding-top: 16px; margin-top: 24px; border-top: 1px solid var(--line-soft); }
.detail-drawer .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-wrap: anywhere; }
.workflow-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-top: 18px; }
.workflow-card { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 17px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--component-surface); color: var(--text); text-align: left; font: inherit; }
.workflow-card:hover { background: var(--component-tint); border-color: var(--line); }
.workflow-card > span { font-size: 13px; }
.workflow-card > strong { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.workflow-card > small { font-size: 12px; color: var(--primary); }
@media(max-width:700px) {
  .table-hint { flex-basis: 100%; }
  .column-panel, .saved-view-panel { max-height: 55vh; }
  .filter-action-divider { display: none; }
  .dialog.detail-drawer { width: 100vw; border-radius: 0; }
  .detail-drawer .detail-grid { grid-template-columns: 1fr; }
  .select-trigger, .select-popover > input { font-size: 16px; }
}
