:root {
    --portal-ink: #172033;
    --portal-muted: #5d6f89;
    --portal-line: rgba(15, 23, 42, 0.1);
    --portal-card: rgba(255, 255, 255, 0.86);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    color: var(--portal-ink);
    background: #eef2f7;
    font-family: "Aptos", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.ant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    vertical-align: middle;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
    padding: 26px 30px;
    border: 1px solid var(--portal-line);
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 255, 0.9)),
        repeating-linear-gradient(90deg, transparent 0 46px, rgba(47, 128, 237, 0.06) 46px 47px);
    box-shadow: 0 20px 70px rgba(15, 23, 42, 0.08);
}

.hero-copy h1,
.page-heading h1 {
    max-width: 880px;
    margin-bottom: 10px;
    color: var(--portal-ink);
    font-size: clamp(2rem, 3.3vw, 3.35rem);
    line-height: 1;
    letter-spacing: 0;
}

.hero-copy p,
.page-heading p {
    max-width: 760px;
    color: var(--portal-muted);
    font-size: 1.04rem;
    line-height: 1.7;
}

.hero-console {
    display: flex;
    min-height: 152px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    border-color: rgba(47, 128, 237, 0.18);
    background: #101820;
    color: #ffffff;
}

.hero-console span,
.hero-console small {
    color: rgba(255, 255, 255, 0.68);
}

.hero-console strong {
    display: block;
    margin: 8px 0;
    font-size: 1.18rem;
    line-height: 1.25;
}

.metric-grid,
.blueprint-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card,
.blueprint-card,
.panel-card {
    border: 1px solid var(--portal-line);
    border-radius: 10px;
    background: var(--portal-card);
    box-shadow: 0 14px 45px rgba(15, 23, 42, 0.06);
}

.metric-card {
    padding: 22px;
}

