/* 主题变量：浅色（默认）与深蓝（html.dark）两套，切换时只需覆盖变量 */
:root {
    --brand-indigo: #4F46E5;
    --brand-sky: #0EA5E9;
    --brand-grad: linear-gradient(120deg, #4F46E5 0%, #6366F1 45%, #0EA5E9 100%);
    --ink: #1F2937;
    --ink-soft: #64748B;
    --line: #EEF1F6;
    --page-bg: #F4F6FB;
    --page-bg-grad: linear-gradient(180deg, #F7F9FE 0%, #EEF2F9 100%);
    --glow-1: rgba(79, 70, 229, 0.10);
    --glow-2: rgba(14, 165, 233, 0.10);
    --card-bg: #FFFFFF;
    --card-bg-alt: #F8FAFC;
    --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    --card-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --brand-shadow: 0 6px 22px rgba(79, 70, 229, 0.30);
    --brand-shadow-sm: 0 8px 18px rgba(79, 70, 229, 0.28);
    --brand-tint: rgba(79, 70, 229, 0.12);
    --brand-tint-soft: rgba(79, 70, 229, 0.07);
    --brand-tint-strong: rgba(79, 70, 229, 0.14);
    --brand-tint-fade: rgba(79, 70, 229, 0.04);
    --on-brand: #FFFFFF;
    --stat-sky-bg: rgba(14, 165, 233, 0.12);
    --stat-green-bg: rgba(22, 163, 74, 0.12);
    --stat-green-fg: #16A34A;
    --stat-amber-bg: rgba(217, 119, 6, 0.12);
    --stat-amber-fg: #D97706;
    --blob-1: #818CF8;
    --blob-2: #38BDF8;
    --overlay-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    --modal-shadow: 0 30px 70px rgba(15, 23, 42, 0.35);
    --scrollbar: #CBD5E1;
    --scrollbar-hover: #94A3B8;
}

/* ===== 深蓝主题（Intel 风格） ===== */
html.dark {
    --brand-indigo: #1E9FE0;
    --brand-sky: #38BDF8;
    --brand-grad: linear-gradient(120deg, #0A2540 0%, #123A5E 45%, #1E9FE0 100%);
    --ink: #E8F1FA;
    --ink-soft: #8FA8C0;
    --line: rgba(255, 255, 255, 0.10);
    --page-bg: #0D1B2E;
    --page-bg-grad: linear-gradient(180deg, #0D1B2E 0%, #081F38 100%);
    --glow-1: rgba(30, 159, 224, 0.18);
    --glow-2: rgba(56, 189, 248, 0.12);
    --card-bg: #162E47;
    --card-bg-alt: #1B3A5C;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --card-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
    --brand-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
    --brand-shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.40);
    --brand-tint: rgba(30, 159, 224, 0.20);
    --brand-tint-soft: rgba(30, 159, 224, 0.12);
    --brand-tint-strong: rgba(30, 159, 224, 0.24);
    --brand-tint-fade: rgba(30, 159, 224, 0.06);
    --on-brand: #FFFFFF;
    --stat-sky-bg: rgba(56, 189, 248, 0.18);
    --stat-green-bg: rgba(52, 211, 153, 0.18);
    --stat-green-fg: #34D399;
    --stat-amber-bg: rgba(251, 191, 36, 0.18);
    --stat-amber-fg: #FBBF24;
    --blob-1: #1E9FE0;
    --blob-2: #38BDF8;
    --overlay-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --modal-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
    --scrollbar: #33506E;
    --scrollbar-hover: #4A6E93;
}

html, body {
    font-family: "Roboto", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    background: var(--page-bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 全局背景：纯色（页面上下一致，无渐变/光晕色差） */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--page-bg);
}

/* ===== 顶栏渐变 ===== */
.appbar-gradient {
    background: var(--brand-grad) !important;
    color: var(--on-brand) !important;
    box-shadow: var(--brand-shadow) !important;
    backdrop-filter: saturate(140%);
}

.brand-title {
    font-weight: 600;
    letter-spacing: .5px;
}

.user-name {
    font-weight: 500;
}

/* ===== 侧边栏品牌区 ===== */
.app-drawer .mud-drawer-content {
    background: var(--card-bg);
    box-shadow: 2px 0 24px rgba(15, 23, 42, 0.05);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    margin: 16px 14px 8px;
    border-radius: 16px;
    background: var(--brand-grad);
    color: var(--on-brand);
    box-shadow: var(--brand-shadow);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.brand-name {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.15;
}

.brand-sub {
    font-size: 11px;
    opacity: .85;
    letter-spacing: .5px;
}

/* ===== 导航 ===== */
.app-nav {
    padding: 8px 12px 12px;
}

.app-nav .mud-nav-link {
    border-radius: 12px;
    margin-bottom: 6px;
    padding: 10px 14px;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.app-nav .mud-nav-link.active {
    background: linear-gradient(90deg, var(--brand-tint-strong), var(--brand-tint-fade)) !important;
    color: var(--brand-indigo) !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand-indigo);
}

.app-nav .mud-nav-link:hover {
    background: var(--brand-tint-soft) !important;
}

.app-nav .mud-nav-link .mud-nav-link-icon {
    margin-right: 12px;
}

/* 导航分组标题：分区小标题风格 */
.app-nav .mud-nav-group-item {
    margin-top: 12px;
    padding: 14px 14px 6px;
    text-transform: uppercase;
    letter-spacing: .8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft);
}

.app-nav .mud-nav-group-item .mud-nav-link-icon {
    color: var(--ink-soft);
    font-size: 18px;
    margin-right: 8px;
}

/* ===== 页面标题 ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.page-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-grad);
    color: var(--on-brand);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.32);
    flex-shrink: 0;
}

html.dark .page-header-icon {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.40);
}

.page-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.page-header-title {
    font-weight: 700 !important;
    letter-spacing: .3px;
}

.page-header-sub {
    margin-top: 2px;
}

/* ===== 概览数据卡片 ===== */
.stat-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px !important;
    background: var(--card-bg);
    transition: transform .22s ease, box-shadow .22s ease;
    box-shadow: var(--card-shadow-sm);
}

.stat-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-indigo), var(--brand-sky));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(79, 70, 229, 0.16) !important;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.indigo { background: var(--brand-tint); color: var(--brand-indigo); }
.stat-icon.sky    { background: var(--stat-sky-bg); color: var(--brand-sky); }
.stat-icon.green  { background: var(--stat-green-bg); color: var(--stat-green-fg); }
.stat-icon.amber  { background: var(--stat-amber-bg); color: var(--stat-amber-fg); }

