/* ===========================================================================
   用户系统页面专属样式 (User System page specific styles)
   - 仅承载登录 / 租户选择 / 邀请接受 / 无权限 / Super Admin Console /
     Admin Users / API Keys / 审计日志 / 个人资料 / 修改密码 等页面独有的
     视觉规则。
   - 视觉基线沿用业务页面：紫色主渐变 (#667eea -> #764ba2)、16px 圆角
     卡片、柔和阴影、Font Awesome 图标、Bootstrap 5 组件外观。
   - 所有选择器统一以 `.us-` 前缀命名，严格避开 orders-styles.css、
     kpi-styles.css、modal-styles.css 已有选择器，绝不覆盖业务页样式。
   =========================================================================== */

/* ---------------------------------------------------------------------------
   顶部导航栏（envita 风格，用于用户管理页面）
   --------------------------------------------------------------------------- */
.us-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    background: #eee9e4;
    border-bottom: 1px solid #d9d4ce;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.us-topbar-left {
    flex: 1;
}

.us-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1f2937;
}

.us-topbar-brand:hover {
    text-decoration: none;
    color: #1f2937;
}

.us-topbar-brand-icon {
    font-size: 20px;
    color: #2d9f93;
}

.us-topbar-brand-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.us-topbar-center {
    flex: 1;
    text-align: center;
}