.metric-label {
    display: block;
    color: var(--portal-muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin: 8px 0 12px;
    color: var(--portal-ink);
    font-size: 2rem;
    line-height: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    margin-bottom: 24px;
}

.panel-card {
    padding: 24px;
    margin-bottom: 32px;
}

/* 网格内的卡片由网格 gap 控制间距，不叠加下外边距。 */
.dashboard-grid .panel-card,
.metric-grid .panel-card,
.blueprint-grid .panel-card {
    margin-bottom: 0;
}

.panel-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.panel-title h2,
.blueprint-card h2 {
    margin-bottom: 0;
    color: var(--portal-ink);
    font-size: 1.25rem;
}

.module-list,
.activity-list {
    display: grid;
    gap: 12px;
}

.module-row,
.activity-row,
.table-row,
.table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.module-row p,
.activity-row p {
    margin: 4px 0 0;
    color: var(--portal-muted);
}

.activity-row {
    grid-template-columns: auto minmax(0, 1fr);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #19a974;
    box-shadow: 0 0 0 5px rgba(25, 169, 116, 0.12);
}

.status-dot-muted {
    background: #9aa7b7;
    box-shadow: 0 0 0 5px rgba(154, 167, 183, 0.14);
}

.root-panel {
    margin-bottom: 24px;
}

.root-summary {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
}

.root-summary strong {
    display: block;
    margin: 8px 0;
    font-size: 1.5rem;
}

.root-summary p,
.root-feature small {
    color: var(--portal-muted);
}

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

.root-feature {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

.root-feature small {
    display: block;
    margin-top: 3px;
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.78rem;
}

.page-heading {
    margin-bottom: 24px;
}

.blueprint-card {
    min-height: 260px;
    padding: 24px;
}

.blueprint-index {
    display: inline-flex;
    margin-bottom: 28px;
    color: #2f80ed;
    font-weight: 800;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.operations-table {
    display: grid;
}

.operations-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 24px;
    margin-bottom: 24px;
}

.signal-list {
    display: grid;
    gap: 12px;
}

.signal-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.signal-card p {
    margin: 3px 0 0;
    color: var(--portal-muted);
}

.telemetry-card {
    background:
        linear-gradient(150deg, rgba(16, 24, 32, 0.96), rgba(20, 47, 75, 0.94)),
        var(--portal-card);
    color: #ffffff;
}

.telemetry-card h2,
.telemetry-card .eyebrow {
    color: #ffffff;
}

.telemetry-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.telemetry-list dt {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 800;
    text-transform: uppercase;
}

.telemetry-list dd {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

.telemetry-list code,
.audit-trace {
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.audit-trace {
    display: inline-flex;
    margin-top: 4px;
    padding: 0;
    border: 0;
    color: var(--portal-muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.audit-row {
    cursor: pointer;
}

.audit-row:hover {
    background: rgba(47, 128, 237, 0.04);
}

.audit-detail {
    padding: 18px 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(135deg, rgba(47, 128, 237, 0.06), rgba(25, 169, 116, 0.05)),
        rgba(255, 255, 255, 0.72);
}

.audit-detail dl {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px 18px;
    margin: 0;
}

.audit-detail dt {
    color: var(--portal-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.audit-detail dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--portal-ink);
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.86rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 24px;
}

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

.settings-form.compact {
    grid-template-columns: 1fr;
    margin-top: 18px;
}

.settings-form label {
    display: grid;
    gap: 7px;
}

.settings-form label span {
    color: var(--portal-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.settings-form select.ant-input {
    min-height: 34px;
    background: #ffffff;
}

.settings-help {
    color: var(--portal-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.logo-upload-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
    align-items: center;
    padding: 14px;
    border: 1px dashed rgba(47, 128, 237, 0.45);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(47, 128, 237, 0.08), rgba(25, 169, 116, 0.07)),
        rgba(255, 255, 255, 0.76);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.logo-upload-card:hover {
    border-color: #2f80ed;
    box-shadow: 0 12px 28px rgba(47, 128, 237, 0.12);
    transform: translateY(-1px);
}

.logo-upload-card .material-symbols-outlined {
    grid-row: span 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #101820;
    color: #7dd3fc;
    font-size: 1.25rem;
}

.logo-upload-card strong {
    color: var(--portal-ink);
    font-size: 0.94rem;
}

.logo-upload-card em {
    color: var(--portal-muted);
    font-size: 0.78rem;
    font-style: normal;
}

.logo-upload-card input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.color-picker-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.color-picker-row input[type="color"] {
    width: 44px;
    height: 34px;
    padding: 2px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.settings-form .wide {
    grid-column: 1 / -1;
}

.settings-textarea {
    min-height: 96px;
    resize: vertical;
}

.settings-save {
    margin-top: 20px;
}

.profile-preview {
    position: sticky;
    top: 24px;
    align-self: start;
    overflow: hidden;
}

.profile-preview::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 82% 12%, rgba(47, 128, 237, 0.18), transparent 34%),
        radial-gradient(circle at 10% 90%, rgba(25, 169, 116, 0.16), transparent 30%);
    content: "";
    pointer-events: none;
}

.profile-preview > * {
    position: relative;
    z-index: 1;
}

.preview-mark {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 22px 0 18px;
    place-items: center;
    border-radius: 16px;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 900;
    box-shadow: 0 18px 46px rgba(47, 128, 237, 0.28);
    overflow: hidden;
}

.preview-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-preview h2 {
    margin-bottom: 10px;
}

.profile-preview p,
.profile-preview dd {
    color: var(--portal-muted);
}

.profile-preview dl {
    display: grid;
    gap: 6px;
    margin: 20px 0 0;
}

.profile-preview dt {
    color: var(--portal-ink);
    font-weight: 800;
}

.profile-preview dd {
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.identity-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid rgba(47, 128, 237, 0.16);
    border-radius: 12px;
    background:
        radial-gradient(circle at 90% 10%, rgba(25, 169, 116, 0.14), transparent 30%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.94), rgba(240, 248, 255, 0.9));
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.07);
}

.identity-status h2 {
    margin: 6px 0 8px;
}

.identity-status p {
    margin: 0;
    color: var(--portal-muted);
}

.identity-status-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.identity-status-actions .ant-btn,
.header-actions .ant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.identity-card-icon {
    color: #2f80ed;
    font-size: 1.6rem;
}

.identity-form {
    display: grid;
    gap: 14px;
}

.compact-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.compact-form .wide {
    grid-column: 1 / -1;
}

.single-line-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.identity-form label {
    display: grid;
    gap: 6px;
}

.identity-form label span {
    color: #3e5f80;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.identity-form small,
.identity-muted {
    color: var(--portal-muted);
    line-height: 1.5;
}

.identity-message {
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.identity-message.success {
    border: 1px solid rgba(25, 169, 116, 0.28);
    background: rgba(25, 169, 116, 0.09);
    color: #127a54;
}

.identity-message.error {
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.08);
    color: #a42222;
}

.token-summary,
.token-summary dd {
    margin: 0;
}

.token-summary {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px 14px;
}

.token-summary dt {
    color: #3e5f80;
    font-weight: 900;
}

.token-summary dd {
    min-width: 0;
    color: var(--portal-muted);
    overflow-wrap: anywhere;
}

.token-box {
    min-height: 96px;
    margin-top: 16px;
    resize: vertical;
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.78rem;
}

.capability-list,
.iam-roadmap,
.iam-list,
.client-list {
    display: grid;
    gap: 14px;
}

.capability-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
}

.capability-row .material-symbols-outlined,
.iam-roadmap .material-symbols-outlined {
    color: #19a974;
}

.capability-row p,
.iam-roadmap p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    line-height: 1.55;
}

.client-row {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.iam-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.66);
}

.iam-row strong,
.iam-row span,
.iam-row small {
    display: block;
}

.iam-row span,
.iam-row small {
    color: var(--portal-muted);
}

.role-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.client-row span,
.client-row small {
    color: var(--portal-muted);
}

.iam-roadmap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.iam-roadmap article {
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(241, 248, 255, 0.72));
}

.iam-roadmap strong {
    display: block;
    margin-top: 10px;
}

.table-head,
.table-row {
    grid-template-columns: minmax(120px, 0.8fr) 92px minmax(0, 2fr);
}

.table-row .ant-tag {
    width: fit-content;
    min-width: 0;
}

.table-head {
    color: var(--portal-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #ffffff;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 1100px) {
    .hero-panel,
    .dashboard-grid,
    .operations-grid,
    .settings-grid,
    .identity-grid,
    .root-summary {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .blueprint-grid,
    .iam-roadmap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .hero-panel {
        padding: 22px;
    }

    .metric-grid,
    .blueprint-grid,
    .root-feature-grid,
    .settings-form,
    .compact-form,
    .single-line-form,
    .signal-card,
    .identity-status,
    .iam-row,
    .iam-roadmap,
    .audit-detail dl,
    .token-summary,
    .table-head,
    .table-row {
        grid-template-columns: 1fr;
    }

    .identity-status-actions {
        justify-content: flex-start;
    }
}

.identity-console {
    overflow: visible;
}

.identity-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -4px 0 20px;
}

.identity-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--portal-muted);
    cursor: pointer;
    font-weight: 800;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.identity-tab:hover,
.identity-tab.active {
    border-color: rgba(47, 128, 237, 0.34);
    background: linear-gradient(135deg, rgba(47, 128, 237, 0.12), rgba(25, 169, 116, 0.1));
    color: var(--portal-ink);
    transform: translateY(-1px);
}

.identity-tab .material-symbols-outlined {
    color: #2f80ed;
    font-size: 1.2rem;
}

.identity-workbench {
    display: grid;
    grid-template-columns: minmax(280px, 0.34fr) minmax(0, 0.66fr);
    gap: 22px;
    align-items: start;
}

.identity-list-panel,
.identity-detail-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    min-width: 0;
}

.identity-list-panel {
    overflow: visible;
    padding: 16px;
}

.identity-detail-panel {
    min-height: 520px;
    padding: 22px;
    background:
        radial-gradient(circle at 92% 4%, rgba(47, 128, 237, 0.08), transparent 30%),
        rgba(255, 255, 255, 0.76);
}

.identity-list-header,
.identity-detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.identity-list-header h2,
.identity-detail-title h2 {
    margin-bottom: 0;
}

.identity-search {
    margin-bottom: 14px;
}

.identity-list {
    display: grid;
    gap: 10px;
    overflow: visible;
    padding: 2px;
}

.identity-list-item {
    display: grid;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: #ffffff;
    color: var(--portal-ink);
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.identity-list-item:hover,
.identity-list-item.active {
    border-color: rgba(47, 128, 237, 0.36);
    box-shadow:
        inset 0 0 0 1px rgba(47, 128, 237, 0.18),
        0 10px 24px rgba(47, 128, 237, 0.1);
    transform: translateY(-1px);
}

.identity-list-item span,
.identity-list-item small {
    overflow: hidden;
    color: var(--portal-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity-detail-grid {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px 18px;
    margin: 0 0 24px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.identity-detail-grid dt {
    color: #3e5f80;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.identity-detail-grid dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.identity-subsection {
    margin-top: 22px;
}

.identity-subsection h3 {
    margin-bottom: 12px;
    color: var(--portal-ink);
    font-size: 1rem;
}

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

.permission-card,
.identity-mini-card {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
}

.permission-card span,
.permission-card small,
.identity-mini-card span,
.identity-mini-card small {
    color: var(--portal-muted);
    overflow-wrap: anywhere;
}

.identity-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
    border: 1px solid rgba(47, 128, 237, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.identity-edit-form button,
.identity-edit-form small {
    grid-column: 1 / -1;
}

.policy-code {
    max-height: 280px;
    overflow: auto;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #101820;
    color: #d9fbe8;
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.6;
}

.empty-detail {
    display: grid;
    min-height: 420px;
    place-content: center;
    justify-items: center;
    color: var(--portal-muted);
    text-align: center;
}

.empty-detail .material-symbols-outlined {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(47, 128, 237, 0.14), rgba(25, 169, 116, 0.12));
    color: #2f80ed;
    font-size: 2rem;
}

.empty-detail h2 {
    margin-bottom: 8px;
    color: var(--portal-ink);
}

@media (max-width: 1100px) {
    .identity-workbench {
        grid-template-columns: 1fr;
    }

    .identity-list {
        max-height: none;
    }
}

@media (max-width: 680px) {
    .identity-tabs,
    .permission-grid,
    .identity-card-list,
    .identity-edit-form,
    .identity-detail-grid {
        grid-template-columns: 1fr;
    }

    .identity-tab {
        width: 100%;
        justify-content: center;
    }
}

/* Keep mixed Ant buttons/tags visually centered inside action bars. */
.identity-status-actions > .ant-btn,
.identity-status-actions > .ant-tag,
.header-actions > .ant-btn,
.header-actions > .ant-tag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.identity-status-actions > .ant-btn,
.header-actions > .ant-btn {
    padding-inline: 15px !important;
}

.identity-status-actions > .ant-tag,
.header-actions > .ant-tag {
    padding-inline: 10px !important;
}

/* 门户左下角法务行 */
.portal-legal { margin-top: 28px; padding: 12px 2px; color: #94a3b8; font-size: 12px; text-align: left; }
.portal-legal a { color: #64748b; }


/* ==================== 移动端适配（门户内容层） ==================== */
@media (max-width: 768px) {
  body .portal-content { padding: 16px 12px 28px; }
  body .page-heading h1 { font-size: 1.5rem; }
  body .panel-title { flex-wrap: wrap; gap: 10px; }

  /* 统计行 / 费用行 / 简历统计：允许换行、收紧间距 */
  body .stat-row, body .fees-row, body .resume-stats, body .plan-current { flex-wrap: wrap; gap: 18px 28px; }

  /* 会员方案对比、捐赠双栏 → 单列 */
  body .plan-grid { grid-template-columns: 1fr !important; }
  body .donate-layout { grid-template-columns: 1fr !important; }

  /* AntD 表格横向滚动兜底 */
  body .ant-table { font-size: 13px; }
  body .ant-table th { white-space: nowrap; }

  /* 门户导航抽屉展开态（配合 MainLayout/NavMenu 的收起规则） */

  body .ant-table-content, body .ant-table-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 水平表单 → 垂直（Settings 等 LabelColSpan 布局） */
  body .ant-form .ant-form-item .ant-form-item-label,
  body .ant-form .ant-form-item .ant-form-item-control {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: left;
  }

  /* 弹窗不顶出屏幕 */
  body .ant-modal { max-width: calc(100vw - 24px) !important; margin: 8px auto; }

  /* Markdown 区块内表格可滚动 */
  body .md-body { overflow-x: auto; }

  /* 铭牌与名片 */
  body .lc-plaque { max-width: 100%; padding: 10px; }
  body .lc-plaque-frame { padding: 22px 18px 18px; }
  body .lc-plaque-name { font-size: 26px; }
  body .lc-plaque-foot { gap: 20px; flex-wrap: wrap; }
  body .lc-seal { width: 60px; height: 60px; right: 10px; bottom: 8px; }
  body .lc-card { width: 100%; max-width: 360px; }

  /* 简历页 */
  body .resume-header { flex-direction: column; gap: 14px; }

  /* 已签协议文书:签名区纵排 */
  body .signed-sig-row { flex-direction: column; gap: 18px; }
  body .signed-doc { padding: 18px 16px; }

  /* 项目详情领取卡 / 习作截图 */
  body .pc-claim-head { flex-wrap: wrap; }
  body .pc-shots img { width: 46vw; max-width: 148px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }

  /* 缴费期数胶囊、在线支付行 */
  body .period-pills { gap: 6px; }
  body .pay-online-row { flex-wrap: wrap; }

  /* 票券 / 二维码类弹窗内容自适应 */
  body .lc-card-qrtile img { width: 96px; height: 96px; }
}

/* 门户导航抽屉展开态：断点须与 MainLayout/NavMenu 的折叠断点（820px）一致，
   否则 769–820px 汉堡能点但菜单不出（死区）。 */
@media (max-width: 820px) {
  body.portal-nav-open .portal-menu { display: block !important; }
  body.portal-nav-open .portal-menu-group { display: block !important; }
  body.portal-nav-open .sider-legal { display: flex !important; }
}

/* -------- 报名表构建器 + 名册（Events 管理页） -------- */
.fb-field { border:1px solid #e2e8f0; border-radius:8px; padding:8px 10px; margin-bottom:8px; background:#f8fafc; }
.fb-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.fb-table { width:100%; border-collapse:collapse; font-size:13px; }
.fb-table th, .fb-table td { border:1px solid #e2e8f0; padding:6px 10px; text-align:left; white-space:nowrap; }
.fb-table th { background:#f1f5f9; font-weight:600; }
.fb-stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; margin-bottom:16px; }
.fb-stat { border:1px solid #e2e8f0; border-radius:8px; padding:10px 12px; }
.fb-stat-h { font-weight:600; margin-bottom:8px; font-size:13px; }
.fb-bar-row { display:flex; align-items:center; gap:8px; margin:4px 0; font-size:12px; }
.fb-bar-lbl { width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fb-bar { flex:1; height:8px; background:#e2e8f0; border-radius:4px; overflow:hidden; }
.fb-bar-fill { display:block; height:100%; background:#6366f1; }
.fb-bar-n { width:28px; text-align:right; color:#475569; }

/* -------- 活动创建/编辑弹窗：左右两栏 -------- */
.ev-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 28px; }
.ev-form-grid .ev-form-col { min-width:0; }
.ev-form-inline { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }
@media (max-width:760px) {
    .ev-form-grid { grid-template-columns:1fr; gap:0; }
}

/* -------- 活动列表：标题跳转公开页 -------- */
.ev-row-link { color:#2563eb; text-decoration:none; }
.ev-row-link:hover { text-decoration:underline; }
.ev-row-ext { font-size:11px; opacity:.55; }

/* ===== 全局 Markdown 排版（项目简介等富文本区块）===== */
.md-body { line-height: 1.75; }
.md-body > :first-child { margin-top: 0; }
.md-body h1 { font-size: 20px; margin: 14px 0 8px; font-weight: 700; }
.md-body h2 { font-size: 17px; margin: 14px 0 7px; font-weight: 700; }
.md-body h3 { font-size: 15px; margin: 12px 0 6px; font-weight: 600; }
.md-body p { margin: 0 0 10px; }
.md-body ul, .md-body ol { margin: 0 0 10px; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body strong { font-weight: 700; }
.md-body a { color: #0055e5; text-decoration: underline; }
.md-body blockquote { margin: 0 0 10px; padding: 6px 14px; border-left: 3px solid #cbd5e1; color: #475569; background: #f8fafc; border-radius: 0 8px 8px 0; }
.md-body code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
.md-body pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.md-body hr { border: 0; border-top: 1px solid #e2e8f0; margin: 14px 0; }
.md-body table { border-collapse: collapse; margin: 0 0 10px; }
.md-body th, .md-body td { border: 1px solid #e2e8f0; padding: 4px 10px; }

/* 列表卡片里的简介只做 3 行摘要，保持网格整齐 */
.md-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.md-clamp > * { margin-bottom: 0 !important; }