.stat-value {
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(120deg, var(--brand-indigo), var(--brand-sky));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ===== 通用面板卡片 ===== */
.table-card,
.panel-card,
.filter-card {
    border-radius: 18px !important;
    border: 1px solid var(--line);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* 页面顶部筛选/表单卡片（内联描边样式统一走这里，便于主题切换） */
.filter-card {
    border-radius: 16px !important;
    overflow: visible;
}

/* ===== 表格 ===== */
.table-card .mud-table {
    background: transparent;
}

.table-card .mud-table-head .mud-table-cell {
    background: var(--card-bg-alt);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

.table-card .mud-table-row {
    transition: background .15s ease;
}

/* ===== 按钮微交互 ===== */
.mud-button-filled {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22) !important;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.mud-button-filled:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: var(--brand-shadow-sm) !important;
}

/* ===== 表格操作区 ===== */
.row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.row-actions .mud-icon-button {
    border-radius: 50%;
    transition: transform .15s ease, background .15s ease;
}

.row-actions .mud-icon-button:hover {
    background: var(--brand-tint-soft);
    transform: scale(1.12);
}

.row-actions .mud-icon-button.mud-disabled {
    opacity: .35;
}

/* ===== 状态点标签（替代 MudChip，更精致） ===== */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.status-success { color: #16a34a; background: rgba(22, 163, 74, 0.12); border-color: rgba(22, 163, 74, 0.22); }
.status-warning { color: #d97706; background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.22); }
.status-error   { color: #dc2626; background: rgba(220, 38, 38, 0.12); border-color: rgba(220, 38, 38, 0.22); }
.status-muted   { color: var(--ink-soft); background: rgba(100, 116, 139, 0.12); border-color: rgba(100, 116, 139, 0.20); }

html.dark .status-dot::before { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }

@media (max-width: 640px) {
    .build-tag { display: none !important; }
}

/* ===== 模态 / 弹窗卡片 ===== */
.mud-overlay .mud-paper {
    box-shadow: var(--overlay-shadow) !important;
}

/* ===== 登录页 ===== */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(1100px 720px at 12% -10%, rgba(79, 70, 229, 0.22), transparent 60%),
        radial-gradient(1000px 640px at 108% 16%, rgba(14, 165, 233, 0.18), transparent 55%),
        radial-gradient(900px 900px at 50% 122%, rgba(99, 102, 241, 0.14), transparent 62%),
        linear-gradient(135deg, #eef3ff 0%, #e9f1ff 50%, #f4f8ff 100%);
}

/* 科技感细网格（中心浓、边缘淡出） */
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 38%, transparent 100%);
    mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 38%, transparent 100%);
}

.login-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-page .login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    z-index: 0;
}

.login-page .login-blob-1 {
    width: 420px;
    height: 420px;
    background: var(--blob-1);
    top: -110px;
    left: -70px;
}

.login-page .login-blob-2 {
    width: 360px;
    height: 360px;
    background: var(--blob-2);
    bottom: -120px;
    right: -60px;
}

.login-page .login-blob-3 {
    width: 300px;
    height: 300px;
    background: var(--brand-indigo);
    top: 42%;
    left: 58%;
    opacity: .32;
}

/* ===== 深蓝主题登录页 ===== */
html.dark .login-page {
    background:
        radial-gradient(1100px 720px at 12% -10%, rgba(30, 159, 224, 0.30), transparent 60%),
        radial-gradient(1000px 640px at 108% 16%, rgba(56, 189, 248, 0.22), transparent 55%),
        radial-gradient(900px 900px at 50% 122%, rgba(14, 165, 233, 0.18), transparent 62%),
        linear-gradient(135deg, #0a1626 0%, #0d2238 50%, #0a1424 100%);
}

html.dark .login-page::before {
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
}

html.dark .login-page .login-blob {
    opacity: .45;
}

.login-card {
    position: relative;
    overflow: hidden;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    border-radius: 22px !important;
    background: var(--card-bg);
    color: var(--ink);
    box-shadow: 0 18px 50px rgba(79, 70, 229, 0.18), var(--modal-shadow) !important;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-grad);
}

.login-brand {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-grad);
    color: var(--on-brand);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35);
}

