
    :root {
      color-scheme: light;
      --bg: #f6f7f9;
      --panel: #ffffff;
      --panel-soft: #f9fafb;
      --line: #dfe4ea;
      --line-strong: #c6ced8;
      --text: #17202a;
      --muted: #667085;
      --faint: #8a94a6;
      --green: #12805c;
      --green-soft: #dff4eb;
      --blue: #2457c5;
      --blue-soft: #e5edff;
      --amber: #946200;
      --amber-soft: #fff1cc;
      --rose: #b42318;
      --rose-soft: #ffe7e4;
      --ink: #101828;
      --shadow: 0 16px 40px rgba(16, 24, 40, .08);
      --radius: 8px;
      --sidebar: 248px;
      font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      letter-spacing: 0;
    }

    button,
    input,
    select {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    .shell {
      min-height: 100vh;
      display: grid;
      grid-template-columns: var(--sidebar) minmax(0, 1fr);
    }

    .sidebar {
      background: #111827;
      color: #e5e7eb;
      padding: 20px 16px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      position: sticky;
      top: 0;
      height: 100vh;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 4px 8px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .brand-mark {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: #ffffff;
      color: #111827;
      font-weight: 800;
    }

    .brand strong {
      display: block;
      font-size: 17px;
      line-height: 1.2;
    }

    .brand span {
      display: block;
      font-size: 12px;
      color: #aeb7c4;
      margin-top: 2px;
    }

    .nav {
      display: grid;
      gap: 6px;
    }

    .nav button {
      height: 42px;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: #cfd6df;
      display: grid;
      grid-template-columns: 24px 1fr;
      align-items: center;
      gap: 8px;
      padding: 0 10px;
      text-align: left;
    }

    .nav button svg,
    .icon-btn svg,
    .btn svg {
      width: 18px;
      height: 18px;
      stroke-width: 2;
    }

    .nav button.active {
      color: #ffffff;
      background: rgba(255, 255, 255, .12);
    }

    .nav button:hover {
      background: rgba(255, 255, 255, .08);
    }

    .sidebar-footer {
      margin-top: auto;
      padding: 12px;
      border: 1px solid rgba(255, 255, 255, .12);
      border-radius: 8px;
      background: rgba(255, 255, 255, .04);
      font-size: 13px;
      color: #cfd6df;
    }

    .main {
      min-width: 0;
      display: flex;
      flex-direction: column;
    }

    .topbar {
      min-height: 72px;
      border-bottom: 1px solid var(--line);
      background: rgba(255, 255, 255, .92);
      backdrop-filter: blur(12px);
      position: sticky;
      top: 0;
      z-index: 10;
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 14px 28px;
    }

    .title-block {
      min-width: 0;
      flex: 1;
    }

    .title-block h1 {
      margin: 0;
      font-size: 22px;
      line-height: 1.25;
      color: var(--ink);
    }

    .title-block p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    .tenant-select {
      height: 40px;
      border-radius: 8px;
      border: 1px solid var(--line-strong);
      background: #fff;
      color: var(--text);
      padding: 0 36px 0 12px;
      min-width: 190px;
    }

    .btn-row {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .btn,
    .icon-btn {
      border-radius: 8px;
      border: 1px solid var(--line-strong);
      background: #fff;
      color: var(--text);
      min-height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 14px;
      white-space: nowrap;
    }

    .btn.primary {
      border-color: #111827;
      background: #111827;
      color: #fff;
    }

    .btn.success {
      border-color: var(--green);
      background: var(--green);
      color: #fff;
    }

    .icon-btn {
      width: 40px;
      padding: 0;
    }

    .content {
      padding: 24px 28px 36px;
      display: grid;
      gap: 22px;
    }

    .view {
      display: none;
      gap: 22px;
    }

    .view.active {
      display: grid;
    }

    .grid-4 {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
    }

    .grid-3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
      gap: 16px;
    }

    .metric,
    .panel,
    .card {
      border: 1px solid var(--line);
      background: var(--panel);
      border-radius: var(--radius);
      box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    }

    .metric {
      min-height: 108px;
      padding: 16px;
      display: grid;
      align-content: space-between;
      gap: 10px;
    }

    .metric .label {
      color: var(--muted);
      font-size: 13px;
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
    }

    .metric strong {
      font-size: 28px;
      line-height: 1;
      color: var(--ink);
    }

    .metric small {
      color: var(--green);
      font-size: 12px;
    }

    .panel {
      overflow: hidden;
    }

    .panel-head {
      min-height: 58px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .panel-head h2,
    .panel-head h3 {
      margin: 0;
      font-size: 16px;
      line-height: 1.3;
      color: var(--ink);
    }

    .panel-head span {
      color: var(--muted);
      font-size: 13px;
    }

    .panel-body {
      padding: 16px;
    }

    .system-map {
      display: grid;
      grid-template-columns: 1fr 148px 1fr;
      align-items: center;
      gap: 12px;
      min-height: 280px;
    }

    .system-stack {
      display: grid;
      gap: 10px;
    }

    .system-node {
      min-height: 64px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-soft);
      display: grid;
      gap: 6px;
    }

    .system-node strong {
      font-size: 14px;
      color: var(--ink);
    }

    .system-node span {
      color: var(--muted);
      font-size: 12px;
    }

    .identity-hub {
      height: 148px;
      border-radius: 50%;
      border: 1px solid var(--line-strong);
      background: #fff;
      box-shadow: var(--shadow);
      display: grid;
      place-items: center;
      text-align: center;
      padding: 18px;
      position: relative;
    }

    .identity-hub:before,
    .identity-hub:after {
      content: "";
      position: absolute;
      left: -54px;
      right: -54px;
      top: 50%;
      height: 1px;
      background: var(--line-strong);
      z-index: -1;
    }

    .identity-hub strong {
      display: block;
      font-size: 18px;
      color: var(--ink);
    }

    .identity-hub span {
      display: block;
      margin-top: 4px;
      font-size: 12px;
      color: var(--muted);
    }

    .steps {
      display: grid;
      gap: 12px;
    }

    .step {
      display: grid;
      grid-template-columns: 32px 1fr auto;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .step-no {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: var(--blue-soft);
      color: var(--blue);
      font-weight: 700;
    }

    .step strong {
      display: block;
      font-size: 14px;
      color: var(--ink);
    }

    .step span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
    }

    .badge,
    .status,
    .pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      min-height: 24px;
      padding: 0 9px;
      font-size: 12px;
      white-space: nowrap;
      border: 1px solid transparent;
    }

    .badge.green,
    .status.on {
      background: var(--green-soft);
      color: var(--green);
      border-color: #bfe8d6;
    }

    .badge.blue {
      background: var(--blue-soft);
      color: var(--blue);
      border-color: #c9d8ff;
    }

    .badge.amber,
    .status.wait {
      background: var(--amber-soft);
      color: var(--amber);
      border-color: #f2d98d;
    }

    .badge.rose {
      background: var(--rose-soft);
      color: var(--rose);
      border-color: #ffc8c2;
    }

    .table-wrap {
      overflow: auto;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
    }

    th,
    td {
      padding: 13px 14px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      font-size: 14px;
      vertical-align: middle;
    }

    th {
      color: var(--muted);
      font-size: 12px;
      font-weight: 600;
      background: var(--panel-soft);
    }

    td strong {
      color: var(--ink);
    }

    .product-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .product-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      min-height: 136px;
      display: grid;
      gap: 12px;
      background: #fff;
    }

    .product-title {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
    }

    .product-title strong {
      color: var(--ink);
      font-size: 15px;
    }

    .product-title span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
    }

    .switch {
      width: 46px;
      height: 26px;
      border-radius: 999px;
      background: #cbd5e1;
      border: 0;
      padding: 3px;
      flex: 0 0 auto;
    }

    .switch:before {
      content: "";
      display: block;
      width: 20px;
      height: 20px;
      background: #fff;
      border-radius: 50%;
      transition: transform .18s ease;
      box-shadow: 0 1px 2px rgba(16, 24, 40, .2);
    }

    .switch.on {
      background: var(--green);
    }

    .switch.on:before {
      transform: translateX(20px);
    }

    .quota {
      height: 8px;
      border-radius: 999px;
      background: #edf1f5;
      overflow: hidden;
    }

    .quota > span {
      display: block;
      height: 100%;
      width: var(--value);
      background: var(--blue);
    }

    .search-row {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .search {
      flex: 1;
      min-width: 220px;
      height: 40px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      background: #fff;
      padding: 0 12px;
    }

    .segmented {
      height: 40px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      background: #fff;
      display: inline-grid;
      grid-auto-flow: column;
      overflow: hidden;
    }

    .segmented button {
      border: 0;
      background: transparent;
      padding: 0 12px;
      color: var(--muted);
    }

    .segmented button.active {
      background: #111827;
      color: #fff;
    }

    .role-matrix {
      display: grid;
      gap: 10px;
    }

    .role-row {
      display: grid;
      grid-template-columns: 160px repeat(5, minmax(96px, 1fr));
      gap: 8px;
      align-items: center;
    }

    .role-head,
    .role-name,
    .permission {
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 8px;
      display: flex;
      align-items: center;
      padding: 0 10px;
      background: #fff;
      font-size: 13px;
    }

    .role-head {
      background: var(--panel-soft);
      color: var(--muted);
      font-weight: 600;
    }

    .role-name {
      color: var(--ink);
      font-weight: 700;
    }

    .permission {
      justify-content: center;
      color: var(--muted);
    }

    .permission.allow {
      background: var(--green-soft);
      color: var(--green);
      border-color: #bfe8d6;
    }

    .config-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
      gap: 16px;
    }

    .field-list {
      display: grid;
      gap: 14px;
    }

    .field {
      display: grid;
      gap: 7px;
    }

    .field label {
      color: var(--muted);
      font-size: 13px;
    }

    .field input,
    .field select {
      width: 100%;
      height: 40px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      padding: 0 12px;
      color: var(--text);
      background: #fff;
    }

    .code-box {
      border-radius: 8px;
      background: #111827;
      color: #d1fae5;
      padding: 14px;
      overflow: auto;
      font-family: Consolas, "SFMono-Regular", monospace;
      font-size: 12px;
      line-height: 1.55;
    }

    .login-preview {
      min-height: 430px;
      background: #eef2f6;
      border-radius: 8px;
      border: 1px solid var(--line);
      display: grid;
      place-items: center;
      padding: 22px;
    }

    .login-box {
      width: min(100%, 360px);
      border-radius: 8px;
      background: #fff;
      border: 1px solid var(--line);
      box-shadow: var(--shadow);
      padding: 22px;
      display: grid;
      gap: 14px;
    }

    .login-box h3 {
      margin: 0;
      font-size: 20px;
      color: var(--ink);
    }

    .login-box p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
    }

    .login-tabs {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      background: var(--panel-soft);
      padding: 4px;
      border-radius: 8px;
    }

    .login-tabs button {
      min-height: 34px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      font-size: 13px;
    }

    .login-tabs button.active {
      background: #fff;
      color: var(--ink);
      box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
    }

    .divider {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 10px;
      color: var(--faint);
      font-size: 12px;
    }

    .divider:before,
    .divider:after {
      content: "";
      height: 1px;
      background: var(--line);
    }

    .toast {
      position: fixed;
      right: 22px;
      bottom: 22px;
      background: #111827;
      color: #fff;
      border-radius: 8px;
      padding: 12px 14px;
      box-shadow: var(--shadow);
      transform: translateY(18px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease;
      z-index: 40;
      font-size: 14px;
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    .modal {
      position: fixed;
      inset: 0;
      background: rgba(17, 24, 39, .42);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 30;
    }

    .modal.show {
      display: flex;
    }

    .modal-card {
      width: min(100%, 720px);
      border-radius: 8px;
      background: #fff;
      border: 1px solid var(--line);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .modal-card .panel-body {
      display: grid;
      gap: 14px;
      max-height: min(72vh, 680px);
      overflow: auto;
    }

    .check-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .check-card {
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 10px;
      color: var(--text);
      background: #fff;
      font-size: 14px;
    }

    .check-card input {
      width: 16px;
      height: 16px;
    }

    .helper-note {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-soft);
      color: var(--muted);
      font-size: 13px;
      line-height: 1.55;
      padding: 10px 12px;
    }

    .copy-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .copy-row input {
      height: 40px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      padding: 0 10px;
      color: var(--text);
      background: #fff;
      min-width: 0;
    }

    .invite-result {
      display: none;
      border: 1px solid #bfe8d6;
      background: var(--green-soft);
      color: var(--green);
      border-radius: 8px;
      padding: 12px;
      gap: 10px;
    }

    .invite-result.show {
      display: grid;
    }

    .product-actions {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 8px;
      align-items: center;
    }

    .product-actions input {
      height: 36px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      padding: 0 9px;
      min-width: 0;
      color: var(--text);
      background: #fff;
      font-size: 13px;
    }

    .mini-btn {
      min-height: 36px;
      border-radius: 8px;
      border: 1px solid var(--line-strong);
      background: #fff;
      color: var(--text);
      padding: 0 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      white-space: nowrap;
      font-size: 13px;
    }

    @media (max-width: 1180px) {
      .grid-4,
      .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .grid-2,
      .config-grid {
        grid-template-columns: 1fr;
      }

      .role-row {
        grid-template-columns: 140px repeat(5, minmax(92px, 1fr));
      }
    }

    @media (max-width: 820px) {
      .shell {
        grid-template-columns: 1fr;
      }

      .sidebar {
        position: static;
        height: auto;
      }

      .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .topbar {
        position: static;
        padding: 16px;
        align-items: stretch;
        flex-direction: column;
      }

      .content {
        padding: 16px;
      }

      .grid-4,
      .grid-3,
      .product-grid {
        grid-template-columns: 1fr;
      }

      .system-map {
        grid-template-columns: 1fr;
      }

      .identity-hub {
        width: 148px;
        justify-self: center;
      }

      .identity-hub:before,
      .identity-hub:after {
        display: none;
      }

      .role-matrix {
        overflow: auto;
      }

      .role-row {
        min-width: 720px;
      }
    }
  