.system-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.system-tabs [aria-current] { background: #e9f5ef; color: #155640; border-color: #a4ccbb; font-weight: 700; }
.system-card { background: white; border: 1px solid #e1e9e5; border-radius: 14px; padding: 1rem 1.25rem; margin: 0 0 1rem; min-width: 0; }
.system-card-header, .system-inline, .system-copy { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.system-card-header { justify-content: space-between; margin-bottom: .75rem; }
.system-card h2 { font-size: 1.05rem; margin: 0; }
.system-card td { overflow-wrap: anywhere; }
.system-card td button { white-space: nowrap; }
.system-canvas-usage {
  container-type: inline-size;
  --usage-success: #26734f;
  --usage-warning: #8d580e;
  --usage-error: #ad3e45;
}
.tenant-shell[data-theme="dark"] .system-canvas-usage {
  --usage-success: #84d4aa;
  --usage-warning: #f1be74;
  --usage-error: #f3a5ac;
}
.system-canvas-usage .system-card-header { gap: .65rem 1rem; margin-bottom: 1rem; }
.system-canvas-usage-range {
  gap: .15rem; padding: .2rem; border: 1px solid var(--border); border-radius: 10px; background: var(--nav);
}
.tenant-shell .system-canvas-usage .system-canvas-usage-range button {
  min-height: 30px; padding: .25rem .65rem; border: 1px solid transparent; border-radius: 7px;
  color: var(--muted); font-size: .78rem;
}
.tenant-shell .system-canvas-usage .system-canvas-usage-range button:is(:hover, :focus-visible, [aria-pressed="true"]) {
  color: var(--blue); background: var(--accent-bg);
}
.tenant-shell .system-canvas-usage .system-canvas-usage-range button[aria-pressed="true"] {
  border-color: var(--border); font-weight: 650;
}
.system-canvas-usage .table-scroll { border: 1px solid var(--border); border-radius: 10px; }
.system-canvas-usage table { min-width: 58rem; table-layout: fixed; font-size: .82rem; line-height: 1.4; }
.system-canvas-usage col:nth-child(1) { width: 11%; }
.system-canvas-usage col:nth-child(2) { width: 13%; }
.system-canvas-usage col:nth-child(3) { width: 8%; }
.system-canvas-usage col:nth-child(4) { width: 13%; }
.system-canvas-usage col:nth-child(5) { width: 8%; }
.system-canvas-usage col:nth-child(6) { width: 9%; }
.system-canvas-usage col:nth-child(8) { width: 8%; }
.system-canvas-usage col:nth-child(9) { width: 10%; }
.system-canvas-usage :is(th, td) { padding: .68rem .65rem; vertical-align: middle; border-left: 0; }
.system-canvas-usage th { font-size: .76rem; font-weight: 650; white-space: nowrap; }
.system-canvas-usage th:first-child { width: auto; }
.system-canvas-usage :is(th, td):nth-child(9) { text-align: right; }
.system-canvas-usage td:is(:nth-child(3), :nth-child(6), :nth-child(8), :nth-child(9)) { white-space: nowrap; }
.system-canvas-usage td:is(:nth-child(1), :nth-child(6), :nth-child(8), :nth-child(9)) { font-variant-numeric: tabular-nums; }
.system-canvas-usage tbody tr:last-child td { border-bottom: 0; }
.system-canvas-usage tbody tr:hover { background: var(--nav); }
.system-canvas-usage-stack { display: grid; min-width: 0; gap: .12rem; }
.system-canvas-usage-stack > small { font-size: .72rem; line-height: 1.35; }
.system-canvas-usage-stack > span { font-weight: 600; }
.system-canvas-usage-time { white-space: nowrap; }
.system-canvas-usage-member {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.system-canvas-usage-model > small {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.system-canvas-usage-state, .system-canvas-usage-params > span {
  width: max-content; max-width: 100%; padding: .14rem .38rem; border-radius: 5px;
  font-size: .73rem; line-height: 1.35; white-space: nowrap;
}
.system-canvas-usage-state {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px;
  color: var(--usage-status, var(--blue));
  background: color-mix(in srgb, var(--usage-status, var(--blue)) 11%, var(--panel));
  font-weight: 650;
}
.system-canvas-usage-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.system-canvas-usage-state[data-status="succeeded"] { --usage-status: var(--usage-success); }
.system-canvas-usage-state:is([data-status="unknown"], [data-status="timeout"]) { --usage-status: var(--usage-warning); }
.system-canvas-usage-state[data-status="failed"] { --usage-status: var(--usage-error); }
.system-canvas-usage-params { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.system-canvas-usage-params > span { border: 1px solid var(--border); background: var(--nav); }
@container (max-width: 58rem) {
  .system-canvas-usage .table-scroll { overflow: visible; border: 0; }
  .system-canvas-usage table { display: block; min-width: 0; }
  .system-canvas-usage colgroup { display: none; }
  .system-canvas-usage thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .system-canvas-usage tbody { display: grid; gap: .6rem; }
  .system-canvas-usage tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .8rem;
    padding: .7rem; border: 1px solid var(--border); border-radius: 9px;
  }
  .tenant-shell .system-canvas-usage td { display: grid; align-content: start; min-width: 0; gap: .2rem; padding: 0; border: 0; text-align: left; }
  .system-canvas-usage td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; }
  .system-canvas-usage td[data-label="参数"] { grid-column: 1 / -1; }
}
.system-card > button { margin: .8rem .5rem 0 0; }
.system-copy { margin: .9rem 0; align-items: end; }
.system-copy label { flex: 1 1 280px; }
.system-dialog { width: min(96vw, 520px); max-height: 90vh; overflow: auto; }
.system-fields { display: grid; gap: .85rem; }
.system-fields fieldset { border: 1px solid #e1e9e5; border-radius: 8px; display: grid; gap: .3rem; }
.system-fields label:has([type="checkbox"]) { display: flex; align-items: center; justify-content: start; gap: .5rem; }
.system-fields input[type="checkbox"] { width: auto; order: -1; }
.system-fields textarea { width: 100%; padding: .5rem; border: 1px solid #b4c5bd; border-radius: 6px; font: inherit; }
.system-feedback:not(:empty) { padding: .75rem 1rem; background: #f1f7f5; border-radius: 8px; margin-bottom: .75rem; }
.system-feedback label { margin: .5rem 0; }
.permission-preview { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.permission-preview label { flex: 1 1 12rem; }
.permission-preview-result { margin-top: 1rem; }
.permission-preview-result .system-card { margin: 0; padding: 0; border: 0; }
.tenant-image-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.signin-identity { display: flex; align-items: center; gap: .5rem; margin-bottom: .65rem; }
#signin-feishu { display: inline-block; margin-top: .75rem; }
#detail-modules li { display: grid; gap: .4rem; margin: .65rem 0; }

.system-heading { margin-bottom: 1rem; }
.system-heading h1 { font-size: 28px; margin: .4rem 0; }
.system-heading p:last-child { color: var(--muted); }
.tenant-shell .system-card, .tenant-shell .system-dialog { background: var(--panel); color: var(--ink); border-color: var(--border); }
.tenant-shell :is(.system-card,.system-dialog,.system-tabs,.system-feedback) button {
  border: 1px solid var(--border); border-radius: 6px; min-height: 36px; padding: .45rem .7rem;
}
.tenant-shell :is(.system-card,.system-dialog) button.primary { color: var(--canvas); background: var(--blue); border-color: var(--blue); }
.tenant-shell .system-tabs button[aria-current] { color: var(--blue); background: var(--accent-bg); border-color: var(--blue); }
.tenant-shell .system-card :is(td,th) { border-color: var(--border); }
.tenant-shell .system-card th { background: var(--nav); color: var(--muted); }
.tenant-shell :is(.system-card,.system-dialog) :is(input,select,textarea) { color: var(--ink); background: var(--nav); border-color: var(--border); }
.tenant-shell :is(.system-card,.system-dialog,.system-management) .muted { color: var(--muted); }
.tenant-shell .system-fields fieldset { border-color: var(--border); }
.tenant-shell .system-feedback:not(:empty) { color: var(--ink); background: var(--accent-bg); }
.tenant-shell .system-dialog { padding: 1.25rem; }
.tenant-shell .system-dialog .dialog-actions { display: flex; justify-content: end; gap: .5rem; margin-top: 1rem; }
.tenant-shell .system-dialog .error:not(:empty) { color: #dc6464; margin-top: .75rem; }
#workbench-company { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-company-logo { display: none; }
@media (max-width: 820px) { .mobile-company-logo { display: block; width: 23px; height: 23px; } }

.directory-layout { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 1rem; }
.directory-departments { max-height: 32rem; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: .5rem; }
.directory-departments ul { padding-inline-start: .75rem; }
.directory-department { display: flex; align-items: start; }
.tenant-shell .directory-departments button { min-width: 0; border-color: transparent; text-align: start; overflow-wrap: anywhere; }
.tenant-shell .directory-departments button[aria-current] { background: var(--accent-bg); color: var(--blue); }
.tenant-shell .directory-toggle { flex: none; }
.directory-search { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-bottom: .75rem; }
.directory-search label { flex: 1 1 10rem; }
.directory-results > .system-card { margin-top: .5rem; padding: 0; border: 0; }
@media (max-width: 640px) {
  .scheduled-task-card table, .scheduled-task-card tbody, .scheduled-task-card tr, .scheduled-task-card td { display: block; }
  .scheduled-task-card thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .scheduled-task-card tr { border: 1px solid var(--border); border-radius: 8px; padding: .45rem .75rem; margin-bottom: .75rem; }
  .tenant-shell .scheduled-task-card td { display: flex; gap: .75rem; align-items: flex-start; padding: .35rem 0; border: 0; }
  .scheduled-task-card td::before { content: attr(data-label); flex: 0 0 4em; color: var(--muted); }
  .directory-layout { grid-template-columns: minmax(0, 1fr); }
  .directory-departments { max-height: 13rem; }
}

.directory-person { display: inline-flex; align-items: center; gap: .55rem; position: relative; }
.directory-avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg); color: var(--blue); font-weight: 600; object-fit: cover; }
.directory-avatar-photo { position: absolute; inset-inline-start: 0; opacity: 0; }

.system-announcement-card :is(th,td) { padding: .75rem .65rem; }
.system-announcement-card th:nth-child(n+3) { white-space: nowrap; }
.announcement-admin-title { display: grid; gap: .25rem; min-width: 10rem; overflow-wrap: anywhere; }
.announcement-admin-actions { flex-wrap: nowrap; }
.tenant-shell .announcement-admin-actions button { min-height: 30px; padding: .25rem .55rem; }
.tenant-shell .announcement-admin-actions button:hover { border-color: var(--blue); color: var(--blue); }
.announcement-admin-status { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; padding: .15rem .5rem; color: var(--muted); white-space: nowrap; }
.announcement-admin-status[data-tone="live"] { color: var(--teal); }
.announcement-admin-status[data-tone="scheduled"] { background: var(--accent-bg); color: var(--blue); }
.announcement-admin-preview { display: grid; gap: .6rem; padding: .85rem; border: 1px solid var(--border); border-radius: 8px; background: var(--nav); }
.announcement-admin-stats { display: flex; gap: .35rem .8rem; flex-wrap: wrap; color: var(--muted); }
.announcement-admin-preview .announcement-copy { max-height: 32vh; overflow: auto; }
.announcement-department-picker { min-width: 0; margin: 0; padding: .45rem .65rem .65rem; }
.announcement-departments { display: flex; gap: .35rem 1rem; flex-wrap: wrap; max-height: 10rem; overflow: auto; }
@media (max-width: 640px) {
  .system-announcement-card :is(table, tbody, tr, td) { display: block; }
  .system-announcement-card thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
  .system-announcement-card tr { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .55rem; }
  .tenant-shell .system-announcement-card td { display: flex; align-items: start; gap: .5rem; padding: .25rem 0; border: 0; }
  .system-announcement-card td:is(:nth-child(2), :nth-child(3), :nth-child(4))::before { content: attr(data-label); flex: 0 0 4.4em; color: var(--muted); }
  .announcement-admin-title { min-width: 0; }
}