html.dark .login-brand {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.login-title {
    font-weight: 700;
    text-align: center;
}

.login-card .mud-typography-h5 {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: .5px;
}

.login-card .mud-button-filled {
    background: var(--brand-grad) !important;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.35) !important;
}

/* ===== 登录页验证码行：输入框 → 验证码图 → 刷新 + 倒计时 ===== */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-row .mud-input-control {
    flex: 1;
    min-width: 0;
}

.captcha-img {
    height: 56px;
    width: 132px;
    flex: 0 0 auto;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}

.captcha-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 44px;
}

.captcha-countdown {
    font-variant-numeric: tabular-nums;
    color: var(--brand-indigo);
    line-height: 1.1;
}

.captcha-expiring { color: #D97706; }
.captcha-expired  { color: #DC2626; font-weight: 600; }

/* ===== 登录页右上角 风格（浅色 / 深蓝）切换 ===== */
.login-theme-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card-bg-alt);
    border: 1px solid rgba(100, 116, 139, 0.28);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.10);
    color: var(--ink-soft);
    opacity: 0.85;
    transition: opacity .15s ease, background .15s ease;
    cursor: pointer;
}

.login-theme-toggle:hover {
    opacity: 1;
    background: var(--card-bg);
}

.login-theme-toggle .mud-icon-button {
    color: inherit;
}

