/* Page workspace theme. Canonical source: customer-portal/src/workspace-theme.css.
   Mirror unchanged into the shell and role hosts for independent static deployment. */
:root {
  --ui-accent: #4265d6;
  --ui-accent-deep: #304cb4;
  --ui-soft: #edf1ff;
  --ui-glow: #91a9ff;
  --ui-ink: #262336;
  --ui-muted: #716d85;
  --ui-line: #e8e5f0;
  --ui-shadow: 0 6px 24px #35274a07, 0 1px 3px #35274a04;
  --ui-night: #292036;
  --canvas: #f8f6fb;
  --surface: #fff;
  --surface-soft: #faf8fd;
  --ink: var(--ui-ink);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --line-strong: #d6d0e2;
}
html[data-page-role="worker"], body[data-role="worker"] {
  --ui-accent: #137d70; --ui-accent-deep: #096457;
  --ui-soft: #e8f6f0; --ui-glow: #6bd5b5;
}
html[data-page-role="assessor"], body[data-role="assessor"] {
  --ui-accent: #8555c6; --ui-accent-deep: #6939a8;
  --ui-soft: #f3ecfc; --ui-glow: #c7a0f2;
}
html[data-page-role="operator"], body[data-role="operator"] {
  --ui-accent: #52627e; --ui-accent-deep: #394a69;
  --ui-soft: #edf1f7; --ui-glow: #a6b6d6;
}
html[data-page-role], body[data-role] {
  --role-accent: var(--ui-accent);
  --role-soft: var(--ui-soft);
  --role-dark: var(--ui-accent-deep);
  --role-border: color-mix(in srgb, var(--ui-accent) 24%, white);
  --md-sys-color-primary: var(--ui-accent);
  --md-sys-color-primary-container: var(--ui-soft);
  --md-sys-color-on-primary-container: var(--ui-accent-deep);
  --primary: var(--ui-accent) !important;
  --primary-dark: var(--ui-accent-deep) !important;
  --primary-soft: var(--ui-soft) !important;
  --navy: var(--ui-accent-deep) !important;
  --blue-soft: var(--ui-soft) !important;
  --canvas: #f8f6fb;
  --surface: #fff;
  --ink: var(--ui-ink);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --line-strong: #d6d0e2;
}
body[data-portal], body[data-role] {
  color: var(--ui-ink);
  background: radial-gradient(ellipse at 90% 0%, #ece6fb 0, transparent 46%),
    radial-gradient(ellipse at 20% 80%, #fff0f4 0, transparent 50%), #f8f6fb;
  font-family: "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
body[data-portal] > .app-shell, body[data-portal] .workspace { background: transparent; }
body[data-portal] :is(.main-content, .main) { padding-top: 28px; }
body[data-portal] .sidebar {
  background: radial-gradient(ellipse at 0 0, #56304e 0, transparent 60%),
    linear-gradient(165deg, #30263d, #201c2d);
  border-right: 1px solid #ffffff12;
  color: #f5edf8;
  box-shadow: 8px 0 32px #2a19330a;
}
body[data-portal] .sidebar > .brand {
  gap: 12px;
  padding: 14px 10px 24px;
  margin-bottom: 14px;
  border-bottom: 1px solid #ffffff15;
}
body[data-portal] .sidebar .page-wordmark { background: transparent; border-radius: 0; }
/* Preserve the approved glyph colors; the halo follows transparent glyph edges. */
body[data-portal] :is(.sidebar, .mobile-brand) .page-wordmark > img {
  filter: url("./page-brand-filter.svg#transparent-background")
    drop-shadow(0 0 .8px #fff1fa) drop-shadow(0 0 .8px #fff1fa);
}
body[data-portal] .sidebar .page-brand-role { color: #e4d5e8 !important; font-size: 15px; }
body[data-portal] .sidebar :is(.sidebar-label, .nav-section-label) { color: #b9a9c6; font-size: 15px; letter-spacing: .06em; }
body[data-portal] .sidebar .workspace-search-launch {
  min-height: 44px; background: #ffffff09; border-color: #ffffff20;
  border-radius: 12px; color: #d9cfe4; font-size: 15px;
}
body[data-portal] .sidebar .workspace-search-launch kbd {
  background: #ffffff0c; border-color: #ffffff1c; color: #bfb0cc; font-size: 12px;
}
body[data-portal] .sidebar nav { gap: 7px; }
body[data-portal] .sidebar nav .nav-item {
  min-height: 48px; padding: 11px 14px; border-radius: 13px;
  color: #d5c9e0; font-size: 15px; font-weight: 600;
  transition: background .18s ease, color .18s ease;
}
body[data-portal] .sidebar nav .nav-item:hover { color: #fff; background: #ffffff0d; }
html[data-page-role] body[data-portal] .sidebar nav .nav-item.active {
  background: linear-gradient(115deg, var(--ui-accent), var(--ui-accent-deep));
  color: #fff; box-shadow: 0 6px 20px #00000024, inset 0 1px 0 #ffffff24;
}
html[data-page-role] body[data-portal] .sidebar nav .nav-item.active::before { display: none; }
body[data-portal] .sidebar :is(.account-summary, .operator-card, .safety-card) {
  background: #ffffff08; border: 1px solid #ffffff1c; border-radius: 14px;
}
body[data-portal] .sidebar :is(.account-summary, .operator-card):hover { background: #ffffff12; }
body[data-portal] .sidebar :is(.profile-copy strong, .operator-card strong, .safety-card strong) { color: #faf4ff; font-size: 15px; }
body[data-portal] .sidebar :is(.profile-copy small, .operator-card small, .safety-card p, .account-hub-chevron) { color: #c3b4cf; font-size: 15px; }
body[data-portal] .sidebar .safety-card a { color: #d7e9f7; font-size: 15px; }
body[data-portal] .sidebar .avatar { color: #f4e4f2; background: #ffffff15; border: 1px solid #ffffff20; }
body[data-portal] :is(.welcome-row, .page-head) {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 138px; margin-bottom: 24px; padding: 27px 30px;
  border: 1px solid #ffffff24; border-radius: 22px;
  background: radial-gradient(ellipse at 90% 0%, color-mix(in srgb, var(--ui-accent) 68%, #292036), transparent 65%),
    linear-gradient(115deg, #35263f, #242338);
  box-shadow: 0 12px 28px #39264a12;
}
body[data-portal] :is(.welcome-row, .page-head)::before {
  content: ""; display: block; position: absolute; z-index: -1; pointer-events: none;
  right: 4%; top: -90px; width: 300px; height: 300px;
  border: 1px solid #ffffff12; border-radius: 50%;
  box-shadow: 0 0 0 36px #ffffff04, 0 0 0 72px #ffffff03;
}
body[data-portal] :is(.welcome-row, .page-head) h1 {
  color: #fff; font-size: clamp(28px, 2.7vw, 38px); letter-spacing: -.035em;
  margin: 0; line-height: 1.35;
}
body[data-portal] :is(.welcome-row, .page-head) :is(.page-subtitle, .subtle, .online-toggle b) { color: #e1d6eb; }
body[data-portal] :is(.welcome-row, .page-head) .secondary-button {
  color: #fff; border-color: #ffffff32; background: #ffffff0f;
}
body[data-portal] :is(.welcome-row, .page-head) .secondary-button:hover { background: #ffffff20; border-color: #ffffff50; }
body[data-portal] :is(.welcome-row, .page-head) :is(.account-hub-mobile, .workspace-search-mobile) { color: #fff; border-color: #ffffff32; background: #ffffff10; }
body[data-portal] .topbar {
  background: #ffffffcc; border-bottom-color: var(--ui-line);
  backdrop-filter: blur(18px);
}
html[data-page-role] body[data-portal] :is(.panel, .task-workspace, .work-card, .metric-grid article, .kpi-card, .error-panel, .model-admin-panel, .model-admin-overview article, .model-market) {
  border: 1px solid var(--ui-line); border-radius: 20px;
  background: #fff; box-shadow: var(--ui-shadow);
}
body[data-portal] :is(.panel-heading, .panel-header, .panel-head) { border-bottom-color: var(--ui-line); }
body[data-portal] :is(.panel-heading, .panel-header, .section-heading) h2 { color: var(--ui-ink); font-size: 22px; }
body[data-portal] :is(.metric-grid article, .kpi-card, .model-market-card) { transition: box-shadow .2s ease, border-color .2s ease; }
body[data-portal] :is(.metric-grid article, .kpi-card, .model-market-card):hover { box-shadow: 0 10px 30px #35274a10; border-color: #d8d0e5; }
body[data-portal] :is(.metric-grid strong, .kpi-value) { color: var(--ui-ink); font-variant-numeric: tabular-nums; }
body[data-portal] :is(.primary-button, .button.primary), body[data-role] .primary-button {
  min-height: 44px; padding-inline: 20px; border: 1px solid var(--ui-accent);
  border-radius: 12px; background: linear-gradient(120deg, var(--ui-accent), var(--ui-accent-deep));
  color: #fff; font-size: 16px; font-weight: 650; box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-accent) 18%, transparent);
}
html[data-page-role] body[data-portal] :is(.primary-button, .button.primary):hover:not(:disabled) {
  background: var(--ui-accent-deep); border-color: var(--ui-accent-deep);
}
body[data-portal] :is(.secondary-button, .button:not(.primary):not(.danger)) {
  min-height: 44px; border-color: var(--line-strong); border-radius: 12px;
  color: var(--ui-accent-deep); background: #fff; font-size: 15px; font-weight: 650;
}
body[data-portal] :is(.field input, .field select, .field textarea, .ui-search-field input, .model-admin-field input, .model-admin-field select) {
  border-color: #dcd6e7; border-radius: 12px; background: #fcfbfe;
  font-size: 17px; color: var(--ui-ink);
}
body[data-portal] .field > span { font-size: 17px; font-weight: 650; color: var(--ui-ink); }
body[data-portal] :is(.field small, .stepper small, .save-state, .material-heading p, .explain-box p, .metric-grid small, .metric-grid p, .kpi-label, .kpi-note) {
  font-size: 15px; line-height: 1.65;
}
body[data-portal] .field small { color: var(--ui-muted); font-weight: 450; }
body[data-portal] :is(.model-market-status, .model-market-disclosure p, .market-toolbar > p, .assessor-growth p) { font-size: 15px; line-height: 1.65; }
body[data-portal] :is(.model-market-tabs button, .model-market-filter > span) { font-size: 15px; }
body[data-portal] .model-market-card h3 { font-size: 21px; }
body[data-portal] .model-market-card > p { font-size: 17px; line-height: 1.75; }
body[data-portal] :is(input, textarea, select):focus {
  border-color: var(--ui-accent); outline-color: var(--ui-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-accent) 12%, transparent);
}
body[data-portal] :is(.tabs, .market-views, .queue-tabs, .queue-facets, .model-market-tabs, .model-admin-tabs) {
  padding: 5px; gap: 4px; border: 1px solid var(--ui-line);
  border-radius: 13px; background: #f5f2f9;
}
body[data-portal] :is(.tabs button.active, .market-view[aria-pressed="true"], .queue-tab.active, .queue-facets button[aria-pressed="true"], .model-market-tabs button[aria-selected="true"], .model-admin-tabs button[aria-selected="true"]) {
  color: var(--ui-accent-deep); background: #fff; border-radius: 9px; box-shadow: 0 2px 6px #35274a0b;
}
body[data-portal] .stepper li.active > span { background: var(--ui-accent); border-color: var(--ui-accent); box-shadow: 0 0 0 5px var(--ui-soft); }
body[data-portal] .stepper li.active strong { color: var(--ui-accent-deep); }
body[data-portal] :is(.model-market-card, .model-market-collection) { border-color: var(--ui-line); border-radius: 17px; }
html[data-page-role] body[data-portal] .model-market-card.featured {
  border-color: color-mix(in srgb, var(--ui-accent) 25%, white);
  background: radial-gradient(ellipse at 100% 0%, var(--ui-soft), transparent 80%), #fff;
}
body[data-portal] .model-market-card :is(.model-market-buy, .model-market-link) {
  border-radius: 11px; color: var(--ui-accent-deep); background: var(--ui-soft);
}
body[data-portal] .model-market-card .model-market-buy {
  color: #fff; background: var(--ui-accent); border-color: var(--ui-accent);
}
body[data-portal] :is(.model-market-disclosure, .model-admin-disclosure, .assessor-growth) { background: var(--ui-soft); border-color: var(--role-border); border-radius: 14px; }
body[data-portal] :is(.model-market-disclosure-mark, .model-admin-disclosure > span) { color: var(--ui-accent-deep); background: #fff; }
body[data-portal] :is(.wizard-actions, .panel-footer) { border-color: var(--ui-line); background: #fdfcfe; }
body[data-portal] :is(.workspace-empty, .empty-state, .finance-empty-state) { color: var(--ui-muted); }
body[data-portal] .brand-footer { color: var(--ui-muted); }
body[data-portal] .mobile-brand .page-wordmark { background: transparent; }
body[data-portal] .mobile-brand > span:last-child { color: #e1d6eb; }

/* The account shell uses the same palette; frame height/scroll ownership stay intact. */
body[data-role] { --shell-height: 80px; }
body[data-role] .workspace-header {
  height: var(--shell-height); gap: 22px; padding: 10px 24px;
  border-bottom: 1px solid var(--ui-line); background: #fffcffed;
  box-shadow: 0 4px 20px #35274a06; backdrop-filter: blur(20px);
}
body[data-role] .role-trigger {
  min-width: 0; flex-basis: 218px; min-height: 56px; gap: 11px;
  padding: 7px 11px; border-radius: 15px; border-color: var(--role-border);
  background: linear-gradient(115deg, #fff, var(--ui-soft));
}
body[data-role] .role-trigger:hover { border-color: var(--ui-accent); }
body[data-role] .role-mark { border-radius: 11px; background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-deep)); box-shadow: 0 4px 10px color-mix(in srgb, var(--ui-accent) 22%, transparent); }
body[data-role] .role-trigger .eyebrow { font-size: 12px; color: var(--ui-muted); }
body[data-role] .role-trigger strong { font-size: 16px; color: var(--ui-ink); }
body[data-role] .workspace-tabs {
  align-self: center; gap: 5px; padding: 5px; border: 1px solid var(--ui-line);
  border-radius: 13px; background: #f3eff8;
}
body[data-role] .workspace-tab { min-height: 40px; padding: 8px 18px; border: 0; border-radius: 9px; color: var(--ui-muted); font-size: 15px; }
body[data-role] .workspace-tab[aria-current="page"] { color: var(--ui-accent-deep); background: #fff; box-shadow: 0 2px 7px #35274a0d; }
body[data-role] #portal-frame { background: #f8f6fb; }
body[data-role] .assets-head { padding: 8px 0 12px; }
body[data-role] .assets-head h1 { color: var(--ui-ink); }
body[data-role] .assets-head button { color: var(--ui-accent-deep); border-color: var(--line-strong); border-radius: 12px; }
body[data-role] .asset-section { border-color: var(--ui-line); border-radius: 22px; box-shadow: var(--ui-shadow); }
body[data-role] .asset-hero {
  position: relative; overflow: hidden; min-height: 160px; border-radius: 17px;
  color: #f5eafa; background: radial-gradient(ellipse at 100% 0%, #745383, transparent 70%), linear-gradient(115deg, #38283f, #282137);
}
body[data-role] .asset-hero :is(strong, small, p, span) { color: #fff; }
body[data-role] .asset-hero strong { font-size: clamp(36px, 4vw, 52px); font-variant-numeric: tabular-nums; }
body[data-role] .asset-hero .asset-hero-mark { color: #edd6f5; border-color: #ffffff32; background: #ffffff08; }
body[data-role] .asset-metric { border-color: var(--ui-line); border-radius: 15px; background: #faf8fd; }
body[data-role] .role-card { border-color: var(--ui-line); border-radius: 15px; }
body[data-role] .role-card[aria-current="true"] { border-color: var(--role-border); background: var(--ui-soft); }
body[data-role] .welcome-panel { margin-top: 34px; border: 1px solid var(--ui-line); border-radius: 28px; background: #ffffffb8; box-shadow: var(--ui-shadow); }
body[data-role] .welcome-emblem { border-radius: 20px; color: #fff; background: linear-gradient(135deg, #704663, #39283f); box-shadow: 0 10px 30px #70466324; }

/* Dialog decisions remain native; decoration never implies approval. */
body :is(dialog.page-account-dialog, dialog.personal-settings-dialog, dialog.role-picker, dialog.action-dialog, dialog.task-auth-dialog) {
  border: 1px solid #e2dce9; border-radius: 22px;
  background: #fff; box-shadow: 0 30px 100px #2d1c4140;
}
body dialog::backdrop { background: #24172d70; backdrop-filter: blur(8px); }
body .page-dialog-heading h2 { color: var(--ui-ink); }
body :is(.page-dialog-actions .is-primary, .security-form-actions .primary, dialog.personal-settings-dialog [data-save]) {
  background: var(--ui-accent); border-color: var(--ui-accent); color: #fff;
}
body :is(.page-security-items > button, dialog.account-hub .account-hub-items > button) { border-color: var(--ui-line); background: #faf8fd; border-radius: 14px; }
body :is(.page-security-items > button, dialog.account-hub .account-hub-items > button):hover { border-color: var(--role-border); background: var(--ui-soft); }
body button.task-auth-account { border-color: var(--ui-line); color: var(--ui-ink); border-radius: 12px; }
body .task-auth-dialog .task-auth-primary { background: var(--ui-accent) !important; border-radius: 12px !important; }
body .task-auth-dialog .task-auth-brand-panel { background: radial-gradient(ellipse at 0 0, #fff0f4, transparent 70%), #f5eff9; }
body :is(button, a, summary):focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 3px; }
body[data-portal] :is(.primary-button, .button.primary):disabled,
body[data-role] .primary-button:disabled {
  background: #eeebf2 !important; border-color: #e0dce8 !important;
  color: #777184 !important; box-shadow: none; cursor: not-allowed;
}

/* Keep the existing mobile navigation model and safe-area spacing. */
@media (max-width: 880px) {
  body[data-portal] :is(.main-content, .main) { padding-top: 18px; }
  body[data-portal] :is(.welcome-row, .page-head) {
    min-height: 118px; padding: 22px 20px; border-radius: 18px;
    gap: 16px; align-items: flex-start;
  }
  body[data-portal] .welcome-row { flex-wrap: wrap; }
  body[data-portal] .welcome-row > div { min-width: 0; }
  body[data-portal] .welcome-row .top-actions { flex-wrap: wrap; gap: 8px; }
  body[data-portal] .sidebar { box-shadow: none; }
}
@media (max-width: 700px) {
  body[data-role] { --shell-height: 126px; }
  body[data-role] .workspace-header {
    height: auto; min-height: var(--shell-height); flex-wrap: wrap;
    gap: 8px; padding: 9px max(12px, env(safe-area-inset-right)) 9px max(12px, env(safe-area-inset-left));
  }
  body[data-role] .role-trigger { flex: 1 1 160px; min-height: 54px; }
  body[data-role] .workspace-tabs { order: 3; width: 100%; justify-content: center; }
  body[data-role] .workspace-tab { flex: 1; min-height: 38px; padding: 7px 12px; }
  body[data-role] .top-actions { gap: 6px; margin-left: auto; }
  body[data-role] .top-actions #account-name { display: none; }
  body[data-role] .assets-view { padding-inline: 14px; }
  body[data-role] .asset-section { padding: 18px; }
  body[data-role] .asset-hero { min-height: 140px; padding: 20px; }
  body[data-role] .welcome-panel { margin: 20px 12px; padding: 46px 20px; }
  body :is(dialog.page-account-dialog, dialog.personal-settings-dialog, dialog.role-picker, dialog.action-dialog) { border-radius: 18px; }
  body[data-portal] .page-head { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  body[data-portal]:not([data-portal="operator"]) .sidebar {
    background: #fffcfff5; border-color: var(--ui-line); backdrop-filter: blur(16px);
  }
  body[data-portal]:not([data-portal="operator"]) .sidebar nav { gap: 3px; }
  body[data-portal]:not([data-portal="operator"]) .sidebar nav .nav-item { padding: 8px 2px; color: var(--ui-muted); }
  html[data-page-role] body[data-portal]:not([data-portal="operator"]) .sidebar nav .nav-item.active {
    background: var(--ui-soft); color: var(--ui-accent-deep); box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-portal] :is(.nav-item, .metric-grid article, .kpi-card, .model-market-card) { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  body[data-role] .workspace-header, body[data-portal] .topbar,
  body[data-portal]:not([data-portal="operator"]) .sidebar { backdrop-filter: none; }
  body dialog::backdrop { backdrop-filter: none; }
}
@media (forced-colors: active) {
  body[data-portal] .sidebar, body[data-portal] :is(.welcome-row, .page-head),
  body[data-role] .asset-hero { background: Canvas; color: CanvasText; border-color: CanvasText; }
  body[data-portal] :is(.welcome-row, .page-head) h1,
  body[data-role] .asset-hero :is(strong, small, p, span),
  body[data-portal] .sidebar nav .nav-item { color: CanvasText; }
}

/* Unified action controls. Native dynamic buttons share the same final layer;
   navigation, selectable rows and icon controls keep their structural layouts. */
:root {
  --ui-control-height: 44px;
  --ui-control-radius: 12px;
  --ui-control-font-size: 17px;
  --ui-control-weight: 650;
  --ui-content-gutter: 24px;
  --ui-danger: #b42343;
  --ui-danger-line: #edc8d0;
  --ui-danger-soft: #fff6f7;
}
:is(body[data-portal], body[data-role]) :is(button, a.button, a.primary-button, a.secondary-button, a.model-market-link, span.model-market-link, a.about-action):not(:where(
  .sidebar *, .workspace-tabs *, .tabs *, .market-views *, .queue-tabs *, .queue-facets *, .task-filters *,
  .model-market-tabs *, .model-admin-tabs *, .task-drafts-tabs *, .support-dialog nav *,
  .task-auth-tabs *, .task-login-methods *, .auth-login-methods *, .registration-role-options *,
  .account-settings-nav *, .account-hub-items *, .page-security-items *, .support-list > button,
  .role-card, .role-trigger, .workspace-tab, .workspace-search-result, .command-result, .workspace-command-item,
  .task-card, .case-item, .queue-row, .announcement-item, .criterion > button, .material-remove,
  .icon-button, .close-button, .profile-close, .page-dialog-close, .workspace-search-close,
  .workspace-search-mobile, .account-hub-mobile, #mobile-menu,
  [data-command-close], [aria-label^="关闭"], .model-image-navigation button,
  .profile-view-link, .profile-report-button, .support-launch
)) {
  box-sizing: border-box;
  min-height: var(--ui-control-height) !important;
  height: auto !important;
  min-width: 0;
  max-width: 100%;
  padding: 9px 18px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--ui-control-radius) !important;
  background: #fff !important;
  color: var(--ui-accent-deep) !important;
  font-family: inherit !important;
  font-size: var(--ui-control-font-size) !important;
  font-weight: var(--ui-control-weight) !important;
  line-height: 1.35 !important;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
  box-shadow: none !important;
  appearance: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
:is(body[data-portal], body[data-role]) :is(button, a.button, a.primary-button, a.secondary-button, a.model-market-link, a.about-action):not(:where(
  .sidebar *, .workspace-tabs *, .tabs *, .market-views *, .queue-tabs *, .queue-facets *, .task-filters *,
  .model-market-tabs *, .model-admin-tabs *, .task-drafts-tabs *, .support-dialog nav *,
  .task-auth-tabs *, .task-login-methods *, .auth-login-methods *, .registration-role-options *,
  .account-settings-nav *, .account-hub-items *, .page-security-items *, .support-list > button,
  .role-card, .role-trigger, .workspace-tab, .workspace-search-result, .command-result, .workspace-command-item,
  .task-card, .case-item, .queue-row, .announcement-item, .criterion > button, .material-remove,
  .icon-button, .close-button, .profile-close, .page-dialog-close, .workspace-search-close,
  .workspace-search-mobile, .account-hub-mobile, #mobile-menu,
  [data-command-close], [aria-label^="关闭"], .model-image-navigation button,
  .profile-view-link, .profile-report-button, .support-launch
)):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--ui-soft) !important;
  border-color: var(--role-border, var(--ui-accent)) !important;
  transform: none;
}
:is(body[data-portal], body[data-role]) :is(
  .primary-button, .button.primary, .is-primary, .task-auth-primary,
  .security-form-actions .primary, button[type="submit"]:not(:where(.secondary-button, .button.secondary, .task-auth-secondary, [value="cancel"], [value="decline"], form[method="dialog"] button)), .model-market-buy,
  :where(dialog.personal-settings-dialog, .profile-panel) [data-save]
):not(:where(.danger-button, .danger, .is-danger, [data-model-revoke], [value="revoke"])):not(:disabled):not([aria-disabled="true"]) {
  background: linear-gradient(120deg, var(--ui-accent), var(--ui-accent-deep)) !important;
  border-color: var(--ui-accent) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-accent) 18%, transparent) !important;
}
:is(body[data-portal], body[data-role]) :is(
  .primary-button, .button.primary, .is-primary, .task-auth-primary,
  .security-form-actions .primary, button[type="submit"]:not(:where(.secondary-button, .button.secondary, .task-auth-secondary, [value="cancel"], [value="decline"], form[method="dialog"] button)), .model-market-buy,
  :where(dialog.personal-settings-dialog, .profile-panel) [data-save]
):not(:where(.danger-button, .danger, .is-danger, [data-model-revoke], [value="revoke"])):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--ui-accent-deep) !important;
  border-color: var(--ui-accent-deep) !important;
}
:is(body[data-portal], body[data-role]) :is(.danger-button, .button.danger, button.is-danger, [data-model-revoke], button[value="revoke"]):not(:disabled):not([aria-disabled="true"]) {
  color: var(--ui-danger) !important;
  background: var(--ui-danger-soft) !important;
  border-color: var(--ui-danger-line) !important;
  box-shadow: none !important;
}
:is(body[data-portal], body[data-role]) :is(.danger-button, .button.danger, button.is-danger, [data-model-revoke], button[value="revoke"]):hover:not(:disabled):not([aria-disabled="true"]) {
  color: #971a37 !important;
  background: #fdecef !important;
  border-color: #d98a9d !important;
}
:is(body[data-portal], body[data-role]) :is(.ghost-button, .text-button, .auth-text-button, .auth-back, .button.ghost):not(:disabled):not([aria-disabled="true"]) {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
:is(body[data-portal], body[data-role]) :is(.ghost-button, .text-button, .auth-text-button, .auth-back, .button.ghost):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--ui-soft) !important;
  border-color: transparent !important;
}
:is(body[data-portal], body[data-role]) :is(.button.orange, .warning-button):not(:disabled):not([aria-disabled="true"]) {
  color: #81500b !important;
  background: #fff8eb !important;
  border-color: #e8c488 !important;
}
/* Read-only links in the account panel are secondary actions, not save buttons. */
:is(body[data-portal], body[data-role]) dialog.personal-settings-dialog .account-settings-view:not(:disabled):not([aria-disabled="true"]) {
  color: var(--ui-accent-deep) !important;
  background: #fff !important;
  border-color: var(--line-strong) !important;
  box-shadow: none !important;
}
:is(body[data-portal], body[data-role]) :is(.welcome-row, .page-head) {
  padding-inline: var(--ui-content-gutter);
  /* Decorative clipping must not let view-switch focus scroll the banner. */
  overflow: clip;
}
:is(body[data-portal], body[data-role]) :is(.welcome-row, .page-head) .secondary-button:not(:disabled):not([aria-disabled="true"]) {
  color: #fff !important;
  background: #ffffff0f !important;
  border-color: #ffffff32 !important;
}
:is(body[data-portal], body[data-role]) :is(.welcome-row, .page-head) .secondary-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: #ffffff20 !important;
  border-color: #ffffff50 !important;
}
/* All segmented views use one presentation, without legacy underline tabs. */
:is(body[data-portal], body[data-role]) .support-launch:not(:where(.account-hub-items *)) {
  min-height: var(--ui-control-height);
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ui-control-radius);
  background: #fff;
  color: var(--ui-accent-deep);
  font: 650 17px/1.35 "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  box-shadow: none;
}
:is(body[data-portal], body[data-role]) .support-launch:not(:where(.account-hub-items *)):hover:not(:disabled):not([aria-disabled="true"]) { background: var(--ui-soft); }
:is(body[data-portal], body[data-role]) :is(.welcome-row, .page-head) .support-launch:not(:where(.account-hub-items *)) {
  color: #fff; background: #ffffff0f; border-color: #ffffff32;
}
/* Close and utility icons use one compact shape; selectable rows stay roomy. */
:is(body[data-portal], body[data-role]) :is(.close-button, .profile-close, .page-dialog-close, .workspace-search-close, [data-command-close], button[aria-label^="关闭"]) {
  min-height: 36px !important; width: 36px !important; height: 36px !important;
  padding: 0 !important; border: 0 !important; border-radius: var(--ui-control-radius) !important;
  background: var(--ui-soft) !important; color: var(--ui-muted) !important;
  font-size: 22px !important; line-height: 1 !important; box-shadow: none !important;
}
:is(body[data-portal], body[data-role]) .support-dialog header button[aria-label^="关闭"] { font-size: 0 !important; color: transparent !important; }
:is(body[data-portal], body[data-role]) .support-dialog header button[aria-label^="关闭"]::after { font-size: 22px; color: var(--ui-muted); }
:is(body[data-portal], body[data-role]) :is(.tabs, .market-views, .queue-tabs, .queue-facets, .task-filters, .model-market-tabs, .model-admin-tabs, .task-drafts-tabs, .workspace-tabs, .support-dialog nav, .task-auth-tabs, .task-login-methods, .auth-login-methods, .registration-role-options) {
  padding: 5px;
  gap: 4px;
  border: 1px solid var(--ui-line) !important;
  border-radius: 13px !important;
  background: #f5f2f9 !important;
}
:is(body[data-portal], body[data-role]) :is(.tabs button, .market-view, .queue-tab, .queue-facets button, .task-filters button, .model-market-tabs button, .model-admin-tabs button, .task-drafts-tabs button, .workspace-tab, .support-dialog nav button, .task-auth-tabs button, .task-login-methods button, .auth-login-methods button, .registration-role-options button) {
  min-height: 40px !important;
  height: auto;
  padding: 8px 14px !important;
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--ui-muted) !important;
  font: 650 16px/1.35 "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif !important;
  box-shadow: none !important;
}
:is(body[data-portal], body[data-role]) :is(.tabs button.active, .market-view[aria-pressed="true"], .queue-tab.active, .queue-facets button[aria-pressed="true"], .task-filters button[aria-pressed="true"], .model-market-tabs button[aria-selected="true"], .model-admin-tabs button[aria-selected="true"], .task-drafts-tabs button[aria-pressed="true"], .workspace-tab[aria-current="page"], .support-dialog nav button[aria-selected="true"], .task-auth-tabs button[aria-selected="true"], .task-login-methods button[aria-selected="true"], .auth-login-methods button[aria-selected="true"], .registration-role-options button[aria-pressed="true"]):not(:disabled):not([aria-disabled="true"]) {
  background: #fff !important;
  color: var(--ui-accent-deep) !important;
  box-shadow: 0 2px 6px #35274a0b !important;
}
:is(body[data-portal], body[data-role]) :is(.wizard-actions, .panel-footer, .page-dialog-actions, .security-form-actions, .task-draft-actions, .model-market-actions) {
  gap: 12px;
  flex-wrap: wrap;
}
:is(body[data-portal], body[data-role]) :is(button, a, summary):focus-visible {
  outline: 3px solid var(--ui-accent) !important;
  outline-offset: 3px !important;
}
/* Repeating the host scope gives disabled states precedence over all variants. */
:is(body[data-portal], body[data-role]):is(body[data-portal], body[data-role]) :is(button:disabled, button[aria-disabled="true"], a[aria-disabled="true"], span.model-market-link[aria-disabled="true"]) {
  background: #eeebf2 !important;
  border-color: #e0dce8 !important;
  color: #777184 !important;
  box-shadow: none !important;
  opacity: 1;
  filter: none !important;
  cursor: not-allowed;
  transform: none;
}
/* Styling must never reveal hidden controls or replace native disabled semantics. */
:is(body[data-portal], body[data-role]) [hidden] { display: none !important; }
@media (max-width: 700px) {
  :root { --ui-content-gutter: 16px; }
  :is(body[data-portal], body[data-role]) :is(.welcome-row, .page-head) { padding-inline: var(--ui-content-gutter); }
  body[data-role] .assets-view { padding-inline: max(var(--ui-content-gutter), env(safe-area-inset-left)); }
  :is(body[data-portal], body[data-role]) :is(.tabs button, .market-view, .task-filters button, .model-market-tabs button, .task-drafts-tabs button, .workspace-tab) { padding-inline: 8px !important; }
  /* Account-menu support controls remain full-width labeled navigation rows. */
  :is(body[data-portal], body[data-role]) .support-launch:not(:where(.account-hub-items *)) {
    min-height: 44px; min-width: 44px; width: 44px; height: 44px; padding: 0;
    color: transparent !important; font-size: 0;
  }
  :is(body[data-portal], body[data-role]) .support-launch:not(:where(.account-hub-items *))::after {
    content: "?"; display: grid; place-items: center;
    min-height: 42px; color: var(--ui-accent-deep); font-size: 17px; line-height: 1;
  }
  :is(body[data-portal], body[data-role]) :is(.welcome-row, .page-head) .support-launch:not(:where(.account-hub-items *))::after { color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  :is(body[data-portal], body[data-role]) :is(button, a.button) { transition: none !important; }
}
@media (forced-colors: active) {
  :is(body[data-portal], body[data-role]):is(body[data-portal], body[data-role]) :is(button, a.button, span.model-market-link) { background: ButtonFace !important; color: ButtonText !important; border-color: ButtonText !important; box-shadow: none !important; }
  :is(body[data-portal], body[data-role]):is(body[data-portal], body[data-role]) :is(button:disabled, button[aria-disabled="true"], span.model-market-link[aria-disabled="true"]) { color: GrayText !important; border-color: GrayText !important; }
}