.us-topbar-title {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.us-topbar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.us-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.us-topbar-username {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.us-topbar-email {
    font-size: 12px;
    color: #6b7280;
}

.us-topbar-avatar {
    font-size: 28px;
    color: #9ca3af;
    margin-left: 4px;
}

/* ---------------------------------------------------------------------------
   布局骨架
   --------------------------------------------------------------------------- */
.us-page {
    margin: 0;
    min-height: 100vh;
    background: #f5f3ef;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    color: #1f2937;
}

.us-layout {
    display: flex;
    min-height: 100vh;
}

.us-layout-no-sidebar {
    justify-content: center;
}

.us-main {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.us-main-full {
    max-width: 960px;
    margin: 0 auto;
}

.us-main-inner {
    padding: 24px 32px 48px;
    max-width: 1280px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .us-main-inner {
        padding: 16px;
    }
}

/* ---------------------------------------------------------------------------
   侧边栏
   --------------------------------------------------------------------------- */
.us-sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: #e0e7ff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.us-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.us-sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.us-sidebar-brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.us-sidebar-brand-sub {
    font-size: 11px;
    color: #a5b4fc;
    margin-top: 2px;
}

.us-sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.us-nav-group {
    margin-bottom: 8px;
}

.us-nav-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #818cf8;
    padding: 8px 20px 4px;
}

.us-nav-link {
    display: flex;
    align-items: center;
    padding: 9px 20px;
    color: #c7d2fe;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
}

.us-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   会话面板（侧边栏底部）
   - 默认样式适配 Dash 白色侧边栏（传感器监控中心）
   - 深色侧边栏（用户系统页面 .us-sidebar 内）通过后续覆盖规则适配
   --------------------------------------------------------------------------- */
.us-session-panel {
    border-top: 2px solid rgba(45, 159, 147, 0.15);
    padding: 16px;
    margin-top: auto;
}

.us-session-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.us-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2d9f93;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.us-session-email {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.us-session-meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.us-session-tenant {
    max-width: 100px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.us-session-sep {
    margin: 0 4px;
}

.us-session-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.us-session-link {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.us-session-link:hover {
    background: rgba(45, 159, 147, 0.08);
    color: #1a7a70;
    text-decoration: none;
}

.us-session-link-danger {
    color: #dc2626;
}

.us-session-link-danger:hover {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
}

/* 深色侧边栏内的会话面板覆盖（用户系统页面） */
.us-sidebar .us-session-panel {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.us-sidebar .us-session-email {
    color: #fff;
}

.us-sidebar .us-session-meta {
    color: #a5b4fc;
}

.us-sidebar .us-session-link {
    color: #c7d2fe;
}

.us-sidebar .us-session-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.us-sidebar .us-session-link-danger {
    color: #fca5a5;
}

.us-sidebar .us-session-link-danger:hover {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.1);
}

/* ---------------------------------------------------------------------------
   侧边栏滚动条（覆盖全局紫色样式，改为白灰色 + 不滚动时隐藏）
   --------------------------------------------------------------------------- */
#sidebar {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s;
}

#sidebar:hover {
    scrollbar-color: #d1d5db transparent;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.3s;
}

#sidebar:hover::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ---------------------------------------------------------------------------
   Hero 区块
   --------------------------------------------------------------------------- */
.us-hero {
    background: #2d9f93;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.us-hero-body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.us-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.us-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.us-hero-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 4px 0 0;
}

.us-hero-actions .btn {
    border-radius: 8px;
}

/* ---------------------------------------------------------------------------
   Flash 消息
   --------------------------------------------------------------------------- */
.us-flash {
    margin-bottom: 16px;
}

.us-flash-item {
    display: flex;
    align-items: center;
    border-radius: 10px;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------------------
   通用卡片
   --------------------------------------------------------------------------- */
.us-card {
    background: #fff;
    border-radius: 16px;
    border: none;
    overflow: hidden;
}

.us-card-body {
    padding: 24px;
}

.us-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.us-card-warning {
    border-left: 4px solid #f59e0b;
}

.us-card-success {
    border-left: 4px solid #10b981;
}

.us-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
}

/* ---------------------------------------------------------------------------
   Stats Strip
   --------------------------------------------------------------------------- */
.us-stats-strip {
    margin-bottom: 24px;
}

.us-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.us-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.us-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.us-stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.us-stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   角色与状态徽章
   --------------------------------------------------------------------------- */
.us-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.us-badge-super_admin {
    background: rgba(45, 159, 147, 0.12);
    color: #1a7a70;
}

.us-badge-admin {
    background: rgba(79, 172, 254, 0.12);
    color: #0369a1;
}

.us-badge-viewer {
    background: rgba(17, 153, 142, 0.12);
    color: #0f766e;
}

.us-badge-unknown {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
}

.us-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.us-status-active {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.us-status-disabled {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.us-status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.us-status-accepted {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.us-status-revoked {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.us-status-expired {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
}

.us-status-unknown {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
}

/* ---------------------------------------------------------------------------
   表格
   --------------------------------------------------------------------------- */
.us-users-table th,
.us-invitations-table th,
.us-audit-table th,
.us-api-keys-table th {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 14px;
    white-space: nowrap;
}

.us-users-table td,
.us-invitations-table td,
.us-audit-table td,
.us-api-keys-table td {
    padding: 12px 14px;
    font-size: 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.us-row-self {
    background: rgba(102, 126, 234, 0.04);
}

.us-self-label {
    font-size: 12px;
    font-style: italic;
}

.us-actions-cell {
    white-space: nowrap;
}

.us-actions-cell .btn {
    margin: 2px;
}

/* ---------------------------------------------------------------------------
   筛选条
   --------------------------------------------------------------------------- */
.us-filter-card .card-body {
    padding: 16px 20px;
}

.us-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.us-filter-field {
    flex: 1;
    min-width: 140px;
}

.us-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.us-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .us-filter-bar {
        flex-direction: column;
    }
    .us-filter-field {
        min-width: 100%;
    }
}

/* ---------------------------------------------------------------------------
   空状态
   --------------------------------------------------------------------------- */
.us-empty-state {
    padding: 48px 24px;
}

.us-empty-icon {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.us-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.us-empty-hint {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 16px;
}

/* ---------------------------------------------------------------------------
   确认对话框
   --------------------------------------------------------------------------- */
.us-confirm-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: calc(100vw - 32px);
}

.us-confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.us-confirm-dialog-form {
    padding: 24px;
}

.us-confirm-dialog-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.us-confirm-dialog-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px;
}

.us-confirm-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------------------------------------------------------------------------
   一次性密钥展示
   --------------------------------------------------------------------------- */
.us-secret-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
}

.us-secret-value {
    font-size: 14px;
    word-break: break-all;
    color: #1e293b;
}

.us-copy-button[data-copied="true"] .us-copy-label {
    display: none;
}

.us-copy-button[data-copied="true"] .us-copy-done {
    display: inline !important;
}

/* ---------------------------------------------------------------------------
   登录页（envita 风格）
   --------------------------------------------------------------------------- */
.us-login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f3ef;
    padding: 20px;
}

.us-login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.us-login-brand-icon {
    font-size: 28px;
    color: #2d9f93;
}

.us-login-brand-text {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.5px;
}

.us-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.us-login-alert {
    border-radius: 8px;
    margin-bottom: 20px;
}

.us-login-field {
    margin-bottom: 20px;
}

.us-login-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.us-login-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.us-login-input:focus {
    border-color: #2d9f93;
    box-shadow: 0 0 0 3px rgba(45, 159, 147, 0.1);
}

.us-login-input::placeholder {
    color: #9ca3af;
}

.us-login-password-wrap {
    position: relative;
}

.us-login-password-wrap .us-login-input {
    padding-right: 44px;
}

.us-login-eye-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.us-login-eye-btn:hover {
    color: #374151;
}

.us-login-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 24px;
    background: #2d9f93;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}

.us-login-submit-btn:hover {
    background: #268a80;
}

.us-login-submit-btn:active {
    transform: scale(0.98);
}

.us-login-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.us-login-help {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-top: 20px;
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .us-login-card {
        padding: 24px 20px;
    }
}

/* 登录页整体背景覆盖 */
.us-page[data-page-id="login"] {
    background: #f5f3ef;
}

.us-page[data-page-id="login"] .us-main-inner {
    padding: 0;
}

/* ---------------------------------------------------------------------------
   租户选择页
   --------------------------------------------------------------------------- */
.us-tenant-grid {
    margin-bottom: 16px;
}

.us-tenant-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.us-tenant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.us-tenant-name {
    font-size: 16px;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   个人资料 / 修改密码
   --------------------------------------------------------------------------- */
.us-profile-wrapper,
.us-change-password-wrapper {
    display: flex;
    justify-content: center;
}

.us-profile-card,
.us-change-password-card {
    width: 100%;
    max-width: 520px;
}

.us-password-hint {
    min-height: 20px;
}

/* ---------------------------------------------------------------------------
   审计日志
   --------------------------------------------------------------------------- */
.us-audit-time {
    font-size: 13px;
    color: #6b7280;
}

.us-action-code {
    font-size: 12px;
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
}

.us-badge-high-risk {
    font-size: 11px;
}

.us-metadata-details {
    font-size: 12px;
}

.us-metadata-summary {
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
}

.us-metadata-pre {
    font-size: 11px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    margin-top: 6px;
    max-width: 300px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------------------------------------------------------------------------
   分页
   --------------------------------------------------------------------------- */
.us-pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: #6b7280;
}

.us-pagination .page-item.active .page-link {
    background: #2d9f93;
    border: none;
}

/* ---------------------------------------------------------------------------
   按钮
   --------------------------------------------------------------------------- */
.us-btn-primary {
    background: #2d9f93;
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.1s;
}

.us-btn-primary:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
    background: #268a80;
}

.us-confirm-btn {
    font-size: 12px;
}

.us-confirm-btn-danger {
    font-size: 12px;
}

/* ---------------------------------------------------------------------------
   模态框
   --------------------------------------------------------------------------- */
.us-modal-content {
    border-radius: 16px;
    border: none;
}

.us-modal-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 20px 24px;
}

.us-modal-footer {
    border-top: 1px solid #f3f4f6;
    padding: 16px 24px;
}

/* ---------------------------------------------------------------------------
   邀请接受页
   --------------------------------------------------------------------------- */
.us-invite-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.us-invite-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.us-invite-label {
    font-size: 13px;
    color: #6b7280;
    min-width: 80px;
}

.us-invite-value {
    font-size: 14px;
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
   响应式
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .us-sidebar {
        display: none;
    }

    .us-hero {
        padding: 20px;
        border-radius: 12px;
    }

    .us-hero-title {
        font-size: 18px;
    }

    .us-hero-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ===========================================================================
   传感器监控中心 - 顶部栏 + Overlay 侧边栏（envita 风格）
   =========================================================================== */

/* 整体布局 */
.app-layout {
    min-height: 100vh;
    background: #f5f3ef;
}

.main-wrapper {
    padding: 16px 24px;
    padding-top: 64px; /* 顶部栏高度 */
    min-height: 100vh;
}

/* ---------------------------------------------------------------------------
   顶部栏
   --------------------------------------------------------------------------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #eee9e4;
    border-bottom: 1px solid #d9d4ce;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-hamburger {
    background: none;
    border: none;
    font-size: 18px;
    color: #374151;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}

.topbar-hamburger:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1f2937;
}

.topbar-brand:hover {
    text-decoration: none;
    color: #1f2937;
}

.topbar-logo-icon {
    font-size: 18px;
    color: #2d9f93;
}

.topbar-logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.topbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.topbar-title {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.topbar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
}

.topbar-user-email {
    font-size: 11px;
    color: #6b7280;
}

.topbar-avatar-wrap {
    position: relative;
}

.topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
    position: relative;
}

.topbar-user-trigger:hover {
    background: #f3f4f6;
}

.topbar-avatar {
    font-size: 28px;
    color: #6b7280;
    transition: color 0.15s;
}

.topbar-user-trigger:hover .topbar-avatar {
    color: #1f2937;
}

/* 用户下拉菜单 */
.topbar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    padding: 8px 0;
    z-index: 1100;
}

.topbar-dropdown-hidden {
    display: none;
}

.topbar-dropdown-visible {
    display: block;
}

.topbar-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: background 0.1s;
}

.topbar-dropdown-item:hover {
    background: #f3f4f6;
    text-decoration: none;
    color: #1f2937;
}

.topbar-dropdown-danger {
    color: #dc2626;
}

.topbar-dropdown-danger:hover {
    background: rgba(239, 68, 68, 0.06);
    color: #b91c1c;
}

.topbar-dropdown-divider {
    margin: 4px 0;
    border-color: #f3f4f6;
}

/* ---------------------------------------------------------------------------
   Overlay 侧边栏
   --------------------------------------------------------------------------- */
.sidebar-overlay {
    position: fixed;
    top: 48px; /* 顶部栏下方 */
    left: 0;
    bottom: 0;
    width: 240px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    z-index: 900;
    overflow-y: auto;
    padding: 16px;
    transition: transform 0.25s ease;
}

.sidebar-hidden {
    transform: translateX(-100%);
}

.sidebar-visible {
    transform: translateX(0);
}

/* 遮罩层 */
.backdrop-hidden {
    display: none;
}

.backdrop-visible {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 899;
}

/* 用户系统页面有顶部栏时的 main 区域 */
.us-main-with-topbar .us-main-inner {
    padding-top: 64px;
}

/* 用户系统侧边栏导航链接 */
.us-sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: background 0.15s;
    margin-bottom: 2px;
}

.us-sidebar-nav-link:hover {
    background: #f3f4f6;
    color: #1f2937;
    text-decoration: none;
}

.us-sidebar-nav-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 8px 0;
}

/* ---------------------------------------------------------------------------
   用户系统页面弹窗（个人资料 / 修改密码）
   --------------------------------------------------------------------------- */
.us-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.us-modal-hidden {
    display: none !important;
}

.us-modal-card {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.us-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f3f4f6;
}

.us-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.us-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.us-modal-close:hover {
    color: #1f2937;
}

.us-modal-body {
    padding: 20px 24px;
}

.us-modal-footer {
    padding: 12px 24px 20px;
}