.login-theme-toggle .mud-icon-button:hover {
    background: rgba(100, 116, 139, 0.16);
}

html.dark .login-theme-toggle {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

@media (max-width: 420px) {
    .captcha-img { width: 112px; }
}

/* ===== 柱状图（零依赖，纯 HTML/CSS） ===== */
.bar-chart {
    width: 100%;
}

.bar-chart-body {
    position: relative;
    height: 240px;
    margin-left: 46px;
}

.bar-chart-grid {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bar-chart-gridline {
    position: relative;
    border-top: 1px dashed var(--line);
}

.bar-chart-gridline span {
    position: absolute;
    left: -46px;
    top: -8px;
    width: 40px;
    text-align: right;
    font-size: 11px;
    color: var(--ink-soft);
}

.bar-chart-bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.bar-col {
    flex: 1 1 0;
    min-width: 2px;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    position: relative;
    cursor: default;
    width: 70%;
    max-width: 20px;
    margin: 0 auto;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, var(--brand-sky), var(--brand-indigo));
    transition: filter .15s ease, transform .15s ease;
}

.bar-fill::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    background: var(--ink);
    color: var(--card-bg);
    font-size: 11px;
    line-height: 1.4;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 6;
}

.bar-fill:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bar-col:hover .bar-fill {
    filter: brightness(1.18);
    transform: translateY(-2px);
}

.bar-chart-axis {
    display: flex;
    gap: 2px;
    margin: 6px 0 0 46px;
}

.bar-axis-label {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    font-size: 10px;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
}

.bar-chart-empty {
    padding: 60px 0;
    text-align: center;
    color: var(--ink-soft);
}

/* ===== 表格空状态 ===== */
.table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 56px 16px;
    text-align: center;
}

.table-empty-icon {
    color: var(--ink-soft);
    opacity: .45;
    animation: emptyFloat 3.5s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.table-empty-title {
    font-weight: 600;
    color: var(--ink);
}

.table-empty-hint {
    max-width: 320px;
}

/* 日期选择弹出面板：宽度按内容自适应（范围选择器并排两个月自动加宽），避免被父容器压缩变形 */
.mud-picker-popover-paper,
.mud-picker-container,
.mud-picker-content {
    width: max-content !important;
    max-width: 96vw !important;
    min-width: 330px !important;
}

/* 范围选择头部日期文字过大导致换行，缩小为一行显示 */
.mud-picker-datepicker-toolbar .mud-button-date {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    white-space: nowrap;
}

.mud-picker-datepicker-toolbar {
    height: auto !important;
    padding: 10px 12px !important;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* 隐藏滚动条两端箭头按钮（Windows 默认显示为多余色块） */
::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* 表格横向滚动条更低调：细、淡、胶囊 */
.mud-table-container::-webkit-scrollbar {
    height: 8px;
}
.mud-table-container::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.30);
    border-radius: 999px;
}
.mud-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.50);
}

/* ===== 主内容区透明，露出 body::before 的全局渐变与光晕 ===== */
.mud-main-content {
    background: transparent !important;
}

.mono-text {
    font-family: Consolas, "Courier New", monospace;
    word-break: break-all;
}

/* ===== 表格自动列宽：列不挤压，放不下时整表横向滚动 ===== */
.table-autofit .mud-table-container {
    overflow-x: auto;
}

