:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --nav: #101828;
  --nav-soft: #1d2939;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --text: #182230;
  --muted: #667085;
  --subtle: #98a2b3;
  --primary: #175cd3;
  --primary-soft: #eff4ff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --purple: #6941c6;
  --purple-soft: #f4f3ff;
  --shadow: 0 12px 36px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { min-width: 1180px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid #84adff; outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); background: var(--bg); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--nav); color: #fff; overflow-y: auto; }
.brand-block { height: 76px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-block > span:last-child { display: grid; }
.brand-block strong { font-size: 16px; letter-spacing: .02em; }
.brand-block small { color: #98a2b3; font-size: 11px; margin-top: 1px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); background: #fff; color: var(--nav); border-radius: 8px; font-family: "STKaiti", serif; font-weight: 800; font-size: 19px; }
.nav-groups { flex: 1; padding: 20px 12px; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-group h2 { margin: 0 10px 7px; color: #667085; font-size: 11px; line-height: 22px; font-weight: 650; letter-spacing: .08em; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 11px; margin: 2px 0; padding: 0 11px; color: #d0d5dd; border-radius: 7px; text-decoration: none; font-weight: 560; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: var(--nav-soft); color: #fff; box-shadow: inset 3px 0 0 #84adff; }
.nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:first-child svg path { fill: currentColor; stroke: none; }
.sidebar-foot { min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 0 22px; border-top: 1px solid rgba(255,255,255,.08); color: #98a2b3; font-size: 12px; }
.synthetic-dot { width: 8px; height: 8px; border-radius: 50%; background: #32d583; box-shadow: 0 0 0 4px rgba(50,213,131,.12); }

.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar-context, .topbar-actions, .operator-menu, .scenario-control { display: flex; align-items: center; }
.topbar-context { gap: 10px; color: var(--muted); font-size: 12px; }
.environment-label { color: #344054; font-weight: 650; }
.topbar-divider { width: 1px; height: 16px; background: var(--line-strong); }
.topbar-actions { gap: 20px; }
.scenario-control { gap: 8px; color: var(--muted); font-size: 12px; }
.scenario-control select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.operator-menu { gap: 9px; }
.operator-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 750; }
.operator-menu > span:last-child { display: grid; }
.operator-menu strong { font-size: 12px; }
.operator-menu small { color: var(--muted); font-size: 11px; }

.page-root { padding: 28px 30px 56px; }
.page-heading { min-height: 70px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: 24px; line-height: 1.3; letter-spacing: -.02em; }
.page-heading p { max-width: 720px; margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; }
.group-tabs { display: flex; align-items: center; gap: 4px; margin: -4px 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #eaecf0; overflow-x: auto; }
.group-tab { flex: 0 0 auto; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 6px; color: #475467; text-decoration: none; font-size: 12px; font-weight: 650; }
.group-tab:hover { color: var(--text); background: rgba(255,255,255,.6); }
.group-tab.is-active { color: #1849a9; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.grouped-content { display: grid; gap: 14px; }
.section-heading { min-height: 56px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 2px 2px 8px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.surface { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(16,24,40,.02); }
.placeholder-surface { min-height: 320px; padding: 42px; }
.placeholder-surface h2 { margin-top: 0; }
.placeholder-surface p { color: var(--muted); }
.boot-state { padding: 64px; color: var(--muted); text-align: center; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: #344054; text-decoration: none; font-weight: 650; cursor: pointer; }
.button:hover { background: #f9fafb; }
.button-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button-primary:hover { background: #1849a9; }
.button-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.button-danger:hover { background: var(--danger); }
.button-quiet-danger { border-color: #fda29b; color: var(--danger); background: #fff; }
.button:disabled { cursor: not-allowed; opacity: .5; }

.state-panel { min-height: 240px; display: grid; place-items: center; align-content: center; padding: 36px; text-align: center; }
.state-panel h2 { margin: 12px 0 4px; font-size: 18px; }
.state-panel p { max-width: 460px; margin: 0; color: var(--muted); }
.state-mark { width: 34px; height: 34px; border-radius: 50%; border: 8px solid var(--primary-soft); background: var(--primary); }
.state-error .state-mark, .state-operation_failed .state-mark, .state-forbidden .state-mark { border-color: var(--danger-soft); background: var(--danger); }
.state-maintenance .state-mark, .state-version_conflict .state-mark, .state-support_expiring .state-mark { border-color: var(--warning-soft); background: var(--warning); }
.state-success .state-mark { border-color: var(--success-soft); background: var(--success); }
.state-action { margin-top: 18px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: #f9fafb; color: #475467; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge-success { background: var(--success-soft); border-color: #abefc6; color: var(--success); }
.badge-warning { background: var(--warning-soft); border-color: #fedf89; color: var(--warning); }
.badge-danger { background: var(--danger-soft); border-color: #fecdca; color: var(--danger); }
.badge-primary { background: var(--primary-soft); border-color: #b2ccff; color: var(--primary); }
.badge-purple { background: var(--purple-soft); border-color: #d9d6fe; color: var(--purple); }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted-copy { color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { min-height: 124px; display: grid; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.metric-card > span { color: var(--muted); font-size: 12px; }
.metric-card strong { margin-top: 10px; font-size: 25px; line-height: 1; letter-spacing: -.03em; }
.metric-card small { margin-top: 10px; color: var(--subtle); line-height: 1.35; }
.metric-success { border-top: 3px solid #47cd89; }
.metric-warning { border-top: 3px solid #fdb022; }
.metric-danger { border-top: 3px solid #f97066; }
.dashboard-grid, .detail-layout, .activation-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, .8fr); gap: 18px; }
.dashboard-panel, .detail-panel, .action-panel { padding: 21px; }
.panel-heading { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-heading > a { color: var(--primary); text-decoration: none; font-weight: 650; font-size: 12px; }
.task-list { display: grid; }
.task-list a { display: grid; padding: 15px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.task-list a:last-child { border-bottom: 0; }
.task-list strong { font-size: 13px; }
.task-list span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-list { margin: 0; }
.status-list div { min-height: 49px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.status-list div:last-child { border-bottom: 0; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 600; }
.table-surface { overflow: hidden; }
.table-toolbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.table-toolbar strong { color: var(--text); font-size: 14px; }
.table-toolbar p { margin: 2px 0 0; }
.filter-set { display: flex; align-items: center; gap: 10px; }
.search-field input, .table-toolbar select { height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.search-field input { width: 260px; padding: 0 11px; }
.table-toolbar select { padding: 0 30px 0 10px; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 1000px; border-collapse: collapse; }
.data-table th { height: 43px; padding: 0 14px; background: #f9fafb; color: var(--muted); font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
.data-table td { height: 67px; padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fcfcfd; }
.entity-link { display: grid; color: inherit; text-decoration: none; }
.entity-link strong { font-size: 13px; }
.entity-link span, .cell-note { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.organization-link { grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 11px; }
.organization-link > span:last-child { margin: 0; }
.organization-link small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.organization-list-avatar { width: 38px; height: 38px; display: grid !important; place-items: center; overflow: hidden; margin: 0 !important; border-radius: 50%; background: var(--primary-soft); color: var(--primary) !important; font-size: 14px !important; font-weight: 750; }
.organization-list-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.provisioning-table { min-width: 860px; }
.usage-cell { min-width: 96px; }
.usage-cell span { font-variant-numeric: tabular-nums; }
.usage-cell i { display: block; width: 92px; height: 4px; margin-top: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--primary) var(--usage), #eaecf0 var(--usage)); }
.version-chip { display: inline-flex; padding: 2px 7px; border-radius: 5px; background: #f2f4f7; color: #475467; font-size: 11px; font-weight: 700; }
.row-actions { display: flex; align-items: center; gap: 12px; }
.text-link { color: var(--primary); text-decoration: none; font-weight: 650; font-size: 12px; }
.icon-more { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-more:hover { background: #f2f4f7; }
.table-empty { padding: 56px 24px; color: var(--muted); text-align: center; }
.form-surface { overflow: hidden; }
.form-section { display: grid; grid-template-columns: 260px minmax(0, 680px); gap: 40px; padding: 26px; border-bottom: 1px solid var(--line); }
.form-section h2 { margin: 0; font-size: 16px; }
.form-section > div:first-child p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label, .dialog-card label { display: grid; gap: 7px; font-weight: 650; font-size: 12px; }
.form-grid input, .form-grid textarea, .form-grid select, .dialog-card textarea, .dialog-card select { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.form-grid input { height: 40px; padding: 0 11px; }
.form-grid select, .dialog-card select { height: 40px; padding: 0 11px; }
.form-grid textarea, .dialog-card textarea { padding: 10px 11px; resize: vertical; }
.form-grid small { color: var(--muted); font-weight: 400; }
.span-2 { grid-column: 1 / -1; }
.form-footer { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; color: var(--muted); font-size: 12px; }
.form-footer > div { display: flex; gap: 10px; }
.provision-dialog, .avatar-crop-dialog { padding: 0; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 24px 72px rgba(16,24,40,.24); }
.provision-dialog { width: min(680px, calc(100vw - 48px)); max-height: calc(100vh - 48px); }
.avatar-crop-dialog { width: min(570px, calc(100vw - 48px)); }
.provision-dialog::backdrop, .avatar-crop-dialog::backdrop { background: rgba(16,24,40,.52); backdrop-filter: blur(2px); }
.provision-dialog-card, .avatar-crop-dialog > section { min-width: 0; }
.provision-dialog-head { min-height: 78px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 24px 17px; border-bottom: 1px solid var(--line); }
.provision-dialog-head h2 { margin: 0; font-size: 18px; }
.provision-dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.dialog-close { width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 7px; background: #f2f4f7; color: var(--muted); font-size: 20px; cursor: pointer; }
.provision-dialog-body { max-height: calc(100vh - 210px); overflow-y: auto; padding: 22px 24px; }
.provision-form { display: grid; gap: 16px; }
.provision-form > label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 650; }
.provision-form input:not([type="file"]), .provision-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.provision-form input:not([type="file"]) { height: 40px; padding: 0 11px; }
.provision-form textarea { padding: 10px 11px; resize: vertical; }
.provision-form small { color: var(--muted); font-weight: 400; }
.avatar-picker { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; }
.avatar-picker > div:last-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avatar-picker > div:last-child small { flex-basis: 100%; }
.avatar-preview { width: 68px; height: 68px; display: grid; place-items: center; overflow: hidden; border: 1px solid #b2ccff; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 22px; font-weight: 750; }
.avatar-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.provision-dialog-foot { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 24px; border-top: 1px solid var(--line); background: #f9fafb; color: var(--muted); font-size: 11px; }
.provision-dialog-foot > div { display: flex; gap: 9px; }
.provision-success { text-align: center; }
.success-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 4px auto 12px; border-radius: 50%; background: var(--success); color: #fff; font-size: 22px; }
.provision-success h2 { margin: 0; font-size: 20px; }
.provision-success > p { margin: 6px 0 18px; color: var(--muted); font-size: 11px; }
.provision-success dl { margin: 0 0 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; background: #f9fafb; text-align: left; }
.provision-success dl div { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 32px; }
.provision-success dt { color: var(--muted); font-size: 10px; }
.provision-success dd { margin: 0; font-size: 11px; font-weight: 650; }
.access-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; margin-top: 10px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 9px; text-align: left; }
.access-result > span { color: var(--muted); font-size: 10px; }
.access-result strong { grid-column: 1; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.access-result .button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.access-result p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 10px; }
.invite-result { border-color: #b2ccff; background: var(--primary-soft); }
.invite-result strong { color: #1849a9; font-size: 17px; letter-spacing: .04em; }
.avatar-crop-body { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: center; padding: 22px 24px; }
.avatar-crop-stage { width: 320px; height: 320px; overflow: hidden; border-radius: 10px; background: var(--nav); }
#avatarCropCanvas { width: 320px; height: 320px; display: block; cursor: grab; touch-action: none; }
#avatarCropCanvas.is-dragging { cursor: grabbing; }
.avatar-crop-controls { display: grid; gap: 16px; align-content: center; }
.avatar-crop-controls label { display: grid; gap: 8px; color: #344054; font-size: 11px; font-weight: 650; }
.avatar-crop-controls input { width: 100%; accent-color: var(--primary); }
.avatar-crop-controls p { margin: 0; padding: 12px; border-radius: 7px; background: #f2f4f7; color: #475467; font-size: 10px; }
#avatarCropError { min-height: 16px; color: var(--danger); }
.organization-hero { min-height: 108px; display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 20px; }
.organization-avatar { width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--nav); color: #fff; font-family: "STKaiti", serif; font-size: 24px; font-weight: 800; }
.organization-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.organization-hero h2 { margin: 2px 0 0; font-size: 18px; }
.organization-hero p { margin: 2px 0 0; color: var(--muted); }
.synthetic-label { color: var(--primary); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.hero-status { margin-left: auto; display: flex; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.detail-item { min-height: 74px; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.detail-item:nth-last-child(-n+2) { border-bottom: 0; }
.detail-item dt { color: var(--muted); font-size: 11px; }
.detail-item dd { margin: 6px 0 0; font-weight: 600; }
.action-panel { align-self: start; }
.action-list { display: grid; margin-top: 8px; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.action-row span { display: grid; }
.action-row strong { font-size: 13px; }
.action-row small { margin-top: 2px; color: var(--muted); }
.action-row em { color: var(--danger); font-size: 10px; font-style: normal; white-space: nowrap; }
.forbidden-note, .safety-note { margin-top: 14px; padding: 13px; border: 1px solid #fedf89; border-radius: 7px; background: var(--warning-soft); color: #7a2e0e; }
.forbidden-note p { margin: 3px 0 0; }
.lower-layout { margin-top: 18px; grid-template-columns: 1fr 1fr; }
.platform-note { color: #475467; line-height: 1.8; }
.activation-action p { color: var(--muted); }
.button-block { width: 100%; margin-top: 10px; }
.compact-details { margin: 16px 0 0; }
.compact-details div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.compact-details dd { margin: 0; font-weight: 600; }
.review-list { display: grid; }
.review-item { display: grid; grid-template-columns: 1.1fr 1.4fr auto; gap: 28px; align-items: center; padding: 20px; border-top: 1px solid var(--line); }
.review-change { display: flex; align-items: center; gap: 10px; }
.review-change i { color: var(--subtle); font-style: normal; }
.review-item dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.review-item dl div { display: flex; justify-content: space-between; gap: 10px; }
.review-item dt { color: var(--muted); font-size: 11px; }
.review-item dd { margin: 0; font-size: 11px; font-weight: 600; }
.review-actions { display: flex; align-items: center; gap: 8px; }
.rule-strip, .risk-banner { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid #b2ccff; border-radius: 9px; background: var(--primary-soft); color: #1849a9; font-size: 12px; }
.rule-strip strong { color: #194185; }
.rule-strip span::before { content: "·"; margin-right: 18px; color: #84adff; }
.risk-banner { justify-content: space-between; border-color: #fecdca; background: var(--danger-soft); color: var(--danger); }
.risk-banner p { margin: 3px 0 0; color: #912018; }
.compact-table { min-width: 820px; }
.support-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.support-mode-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.support-mode-grid p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.support-mode-grid .danger-card { border-color: #fecdca; background: #fffafa; }
.support-list { display: grid; }
.support-row { display: grid; grid-template-columns: 1.1fr 1.7fr .8fr auto; gap: 20px; align-items: center; padding: 17px 20px; border-top: 1px solid var(--line); }
.support-row > div { display: grid; gap: 4px; }
.support-row span, .support-row small { font-size: 11px; }
.support-actions { display: flex !important; grid-auto-flow: column; align-items: center; }
.confirmation-check { grid-template-columns: auto 1fr !important; align-items: start; margin-top: 14px; }
.confirmation-check input { margin-top: 2px; }
.redaction-strip { display: flex; gap: 16px; margin-bottom: 16px; padding: 13px 17px; border: 1px solid #d9d6fe; border-radius: 8px; background: var(--purple-soft); color: #5925dc; font-size: 12px; }
.audit-table { min-width: 1280px; }
.audit-table code { color: #475467; font-size: 11px; }
.severity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.severity-grid article { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 17px; border: 1px solid var(--line); border-left: 4px solid #98a2b3; border-radius: 8px; background: #fff; }
.severity-grid span { font-weight: 800; }
.severity-grid strong { justify-self: end; font-size: 22px; }
.severity-grid small { grid-column: 1 / -1; color: var(--muted); }
.severity-p0 { border-color: #d92d20 !important; color: #b42318; }
.severity-p1 { border-color: #f04438 !important; color: #d92d20; }
.severity-p2 { border-color: #f79009 !important; color: #b54708; }
.severity-p3 { border-color: #2e90fa !important; color: #175cd3; }
.alert-list { overflow: hidden; }
.alert-list > article { display: grid; grid-template-columns: 54px minmax(0, 1fr) 420px; gap: 18px; align-items: center; padding: 18px 20px; border-top: 1px solid var(--line); }
.alert-severity { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid; border-radius: 8px; font-weight: 800; }
.alert-list p { margin: 4px 0 0; color: var(--muted); }
.alert-list dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; }
.alert-list dt { color: var(--muted); font-size: 10px; }
.alert-list dd { margin: 4px 0 0; font-size: 11px; font-weight: 650; }
.service-list { display: grid; }
.service-list > div { display: grid; grid-template-columns: auto 1fr 1.3fr auto; gap: 12px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); }
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.service-degraded { background: var(--warning); }
.service-list small { color: var(--muted); }
.login-layout { min-height: calc(100vh - 140px); display: grid; grid-template-columns: 1.2fr 440px; align-items: center; gap: 80px; max-width: 1120px; margin: 0 auto; }
.login-message { padding: 40px; }
.login-brand { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 12px; background: var(--nav); color: #fff; font-family: "STKaiti", serif; font-size: 25px; }
.login-message h1 { margin: 22px 0 8px; font-size: 34px; }
.login-message p { color: var(--muted); font-size: 16px; }
.login-message ul { margin: 28px 0 0; padding-left: 20px; color: #475467; line-height: 2; }
.login-panel { padding: 30px; }
.login-panel h2 { margin: 0; }
.login-panel > p { color: var(--muted); }
.platform-auth-approval-code { margin: 24px 0 12px; padding: 14px; border-radius: 8px; background: #eef2ef; color: #244b39; font: 600 24px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-align: center; }
.platform-auth-progress { margin-top: 18px; color: var(--muted); }
.site-icp-footer { position: fixed; z-index: 20; right: 0; bottom: 8px; left: 0; text-align: center; font-size: 12px; line-height: 1.5; pointer-events: none; }
.site-icp-footer a { color: var(--muted); text-decoration: none; pointer-events: auto; }
.site-icp-footer a:hover { text-decoration: underline; }
.form-help { margin-top: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.confirm-dialog { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; max-width: none; max-height: none; display: grid; place-items: center; margin: 0; padding: 0; border: 0; background: rgba(16,24,40,.48); }
.dialog-card { width: 520px; padding: 26px; border-radius: 10px; background: #fff; box-shadow: 0 26px 70px rgba(16,24,40,.22); }
.dialog-card h2 { margin: 12px 0 6px; font-size: 20px; }
.dialog-card > p { margin: 0 0 20px; color: var(--muted); }
.dialog-risk { display: inline-flex; padding: 4px 8px; border-radius: 5px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-weight: 750; }
.risk-highest { background: var(--danger-soft); color: var(--danger); }
.dialog-impact { display: grid; margin-top: 16px; padding: 12px; border-radius: 7px; background: #f9fafb; }
.dialog-impact span { color: var(--muted); font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 100; }
.toast { min-width: 300px; max-width: 440px; padding: 13px 16px; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.toast-error { border-left-color: var(--danger); }

@media (max-width: 1320px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .topbar, .page-root { padding-left: 22px; padding-right: 22px; }
  .brand-block { padding: 0 16px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-section { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 900px) {
  html { min-width: 0; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; z-index: 30; width: 100%; height: auto; flex-direction: row; overflow: hidden; }
  .brand-block, .sidebar-foot, .nav-group h2 { display: none; }
  .nav-groups { width: 100%; display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; }
  .nav-group, .nav-group + .nav-group { display: contents; margin: 0; }
  .nav-link { flex: 0 0 auto; min-height: 36px; margin: 0; padding: 0 10px; font-size: 12px; }
  .nav-link svg { width: 15px; height: 15px; }
  .topbar { position: static; min-height: 74px; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .topbar-actions { gap: 10px; }
  .operator-menu > span:last-child, .topbar-divider, .topbar-context > span:last-child { display: none; }
  .page-root { padding: 20px 16px 42px; }
  .page-heading { min-height: 0; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .section-heading { flex-direction: column; gap: 10px; }
  .page-actions { flex-wrap: wrap; }
  .metric-grid, .metric-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .detail-layout, .activation-layout, .lower-layout { grid-template-columns: minmax(0, 1fr); }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-footer { align-items: flex-start; flex-direction: column; gap: 12px; padding: 18px 20px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .filter-set { width: 100%; align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .support-mode-grid, .severity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-row, .alert-list > article { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .support-actions { justify-content: start; }
  .alert-list dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-item { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rule-strip, .redaction-strip { align-items: flex-start; flex-direction: column; gap: 6px; }
  .rule-strip span::before { content: none; }
  .dialog-card { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow-y: auto; }
  .login-layout { min-height: auto; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .login-message { padding: 24px 10px; }
}

@media (max-width: 620px) {
  .avatar-crop-dialog { width: calc(100vw - 28px); }
  .avatar-crop-body { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; }
  .avatar-crop-stage { width: min(320px, calc(100vw - 64px)); height: auto; aspect-ratio: 1; justify-self: center; }
  #avatarCropCanvas { width: 100%; height: 100%; }
  .avatar-crop-controls { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
