/* 授权管理局部视觉规范：保留原有布局，不影响其他业务页面。 */
:where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) {
  --action: #245bf0;
  --action-hover: #174bd6;
  --authorization-hover: #f3f7ff;
  --authorization-selected: #dbe9ff;
  --authorization-stripe: var(--surface-soft);
  --authorization-disabled: #f4f5f7;
  --authorization-disabled-ink: #929ba9;
  --authorization-success-ink: #287513;
  --authorization-success-fill: #f6ffed;
  --authorization-success-line: #b7df9a;
  --authorization-danger-line: #ff8b8e;
}
:root[data-theme="dark"] :where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) {
  --action: #3569e8;
  --action-hover: #4479f6;
  --authorization-hover: #202e47;
  --authorization-selected: #192c55;
  --authorization-stripe: #172033;
  --authorization-disabled: #253043;
  --authorization-disabled-ink: #99a7ba;
  --authorization-success-ink: #98cf6b;
  --authorization-success-fill: #182b12;
  --authorization-success-line: #3f662e;
  --authorization-danger-line: #c14f5a;
}
:where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) button {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}
:where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) button:disabled,
:where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) button:disabled:hover {
  opacity: 1;
  color: var(--authorization-disabled-ink);
  background: var(--authorization-disabled);
  border-color: var(--line);
  cursor: not-allowed;
}
:where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) .quiet:not(:disabled):hover {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--control-line);
}
:where([data-workspace-page="authorization"], #qc-dialog, #qc-manage-dialog) :is(button, input, select):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
[data-workspace-page="authorization"] .directory-header { min-height: 64px; padding: 14px 24px; gap: 16px; }
[data-workspace-page="authorization"] .directory-header .workspace-tools { gap: 8px; }
[data-workspace-page="authorization"] #qc-start { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
[data-workspace-page="authorization"] #qc-start svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
[data-workspace-page="authorization"] .account-action-icon { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
[data-workspace-page="authorization"] #qc-remove { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
[data-workspace-page="authorization"] #qc-remove:not(:disabled) { color: var(--danger); border-color: var(--authorization-danger-line); background: var(--surface); }
[data-workspace-page="authorization"] #qc-remove:not(:disabled):hover { border-color: var(--danger); background: var(--risk-fill); }
[data-workspace-page="authorization"] #qc-clear-main { min-height: 28px; border: 0; padding: 2px 0; color: var(--action); background: transparent; }
[data-workspace-page="authorization"] .directory-header h1 { font-size: 18px; font-weight: 600; }
[data-workspace-page="authorization"] .directory-content { padding: 20px 24px 24px; }
[data-workspace-page="authorization"] .directory-meta { min-height: 24px; gap: 8px 16px; margin-bottom: 12px; }
[data-workspace-page="authorization"] .directory-meta p { margin: 0; }
[data-workspace-page="authorization"] .directory-count { font-size: 13px; }
[data-workspace-page="authorization"] .account-table-scroll { border-radius: 6px; scrollbar-width: thin; scrollbar-color: var(--control-line) var(--surface-soft); }
[data-workspace-page="authorization"] .directory table { margin-top: 0; min-width: 1060px; }
[data-workspace-page="authorization"] .directory :is(th, td) { padding: 14px 16px; font-size: 13px; line-height: 1.6; }
[data-workspace-page="authorization"] .directory th { height: 46px; font-weight: 500; color: var(--ink); }
[data-workspace-page="authorization"] .directory th.account-check { width: 44px; padding-inline: 14px; }
[data-workspace-page="authorization"] .directory th:nth-child(2) { width: 170px; }
[data-workspace-page="authorization"] .directory th:nth-child(3) { width: 158px; }
[data-workspace-page="authorization"] .directory th:nth-child(4) { width: 90px; }
[data-workspace-page="authorization"] .directory th:nth-child(5) { width: auto; }
[data-workspace-page="authorization"] .directory th:nth-child(6) { width: 128px; }
[data-workspace-page="authorization"] .directory th:nth-child(7) { width: 164px; }
[data-workspace-page="authorization"] .directory th:last-child { width: 96px; }
[data-workspace-page="authorization"] .directory :is(th, td):last-child { position: sticky; right: 0; background: var(--surface); text-align: center; border-left: 0; }
[data-workspace-page="authorization"] .directory th:last-child { background: var(--surface-soft); }
[data-workspace-page="authorization"] #qc-accounts tr { --account-row-background: var(--surface); }
[data-workspace-page="authorization"] #qc-accounts tr:nth-child(even) { --account-row-background: var(--authorization-stripe); }
[data-workspace-page="authorization"] #qc-accounts tr:hover { --account-row-background: var(--authorization-hover); }
[data-workspace-page="authorization"] #qc-accounts tr:has(input:checked) { --account-row-background: var(--authorization-selected); }
[data-workspace-page="authorization"] #qc-accounts tr > td { background: var(--account-row-background); }
[data-workspace-page="authorization"] .directory td:nth-child(7) { white-space: nowrap; font-size: 12px; color: var(--muted); }
[data-workspace-page="authorization"] .directory .account-delete { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 28px; padding: 2px 8px; font-size: 12px; border-color: var(--authorization-danger-line); }
[data-workspace-page="authorization"] .tag[data-tone="positive"] { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; white-space: nowrap; color: var(--authorization-success-ink); background: var(--authorization-success-fill); border: 1px solid var(--authorization-success-line); border-radius: 4px; font-size: 12px; font-weight: 400; }
[data-workspace-page="authorization"] .directory .account-delete:not(:disabled):hover { color: var(--danger); border-color: var(--danger); background: var(--risk-fill); }
[data-workspace-page="authorization"] #qc-empty td { padding-block: 48px; }
:where([data-workspace-page="authorization"], #qc-manage-dialog) input[type="checkbox"] { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--action); cursor: pointer; }
:where([data-workspace-page="authorization"], #qc-manage-dialog) input[type="checkbox"]:disabled { cursor: not-allowed; }
:where(#qc-dialog, #qc-manage-dialog) { max-height: calc(100dvh - 32px); padding: 24px; scrollbar-width: thin; }
#qc-dialog h2, #qc-manage-dialog h2 { font-size: 16px; font-weight: 600; }
#qc-dialog .dialog-close { min-height: 30px; width: 30px; padding: 6px; color: var(--muted); }
#qc-dialog .authorization-launch-actions { gap: 16px; padding-block: 36px; }
#qc-dialog #qc-official { min-height: 40px; padding: 9px 20px; font-size: 14px; }
#qc-dialog #qc-dialog-status { max-width: 52ch; font-size: 13px; line-height: 1.7; }
#qc-material-status { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0 20px; padding: 14px 16px; border: 1px solid #b7d0ff; border-radius: 8px; background: #f0f6ff; color: var(--ink); font-size: 13px; line-height: 1.65; }
#qc-material-status .authorization-notice-title { font-size: 14px; font-weight: 500; }
#qc-material-detail { margin-top: 5px; }
#qc-material-meta { margin-top: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.authorization-notice-icon { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.authorization-notice-icon circle { fill: #245bf0; }
.authorization-notice-icon path { stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
#qc-material-status[data-tone="attention"] { background: #fff9e7; border-color: #edcc79; }
#qc-material-status[data-tone="attention"] circle { fill: #a96a00; }
:root[data-theme="dark"] #qc-material-status { background: #142b4c; border-color: #345d93; }
:root[data-theme="dark"] #qc-material-status[data-tone="attention"] { background: #302b1e; border-color: #705b29; }
#qc-manage-form { gap: 16px; }
#qc-manage-form > label { gap: 7px; font-size: 13px; font-weight: 500; }
#qc-account-search { min-height: 36px; padding: 8px 12px; font-size: 13px; }
#qc-account-search:focus, #qc-account-search:focus-visible { outline: none; box-shadow: none; border-color: var(--action); }
#qc-manage-form .selection-toolbar { gap: 8px 12px; font-size: 13px; }
#qc-manage-form > .selection-toolbar:has(#qc-page-prev) { justify-content: flex-end; gap: 8px; }
#qc-manage-form > .selection-toolbar:has(#qc-page-prev) :is(button, input, select) { height: 34px; min-height: 34px; border-radius: 6px; line-height: 20px; }
#qc-manage-form > .selection-toolbar:has(#qc-page-prev) .inline-check { gap: 6px; }
#qc-account-page { width: 54px; padding: 6px 8px; text-align: center; }
#qc-account-page-size { min-width: 72px; padding: 6px 8px; }
#qc-manage-form > p.muted { margin: 0; font-size: 12px; }
#qc-selection-summary { font-variant-numeric: tabular-nums; }
#qc-clear-selected { margin-left: auto; }
#qc-manage-form .selection-table-scroll { max-height: min(360px, 35dvh); border: 1px solid var(--line); border-radius: 6px; scrollbar-width: thin; scrollbar-color: var(--control-line) var(--surface-soft); }
#qc-manage-form table { margin: 0; }
#qc-manage-form :is(th, td) { padding: 10px 12px; font-size: 13px; line-height: 1.6; text-align: left; }
#qc-manage-form th { position: sticky; top: 0; z-index: 1; color: var(--ink); font-weight: 500; background: var(--surface-soft); }
#qc-manage-form th:first-child { width: 42px; }
#qc-manage-form th:nth-child(2) { width: 180px; }
#qc-manage-form td:nth-child(2) { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
#qc-available-accounts tr:hover { background: var(--authorization-hover); }
#qc-available-accounts tr:has(input:checked) { background: var(--authorization-selected); }
#qc-manage-form .dialog-actions { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 16px 24px; background: var(--surface); border-top: 1px solid var(--line); gap: 8px; }
#qc-selection-reload { margin-right: auto; }
#qc-manage-error { margin: 0; font-size: 13px; }
@media (max-width: 680px) {
  [data-workspace-page="authorization"] .directory-header { padding: 14px 16px; flex-wrap: wrap; }
  [data-workspace-page="authorization"] .directory-content { padding: 16px; }
  :where(#qc-dialog, #qc-manage-dialog) { padding: 20px; width: calc(100% - 24px); }
  #qc-manage-form .dialog-actions { bottom: -20px; margin: 0 -20px -20px; padding: 14px 20px; flex-wrap: wrap; }
  #qc-clear-selected { margin-left: 0; }
  #qc-manage-form .selection-table-scroll { max-height: 32dvh; }
  #qc-manage-form > .selection-toolbar:has(#qc-page-prev) { justify-content: flex-start; }
  #qc-manage-form th:nth-child(2) { width: 165px; }
}
@media (max-height: 700px) {
  #qc-dialog .authorization-launch-actions { padding-block: 24px; }
  #qc-material-status { margin-block: 12px; }
  #qc-manage-form { gap: 12px; }
}
/* 宽屏按可用空间分配六个内容列，避免公司名独占全部剩余宽度。 */
@media (min-width: 1600px) {
  [data-workspace-page="authorization"] .directory th:nth-child(2) { width: 15%; }
  [data-workspace-page="authorization"] .directory th:nth-child(3) { width: 16%; }
  [data-workspace-page="authorization"] .directory th:nth-child(4) { width: 11%; }
  [data-workspace-page="authorization"] .directory th:nth-child(5) { width: 18%; }
  [data-workspace-page="authorization"] .directory th:nth-child(6) { width: 12%; }
  [data-workspace-page="authorization"] .directory th:nth-child(7) { width: 14%; }
}

/* 删除确认：批量使用模态对话框，单个使用按钮旁的轻量确认框。 */
.account-removal-surface { color: var(--ink); background: var(--surface); border: 0; border-radius: 10px; box-shadow: 0 12px 40px rgba(12, 24, 42, .18); }
.account-removal-surface h2 { font-size: 16px; font-weight: 600; line-height: 1.5; }
.account-removal-surface button { min-height: 34px; padding: 6px 14px; border-radius: 6px; font-size: 13px; line-height: 20px; font-weight: 500; }
.account-removal-surface .dialog-close { width: 30px; min-height: 30px; padding: 6px; color: var(--muted); }
.account-removal-surface .dialog-actions { gap: 8px; margin-top: 14px; justify-content: flex-end; }
.account-removal-surface .removal-confirm { color: #fff; background: #db3038; border-color: #db3038; }
.account-removal-surface .removal-confirm:hover { background: #bf242e; border-color: #bf242e; }
.account-removal-surface button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
#qc-batch-delete-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 24px; margin: min(100px, 10vh) auto auto; }
#qc-batch-delete-dialog::backdrop { background: rgba(20, 30, 45, .42); }
.account-removal-warning { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 16px; border: 1px solid #f5d781; border-radius: 8px; background: #fffbe9; }
.account-removal-warning .removal-warning-title { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.account-removal-warning p { font-size: 13px; line-height: 1.7; }
.removal-warning-icon { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.removal-warning-icon circle { fill: #bd7900; }
.removal-warning-icon path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
#qc-batch-delete-accounts { list-style: none; padding: 0; margin: 16px 0 0; max-height: 240px; overflow: auto; scrollbar-width: thin; }
#qc-batch-delete-accounts li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#qc-batch-delete-accounts li span:first-child { overflow-wrap: anywhere; }
#qc-batch-delete-accounts li span:last-child { color: var(--muted); white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
#qc-single-delete-popover { position: fixed; inset: auto; margin: 0; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 14px; overflow: visible; }
.single-removal-content { display: flex; align-items: flex-start; gap: 8px; }
.single-removal-content .removal-warning-icon { width: 16px; height: 16px; }
.single-removal-content h2 { font-size: 13px; }
.single-removal-content p { margin-top: 6px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#qc-single-delete-popover .dialog-actions { margin-top: 10px; }
#qc-single-delete-popover button { min-height: 28px; padding: 3px 10px; font-size: 12px; }
#qc-single-delete-popover::after { position: absolute; left: calc(var(--removal-arrow-left, 24px) - 5px); width: 10px; height: 10px; background: var(--surface); transform: rotate(45deg); content: ""; }
#qc-single-delete-popover[data-placement="above"]::after { bottom: -5px; }
#qc-single-delete-popover[data-placement="below"]::after { top: -5px; }
:root[data-theme="dark"] .account-removal-warning { border-color: #705b29; background: #302b1e; }
@media (max-width: 480px) {
  #qc-batch-delete-dialog { padding: 20px; }
  #qc-batch-delete-accounts li { flex-direction: column; gap: 4px; }
}