.table-autofit table.mud-table-root {
    table-layout: fixed;
    min-width: 1080px;
}

.table-autofit .mud-table-cell {
    white-space: nowrap;
}

/* 表格内等宽文本（公钥/私钥/标识等）：填满单元格内容盒并省略，
   不用固定像素限宽（fixed 布局下列宽随视口变化，固定值会溢出压到相邻列） */
.table-autofit td .mono-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

/* 原地址列：单行省略号，悬停 tooltip 显示全量 */
.table-autofit td:nth-child(2) .mono-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

/* ===== 自定义弹窗（MudOverlay + MudPaper）=====
   不改 MudOverlay 根元素（其根 div 同时承载背景层与内容，外部样式会破坏布局）；
   弹窗纸自身 fixed + translate 相对视口绝对居中，超高时内部滚动 */
.modal-sheet {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== 弹窗头部品牌色条 ===== */
.dialog-head {
    position: relative;
    padding-left: 14px;
}
.dialog-head::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    border-radius: 4px;
    background: var(--brand-grad);
}

/* ===== 密钥 / 代码展示块 ===== */
.code-block {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-bg-alt);
    overflow: hidden;
}
.code-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px 7px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.03);
}
html.dark .code-block-head {
    background: rgba(255, 255, 255, 0.04);
}
.code-block-head .code-block-label {
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--ink-soft);
}
.code-block-body {
    margin: 0;
    padding: 10px 12px;
    max-height: 160px;
    overflow: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--ink);
}

/* ===== 表格斑马纹（偶数行底色，奇偶区分） ===== */
.mud-table-body .mud-table-row:nth-child(even) {
    background: rgba(15, 23, 42, 0.045);
}
html.dark .mud-table-body .mud-table-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== 表格行 hover 品牌色 ===== */
.table-card .mud-table-row:hover {
    background: rgba(79, 70, 229, 0.06) !important;
}
html.dark .table-card .mud-table-row:hover {
    background: rgba(56, 189, 248, 0.10) !important;
}

/* ===== 分页器 ===== */
.mud-table-pagination {
    background: transparent !important;
    padding: 0 !important;
    border-top: none !important;
}
.mud-table-pagination .mud-table-pagination-toolbar {
    border-top: 1px solid var(--line);
    background: transparent;
    padding: 10px 16px;
}
.mud-table-pagination .mud-pagination {
    gap: 4px;
}
.mud-table-pagination .mud-pagination-item .mud-button {
    border-radius: 8px !important;
    background: transparent !important;
}
.mud-table-pagination .mud-pagination-item.mud-selected .mud-button {
    background: var(--brand-tint) !important;
    color: var(--brand-indigo) !important;
    font-weight: 600;
}

/* ===== Snackbar 品牌化 ===== */
.mud-snackbar {
    border-radius: 12px !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18) !important;
}
html.dark .mud-snackbar {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}

/* ===== Tooltip 美化 ===== */
.mud-tooltip {
    border-radius: 10px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22) !important;
    font-size: 12px;
}

/* ===== 登录页输入框聚焦光环 ===== */
.login-card .mud-field {
    transition: box-shadow .15s ease;
}
.login-card .mud-field:focus-within {
    box-shadow: 0 0 0 3px var(--brand-tint);
    border-radius: 8px;
}

/* ===== 详情只读字段（标签-值块） ===== */
.kv {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-bg-alt);
}
.kv-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .4px;
    color: var(--ink-soft);
    text-transform: uppercase;
}

/* 表单字段上方的样例/提示说明 */
.field-hint {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-soft);
}
.field-hint::before {
    content: "样例：";
    color: var(--brand-indigo);
    font-weight: 600;
}
.kv-value {
    font-size: 14px;
    color: var(--ink);
    word-break: break-all;
}

/* ===== MudAlert 左色条 + 圆角 ===== */
.mud-alert {
    border-radius: 12px !important;
    border-left: 4px solid currentColor !important;
}

/* ===== 页面切换淡入动画 =====
   注意：不能用 fill-mode: both/forwards——动画填充会让元素长期保留合成层，
   成为 fixed 后代（弹窗遮罩）的包含块，导致遮罩盖不住顶栏、弹窗无法相对视口居中 */
.route-fade {
    animation: routeFade .30s ease;
}
@keyframes routeFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ===== 按钮统一圆角 / 阴影 / hover 抬升 ===== */
.mud-button-root {
    border-radius: 10px !important;
    text-transform: none !important;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.mud-button-root.mud-button-filled {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}
.mud-button-root.mud-button-filled:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.20);
}
.mud-button-root.mud-button-outlined:hover,
.mud-button-root.mud-button-text:hover {
    transform: translateY(-1px);
}
html.dark .mud-button-root.mud-button-filled {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.40);
}
html.dark .mud-button-root.mud-button-filled:hover {
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.50);
}

/* ===== 进度条品牌化 ===== */
.mud-progress-linear {
    border-radius: 999px !important;
    overflow: hidden;
}
.mud-progress-linear-bar {
    background: var(--brand-grad) !important;
}

/* ===== 导航品牌区图标微动 + 导航项图标过渡 ===== */
.brand-logo {
    transition: transform .25s ease;
}
.brand-header:hover .brand-logo {
    transform: rotate(-8deg) scale(1.06);
}
.app-nav .mud-nav-link .mud-nav-link-icon {
    transition: transform .18s ease, color .18s ease;
}
.app-nav .mud-nav-link:hover .mud-nav-link-icon {
    transform: translateX(2px);
}

/* ===== ApiDebug 结果终端块（pre 代码块，无输入框边框/预留空间） ===== */
pre.api-result {
    display: block;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    padding: 12px 14px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 420px;
    overflow: auto;
}
html.dark pre.api-result {
    background: #0b1220;
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.2);
}

/* 点击聚焦时的聚焦框：与输入框聚焦下划线同色（主题主色），紧贴块缘 */
pre.api-result:focus {
    outline: none;
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.28);
}

html.dark pre.api-result:focus {
    box-shadow: 0 0 0 3px rgba(30, 159, 224, 0.32);
}

/* ===== 角色权限编辑器分组 ===== */
.permission-editor .mud-typography-subtitle2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 8px;
    color: var(--brand-indigo);
    text-transform: uppercase;
    letter-spacing: .6px;
    font-size: 12px;
    font-weight: 700;
}
.permission-editor .mud-typography-subtitle2::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand-grad);
}
.permission-editor .d-flex.flex-wrap {
    background: var(--card-bg-alt);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}

/* ===== 分页器内部控件背景统一（消除色块） ===== */
.mud-table-pagination .mud-toolbar,
.mud-table-pagination .mud-input-control,
.mud-table-pagination .mud-input,
.mud-table-pagination .mud-icon-button {
    background: transparent !important;
}
.mud-table-pagination .mud-icon-button:hover {
    background: var(--brand-tint-soft) !important;
}

/* ===== 表单输入聚焦柔光（统一 focus 态） ===== */
.mud-field:focus-within {
    box-shadow: 0 0 0 3px var(--brand-tint);
    border-radius: 8px;
    transition: box-shadow .15s ease;
}

/* ===== 错误态：红光环 + 加粗错误提示（Error 属性 / MudForm 校验） ===== */
.mud-input-control.mud-input-error:focus-within {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
    border-radius: 8px;
}
.mud-input-error .mud-input-helper-text {
    font-weight: 600;
}

/* ===== HelperText 提示文字精致化 ===== */
.mud-input-helper-text {
    font-size: 12px !important;
    letter-spacing: .2px;
    color: var(--ink-soft) !important;
    margin-top: 4px !important;
}
