/* ============================================
   全站共享样式
   使用文件：Site.Master、Login.aspx、Home.aspx、Inventory.aspx、Error.aspx、
   Menu.aspx、Role.aspx、RoleMenu.aspx、User.aspx、UserRole.aspx
   ============================================ */

/* CSS Variables */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --primary-rgb: 79, 70, 229;
    --success: #059669;
    --success-light: #ecfdf5;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    min-height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

body.inventory-page {
    display: block;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

body.inventory-page header,
body.inventory-page footer {
    min-height: 0;
}

body.inventory-page header {
    flex: 0 0 60px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
}

body.inventory-page .app-main {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

/* ============================================
   Background Decorative Shapes
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -20%;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -40%;
    right: -15%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Layout */
.container {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 24px 12px;
    flex: 1;
    position: relative;
    z-index: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.inventory-page .container {
    height: 100%;
    min-height: 0;
    /* 在默认 1320px 基础上左右各放宽 50px，避免筛选区与表格过于紧凑。 */
    max-width: 1420px;
}

/* ============================================
   顶部导航与账户弹窗
   使用文件：Site.Master
   ============================================ */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    height: 60px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.nav-left {
    flex: 1 1 auto;
    gap: 14px;
}

.nav-right {
    flex: 0 0 auto;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--gray-900);
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.site-brand-mark {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #075985;
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 800;
}

.site-brand:hover {
    color: var(--primary);
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-right: 20px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.brand::before {
    content: '\1F4E6';
    font-size: 1.3rem;
    line-height: 1;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--gray-700);
    padding: 4px 0;
}

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.4;
}

.badge-admin {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.btn-logout {
    color: var(--danger);
    font-weight: 500;
}

.btn-logout:hover {
    background: var(--danger-light);
    color: #b91c1c;
}

.account-menu {
    position: relative;
    min-width: 0;
}

.account-trigger {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.account-trigger:hover,
.account-menu.is-open .account-trigger {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.account-avatar {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #2563eb);
    color: #fff;
    font-size: 0.78rem;
}

.account-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-caret {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 200;
}

.account-menu.is-open .account-dropdown {
    display: block;
}

.account-summary {
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 6px;
}

.account-summary-label {
    display: block;
    color: var(--gray-400);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.account-summary strong {
    display: block;
    margin-top: 3px;
    color: var(--gray-800);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.account-dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.account-dropdown-item.danger {
    color: var(--danger);
}

.account-dropdown-item.danger:hover {
    background: var(--danger-light);
    color: #b91c1c;
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    overflow-y: auto;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 24px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-xl);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-dialog::-webkit-scrollbar {
    width: 8px;
}

.modal-dialog::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: var(--gray-300);
}

.modal-dialog::-webkit-scrollbar-track {
    background: transparent;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-header h2 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-header p {
    color: var(--gray-500);
    font-size: 0.88rem;
    line-height: 1.5;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.35rem;
    line-height: 1;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.modal-dialog .form-group {
    margin-bottom: 16px;
}

.modal-dialog .form-row {
    flex-wrap: nowrap;
}

.modal-dialog .form-row .form-group {
    min-width: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-backdrop.logout-modal {
    align-items: center;
}

.logout-dialog {
    max-width: 400px;
}

.logout-dialog .modal-header {
    margin-bottom: 0;
}

.feedback-modal {
    align-items: center;
    justify-content: center;
    z-index: 700;
}

.feedback-dialog {
    width: min(380px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.feedback-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 1.35rem;
    font-weight: 800;
}

.feedback-dialog h2 {
    color: var(--gray-900);
    font-size: 1.1rem;
}

.feedback-dialog p {
    margin: 7px 0 20px;
    color: var(--gray-500);
    font-size: 0.88rem;
    line-height: 1.5;
}

.feedback-dialog .btn {
    min-width: 110px;
}

.feedback-modal.is-error .feedback-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.feedback-modal.is-error .feedback-dialog .btn {
    background: var(--danger);
}

.btn-danger {
    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    color: var(--white);
    background: #b91c1c;
    border-color: #b91c1c;
}

/* ============================================
   通用页面标题
   使用文件：Inventory.aspx、Menu.aspx、Role.aspx、RoleMenu.aspx、User.aspx、UserRole.aspx
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.page-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1::before {
    content: '\1F4CB';
    font-size: 1.5rem;
    line-height: 1;
}

.text-muted {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 4px;
    font-style: italic;
}

.text-center {
    text-align: center;
}

.text-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-error::before {
    content: '\26A0';
    font-size: 0.85rem;
}

/* ============================================
   通用卡片容器
   使用文件：Home.aspx、Inventory.aspx、Menu.aspx、Role.aspx、RoleMenu.aspx、User.aspx、UserRole.aspx
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 24px;
}

/* ============================================
   统计卡片
   使用文件：Home.aspx
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.08;
    transition: opacity var(--transition);
}

.stat-card:nth-child(1)::after { background: var(--primary); }
.stat-card:nth-child(2)::after { background: var(--success); }
.stat-card:nth-child(3)::after { background: var(--warning); }
.stat-card:nth-child(4)::after { background: #8b5cf6; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::after {
    opacity: 0.14;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-light); }
.stat-icon.green  { background: var(--success-light); }
.stat-icon.amber  { background: var(--warning-light); }
.stat-icon.purple { background: #f5f3ff; }

.stat-info { flex: 1; }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 2px;
    font-weight: 500;
}

/* ============================================
   通用数据表格
   使用文件：Inventory.aspx、Menu.aspx、Role.aspx、User.aspx、UserRole.aspx
   ============================================ */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    background: var(--white);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: none;
    letter-spacing: 0;
    border-right: 1px solid #dbe3ee;
    border-bottom: 2px solid #0f766e;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}

.table thead th:last-child {
    border-right: none;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.88rem;
    color: #334155;
    vertical-align: middle;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.table tbody tr:hover {
    background: #ecfdf5;
}

.table tbody tr:hover td {
    color: #0f172a;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Empty Data Styling */
.table tbody tr.empty-row td {
    text-align: center;
    padding: 72px 20px;
    color: #64748b;
    font-size: 0.95rem;
    background: #fff;
    border-bottom: none;
}

.table tbody tr.empty-row td::before {
    content: '\1F4E6';
    display: block;
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.42;
}

/* ============================================
   通用按钮
   使用文件：全部页面及 Site.Master
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0.1px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

/* Success */
.btn-success {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border-color: transparent;
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* Danger */
.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

/* Secondary */
.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

/* Sizes */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 0.98rem;
    border-radius: var(--radius);
}

.btn-full {
    width: 100%;
}

/* Icon Button */
.btn-icon {
    padding: 8px 10px;
    min-width: 38px;
    min-height: 38px;
}

/* ============================================
   通用表单与弹窗表单
   使用文件：Login.aspx、Site.Master、Menu.aspx、Role.aspx、User.aspx、UserRole.aspx
   ============================================ */
.form-group {
    margin-bottom: 18px;
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:hover {
    border-color: var(--gray-400);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.10);
}

.form-control:read-only {
    background: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

/* Input with Icon */
.input-icon-group {
    position: relative;
}

.input-icon-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition);
}

.input-icon-group .form-control {
    padding-left: 42px;
}

.input-icon-group .form-control:focus ~ .input-icon,
.input-icon-group .form-control:focus + .input-icon {
    color: var(--primary);
}

/* ============================================
   登录页
   使用文件：Login.aspx
   ============================================ */
.login-body {
    background:
        linear-gradient(145deg, rgba(13, 148, 136, 0.92) 0%, rgba(37, 99, 235, 0.86) 48%, rgba(249, 115, 22, 0.90) 100%),
        linear-gradient(45deg, #ecfeff 0%, #eff6ff 48%, #fff7ed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
    padding-bottom: 56px;
}

/* Animated background shapes */
.login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
    top: -200px;
    right: -100px;
    border-radius: 50%;
    animation: loginFloat1 20s ease-in-out infinite;
    pointer-events: none;
}

.login-body::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(255,255,255,0));
    bottom: -150px;
    left: -80px;
    border-radius: 50%;
    animation: loginFloat2 25s ease-in-out infinite;
    pointer-events: none;
}

@keyframes loginFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes loginFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, -40px) scale(1.15); }
}

/* Grid pattern overlay */
.login-grid {
    display: none;
}

.login-container {
    width: 100%;
    max-width: 430px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: cardSlideUp 0.6s ease-out;
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-avatar {
    width: 180px;
    height: 96px;
    border-radius: 14px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.18);
}

.login-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-card h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-card .form-group label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.login-card .form-control {
    padding: 12px 16px;
    font-size: 0.92rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
}

.login-card .form-control:focus {
    background: var(--white);
}

.captcha-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.captcha-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.captcha-image {
    width: 112px;
    height: 46px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
    object-fit: contain;
    cursor: pointer;
    display: block;
    flex-shrink: 0;
}

.captcha-image:hover {
    border-color: #2563eb;
}

.login-card .btn-primary {
    margin-top: 12px;
    padding: 13px;
    font-size: 0.95rem;
    border-radius: var(--radius);
    font-weight: 600;
    background: linear-gradient(135deg, #0d9488, #2563eb);
    letter-spacing: 0.2px;
}

.login-card .btn-primary:hover {
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.32);
}

.login-footer {
    text-align: center;
    margin-top: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.86);
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2;
}

/* ============================================
   错误页
   使用文件：Error.aspx
   ============================================ */
.error-page {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -20px -24px -12px;
    width: calc(100% + 48px);
    padding: 0;
}

.error-card {
    width: 100%;
    height: 100%;
    min-height: 520px;
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--white);
    box-shadow: none;
}

.error-status-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 64px 48px;
    border-right: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0c4a6e;
    text-align: center;
}

.error-code {
    position: static;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0369a1;
    font-family: Consolas, "Courier New", monospace;
    font-size: 7rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 0.95;
}

.error-icon {
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #7dd3fc;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 12px 30px rgba(14, 116, 144, 0.12);
}

.error-icon span {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0369a1;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.error-status-panel > p {
    margin-top: 20px;
    color: #075985;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.error-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px clamp(48px, 7vw, 112px);
}

.error-eyebrow {
    margin-bottom: 8px;
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.error-content h1 {
    max-width: 520px;
    color: var(--gray-900);
    font-size: 2.35rem;
    font-weight: 750;
    line-height: 1.25;
}

.error-description {
    max-width: 560px;
    margin-top: 12px;
    color: var(--gray-500);
    font-size: 0.92rem;
    line-height: 1.6;
}

.error-guidance {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #f8fafc;
}

.error-guidance-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.error-guidance p {
    min-width: 0;
    color: var(--gray-600);
    font-size: 0.8rem;
    line-height: 1.5;
}

.error-guidance strong,
.error-guidance span {
    display: block;
}

.error-guidance strong {
    margin-bottom: 2px;
    color: var(--gray-800);
    font-size: 0.8rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.error-actions .btn {
    min-width: 128px;
}

/* ============================================
   修改密码设置区
   使用文件：Site.Master
   ============================================ */
.settings-page {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.settings-card {
    width: 100%;
    max-width: 460px;
    padding: 30px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

.settings-header {
    margin-bottom: 22px;
}

.settings-header h1 {
    color: var(--gray-900);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.settings-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.5;
}

.settings-card .form-group {
    margin-bottom: 16px;
}

.settings-card .form-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

/* ============================================
   查询筛选区
   使用文件：Inventory.aspx、User.aspx、UserRole.aspx
   ============================================ */
.search-card {
    border-radius: var(--radius);
    border: 1px solid #dbe3ee;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    background: var(--white);
    flex-shrink: 0;
    margin-bottom: 0;
}

.search-card .card-body {
    padding: 16px 20px;
}

.search-card .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.search-card .form-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    align-items: flex-end;
    gap: 12px;
}

.search-card .form-control {
    background: var(--gray-50);
    border-color: var(--gray-200);
    height: 40px;
    padding: 9px 34px 9px 12px;
    font-size: 0.86rem;
    text-overflow: ellipsis;
}

.search-card .form-control:focus {
    background: var(--white);
}

.clearable-input {
    position: relative;
}

.clearable-input .form-control {
    padding-right: 40px;
}

.input-clear-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
}

.input-clear-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.input-clear-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.search-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    min-width: max-content;
}

.search-actions .btn {
    height: 40px;
    padding: 0 10px;
}

/* ============================================
   列表卡片与空态
   使用文件：Inventory.aspx、Menu.aspx、Role.aspx、User.aspx、UserRole.aspx
   ============================================ */
.table-card {
    flex: 0 1 auto;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
    border-color: #dbe3ee;
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.table-card .card-body {
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-card .table-responsive {
    border-radius: var(--radius) var(--radius) 0 0;
    border: none;
    min-height: 0;
    flex: 1 1 auto;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-color: #94a3b8 #f1f5f9;
    scrollbar-width: thin;
}

.table-card-empty .table-responsive {
    border-top: none;
}

.table-card .table-responsive::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-card .table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-card .table-responsive::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border: 2px solid #f1f5f9;
    border-radius: 999px;
}

.inventory-table {
    min-width: 1080px;
}

.inventory-table .code-cell {
    color: #475569;
    font-family: "Segoe UI", Consolas, monospace;
    font-size: 0.84rem;
}

.inventory-table .strong-cell {
    color: #0f766e;
    font-weight: 700;
}

.inventory-table .qty-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.inventory-table tbody .qty-cell {
    color: #1d4ed8;
    font-weight: 700;
}

.table-card .table thead th:first-child {
    padding-left: 24px;
}

.table-card .table thead th:last-child {
    padding-right: 24px;
}

.table-card .table tbody td:first-child {
    padding-left: 24px;
}

.table-card .table tbody td:last-child {
    padding-right: 24px;
}

/* ============================================
   页面页脚
   使用文件：Site.Master
   ============================================ */
footer {
    text-align: center;
    padding: 10px 20px;
    font-size: 0.8rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-100);
    position: relative;
    z-index: 1;
    background: var(--white);
    flex-shrink: 0;
    margin-top: auto;
}

footer p {
    line-height: 1.3;
}

footer::before {
    content: none;
}

/* ============================================
   通用提示消息
   使用文件：Login.aspx、Site.Master、Menu.aspx、Role.aspx、RoleMenu.aspx、User.aspx、UserRole.aspx
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-error::before {
    content: '\26A0';
    font-size: 1.1rem;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-success::before {
    content: '\2714';
    font-size: 1.1rem;
}

/* ============================================
   Link List
   ============================================ */
.link-list {
    list-style: none;
    padding: 0;
}

.link-list li {
    padding: 7px 0;
}

.link-list li a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.link-list li a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.link-list li a::before {
    content: '\2192';
    font-size: 0.85rem;
}

/* ============================================
   Loading Skeleton (optional future use)
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   通用分页控件
   使用文件：Inventory.aspx、Role.aspx、User.aspx、UserRole.aspx
   ============================================ */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 0;
    flex-shrink: 0;
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 8px 20px;
    width: 100%;
    box-shadow: var(--shadow);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
    font-size: 0.85rem;
    white-space: nowrap;
}

.page-size-select {
    height: 34px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    background-color: var(--white);
    font: inherit;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1;
}

.pagination-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
    cursor: default;
}

.pagination-btn.disabled {
    color: var(--gray-300);
    border-color: var(--gray-100);
    background: var(--gray-50);
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-size: 0.85rem;
    color: var(--gray-400);
    letter-spacing: 2px;
    user-select: none;
}

@media (max-width: 1180px) {
    .search-card .form-row {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .search-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        padding: 8px 14px;
    }

    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.8rem;
    }

    .pagination-ellipsis {
        min-width: 28px;
        height: 32px;
    }
}

/* ============================================
   移动端响应式覆盖
   使用文件：全部页面及 Site.Master
   ============================================ */
@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.inventory-page {
        display: block;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .app-shell {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .navbar {
        padding: 0 14px;
        height: 54px;
        gap: 10px;
    }

    body.inventory-page header {
        flex-basis: 54px;
        height: 54px;
        min-height: 54px;
        max-height: 54px;
    }

    .container {
        padding: 14px 14px 10px;
        overflow: visible;
    }

    body.inventory-page .container {
        flex: 0 0 auto;
        height: auto;
        min-height: calc(100dvh - 92px);
    }

    .nav-left {
        flex: 1 1 auto;
        gap: 8px;
    }

    .nav-right {
        flex: 0 1 auto;
        max-width: 58%;
    }

    .brand {
        margin-right: 8px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand + .brand {
        display: none;
    }

    .account-trigger {
        height: 38px;
        padding: 0 9px;
        gap: 6px;
    }

    .account-name {
        max-width: 88px;
    }

    .account-dropdown {
        position: fixed;
        top: 62px;
        right: 14px;
        width: min(260px, calc(100vw - 28px));
    }

    .modal-backdrop {
        align-items: flex-start;
        padding: 16px;
        overflow-y: auto;
    }

    .modal-dialog {
        margin: 24px 0;
        padding: 20px;
        border-radius: var(--radius);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px 18px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .login-card {
        padding: 32px 24px;
    }

    .login-container {
        max-width: 460px;
        padding: 18px;
    }

    .login-body {
        align-items: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 0 64px;
        overflow-y: auto;
    }

    .error-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .error-status-panel {
        min-height: 220px;
        padding: 38px 24px 30px;
        border-right: 0;
        border-bottom: 1px solid #bae6fd;
    }

    .error-icon {
        width: 84px;
        height: 84px;
    }

    .error-content {
        padding: 30px 24px 32px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .search-card .card-body {
        padding: 14px;
    }

    .search-card .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .search-card .form-group {
        min-width: 0;
    }

    .search-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .search-actions .btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 10px;
    }

    .table-card {
        min-height: 360px;
        overflow: hidden;
    }

    .table-card .table-responsive {
        max-height: 58vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table thead th,
    .table tbody td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .table-card .table thead th:first-child,
    .table-card .table tbody td:first-child {
        padding-left: 14px;
    }

    .table-card .table thead th:last-child,
    .table-card .table tbody td:last-child {
        padding-right: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px 10px 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .brand {
        font-size: 1rem;
        margin-right: 0;
    }

    .brand::before {
        font-size: 1.1rem;
    }

    .account-avatar,
    .account-caret,
    .badge-admin {
        display: none;
    }

    .account-trigger {
        padding: 0 10px;
    }

    .account-name {
        max-width: 72px;
    }

    .search-card .form-row {
        grid-template-columns: 1fr;
    }

    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-actions .btn {
        width: 100%;
    }

    .captcha-row {
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
    }

    .captcha-input {
        flex: 1 1 auto;
        min-width: 0;
    }

    .captcha-image {
        width: 104px;
        flex: 0 0 104px;
        height: 48px;
    }

    .login-card {
        padding: 28px 18px;
        border-radius: var(--radius-lg);
    }

    .login-avatar {
        width: 150px;
        height: 80px;
        margin-bottom: 18px;
    }

    .error-page {
        padding: 10px 0;
    }

    .error-status-panel {
        min-height: 190px;
    }

    .error-content {
        padding: 24px 18px 26px;
    }

    .error-content h1 {
        font-size: 1.4rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn,
    .modal-actions input[type="submit"] {
        width: 100%;
    }

    .pagination-nav {
        justify-content: center;
        max-width: 100%;
    }
}

/* ============================================
   ASP.NET Menu 顶部导航控件
   使用文件：Site.Master
   ============================================ */
.nav-menu {
    border-collapse: collapse;
    border-spacing: 0;
    margin-left: 4px;
    max-width: 100%;
}

.nav-menu > tbody > tr > td,
.nav-menu > tr > td {
    padding: 0;
    position: relative;
    vertical-align: middle;
}

.nav-menu a {
    display: block;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
}

.nav-menu-item,
.nav-submenu-item {
    white-space: nowrap;
}

.nav-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-menu a.selected,
.nav-menu a.level1.selected {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* 子菜单下拉面板 */
.nav-menu table table {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 300;
    min-width: 220px;
    margin-top: 6px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* ASP.NET Menu renders dynamic items in a separate positioned layer. */
.nav-submenu {
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 300 !important;
}

.nav-submenu a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.nav-submenu a:hover,
.nav-submenu a.selected {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-menu table table td {
    padding: 0;
}

.nav-menu table table a {
    padding: 8px 12px;
}

/* 悬停展开子菜单（配合 Menu 控件 JS 的兜底规则） */
.nav-menu td:hover > table {
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .nav-menu {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu a {
        padding: 7px 10px;
    }

    .nav-submenu {
        min-width: 190px;
        max-width: calc(100vw - 28px);
    }
}

/* ============================================
   权限管理页面通用样式
   使用文件：Menu.aspx、Role.aspx、RoleMenu.aspx、User.aspx、UserRole.aspx
   ============================================ */
.security-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

.security-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.security-header h1 {
    font-size: 1.35rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-header .page-subtitle {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 3px;
}

.security-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.security-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.security-card .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 16px 20px;
}

.security-table .table thead th {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
}

.tree-indent {
    display: inline-block;
    color: var(--gray-400);
    font-size: 0.75rem;
    letter-spacing: -1px;
}

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.status-pill.status-normal,
.status-pill.status-active {
    background: #e6f7ee;
    color: #16a34a;
}

.status-pill.status-disabled {
    background: #fdeaea;
    color: #dc2626;
}

.status-pill.status-hidden,
.status-pill.status-paused {
    background: #fef6e6;
    color: #d97706;
}

.type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    background: var(--gray-50);
    white-space: nowrap;
}

.type-pill.type-M {
    color: #2563eb;
    border-color: #dbeafe;
    background: #eff6ff;
}

.type-pill.type-C {
    color: #7c3aed;
    border-color: #ede9fe;
    background: #f5f3ff;
}

.type-pill.type-F {
    color: #64748b;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
}

.user-search-card .form-row {
    grid-template-columns: minmax(260px, 2fr) minmax(170px, 1fr) minmax(180px, auto);
}

.user-management-table {
    min-width: 1220px;
}

.user-primary {
    display: inline-block;
    color: var(--gray-900);
    font-weight: 700;
}

.user-admin-label {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    background: #ecfdf5;
    color: #15803d;
    font-size: 0.66rem;
    font-weight: 700;
    vertical-align: middle;
}

.user-secondary,
.contact-stack {
    color: var(--gray-500);
    font-size: 0.78rem;
    line-height: 1.45;
}

.user-confirm-dialog {
    width: min(420px, calc(100vw - 32px));
    min-height: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 4px 14px;
    padding: 22px;
}

.user-confirm-symbol {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    font-size: 1.15rem;
    font-weight: 800;
}

.user-confirm-copy {
    min-width: 0;
}

.user-confirm-copy h2 {
    margin: 1px 0 5px;
    color: var(--gray-900);
    font-size: 1rem;
}

.user-confirm-copy p {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.82rem;
    line-height: 1.5;
}

.user-confirm-dialog .modal-actions {
    grid-column: 1 / -1;
    margin-top: 18px;
    padding-top: 0;
}

@media (max-width: 768px) {
    .user-search-card .form-row {
        grid-template-columns: 1fr;
    }
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-icon {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

/* 权限树（TreeView CheckBoxes） */
.permission-tree {
    flex: 1;
    min-height: 220px;
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    background: var(--gray-50);
}

.permission-tree table {
    width: auto;
    border-collapse: collapse;
}

.permission-tree > table {
    width: 100%;
}

.permission-tree table table {
    width: auto;
}

.permission-tree td {
    padding: 3px 0;
    font-size: 0.88rem;
    color: var(--gray-700);
}

.permission-tree input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.role-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    margin: 0;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    list-style: none;
}

.role-checkbox-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.role-checkbox-list li:hover {
    background: var(--primary-light);
}

.role-checkbox-list label {
    flex: 1;
    margin: 0;
    color: var(--gray-700);
    cursor: pointer;
    font-size: 0.88rem;
}

.role-checkbox-list input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.permission-tree .permission-item-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* 角色分配页信息条 */
.role-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--gray-700);
    flex: 0 0 auto;
}

.role-info-bar .role-key {
    font-family: Consolas, 'Courier New', monospace;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: 1px solid var(--gray-200);
}

.menu-name-cell {
    font-weight: 500;
    color: var(--gray-800);
}

.menu-management-table {
    width: 100%;
    min-width: 1150px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.menu-management-page .menu-management-table th:nth-child(1),
.menu-management-page .menu-management-table td:nth-child(1) {
    width: 280px;
    text-align: left;
}

.menu-management-page .menu-management-table th:nth-child(2),
.menu-management-page .menu-management-table td:nth-child(2) {
    width: 110px;
    text-align: center;
}

.menu-management-page .menu-management-table th:nth-child(3),
.menu-management-page .menu-management-table td:nth-child(3) {
    width: 210px;
    text-align: left;
}

.menu-management-page .menu-management-table th:nth-child(4),
.menu-management-page .menu-management-table td:nth-child(4) {
    width: 80px;
    text-align: center;
}

.menu-management-page .menu-management-table th:nth-child(5),
.menu-management-page .menu-management-table td:nth-child(5),
.menu-management-page .menu-management-table th:nth-child(6),
.menu-management-page .menu-management-table td:nth-child(6) {
    width: 100px;
    text-align: center;
}

.menu-management-page .menu-management-table th:nth-child(7),
.menu-management-page .menu-management-table td:nth-child(7) {
    width: 270px;
    text-align: right;
}

.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 48px;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 1px solid #d8e0e9;
    background: #f3f6fa;
    background-image: none;
    box-shadow: inset 0 -2px 0 #cbd5e1;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 48px;
    vertical-align: middle;
}

.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th + th {
    border-left: 1px solid #dfe5ed;
}

.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:first-child {
    border-top-left-radius: 7px;
}

.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:last-child {
    border-top-right-radius: 7px;
}

.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:nth-child(2),
.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:nth-child(4),
.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:nth-child(5),
.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:nth-child(6) {
    text-align: center;
}

.menu-management-page .table-card .management-table.menu-management-table > thead > tr > th:last-child {
    text-align: right;
}

.menu-management-table tbody tr {
    transition: background-color 0.15s ease;
}

.menu-management-page .security-header {
    min-height: 58px;
    padding: 2px 4px 0;
}

.menu-page-heading h1 {
    font-size: 1.4rem;
    line-height: 1.3;
}

.menu-page-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: -3px;
}

.menu-management-page .security-header-actions .btn-primary {
    height: 40px;
    padding: 0 18px;
    box-shadow: 0 5px 12px rgba(79, 70, 229, 0.18);
}

.menu-management-page .table-card {
    border-color: #d7e0eb;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.menu-management-page .menu-management-table tbody td {
    height: 60px;
    border-bottom-color: #e5ebf2;
}

.menu-management-page .menu-management-table tbody td + td {
    border-left: 1px solid #edf1f5;
}

.menu-management-table tbody tr:hover td {
    background: #f8fafc;
}

.menu-management-table .menu-row-type-M td {
    background: #f5f8fc;
    border-top-color: #dbe7f3;
    border-bottom-color: #dbe7f3;
}

.menu-management-table .menu-row-type-M:hover td {
    background: #edf3f9;
}

.menu-tree-name {
    --menu-depth: 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 28px;
    padding-left: calc(var(--menu-depth) * 24px);
}

.menu-tree-name:not(.is-root)::before {
    position: absolute;
    top: 50%;
    left: calc(var(--menu-depth) * 24px - 15px);
    width: 10px;
    height: 12px;
    border-bottom: 1px solid #cbd5e1;
    border-left: 1px solid #cbd5e1;
    content: '';
    transform: translateY(-65%);
}

.menu-node-mark {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 2px solid #94a3b8;
    border-radius: 3px;
    background: var(--white);
}

.menu-node-mark-M {
    border-color: #60a5fa;
    background: #dbeafe;
    box-shadow: inset 0 4px 0 #93c5fd;
}

.menu-row-root .menu-tree-name {
    min-height: 30px;
}

.menu-row-root .menu-node-label {
    font-weight: 700;
}

.menu-node-mark-C {
    border-color: #a78bfa;
    background: #f5f3ff;
}

.menu-node-mark-F {
    width: 12px;
    height: 12px;
    margin-inline: 1px;
    border-color: #94a3b8;
    border-radius: 50%;
    background: #f1f5f9;
}

.menu-node-label {
    min-width: 0;
    overflow: hidden;
    color: var(--gray-800);
    font-size: 0.84rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-row-type-M .menu-node-label {
    color: #1e3a5f;
    font-weight: 700;
}

.menu-path-cell {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    color: #475569;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.76rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.menu-order-cell {
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.btn-menu-child {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.menu-management-page .table-actions .btn-secondary {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.menu-management-page .table-actions .btn-danger {
    border-color: #dc2626;
    background: #dc2626;
}

.btn-menu-child:hover {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1e40af;
}

.security-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.security-footer-note {
    flex: 1;
    font-size: 0.78rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
}

/* Role menu permission workspace */
.role-permission-page {
    overflow: hidden;
}

.role-permission-workspace {
    flex: 1;
    min-height: 430px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.role-selector-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--gray-200);
    background: #f8fafc;
}

.role-selector-header,
.menu-permission-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 76px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-200);
}

.panel-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--gray-500);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.role-selector-header h2,
.menu-permission-header h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
    line-height: 1.3;
}

.role-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 7px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.74rem;
    font-weight: 700;
}

.role-selector-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.role-selector-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 2px 8px;
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--gray-700);
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.role-selector-item:hover {
    border-color: var(--gray-200);
    background: var(--white);
    color: var(--gray-900);
}

.role-selector-item.is-selected {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.role-selector-name {
    min-width: 0;
    overflow: hidden;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-selector-key {
    min-width: 0;
    overflow: hidden;
    color: var(--gray-500);
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-selector-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--gray-400);
    font-size: 1.25rem;
    line-height: 1;
}

.role-selector-item.is-selected .role-selector-key,
.role-selector-item.is-selected .role-selector-arrow {
    color: #2563eb;
}

.role-selector-empty {
    padding: 22px 12px;
    color: var(--gray-500);
    font-size: 0.82rem;
    text-align: center;
}

.menu-permission-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.menu-permission-header {
    min-height: 76px;
    background: var(--white);
}

.selected-role-summary {
    min-width: 0;
}

.selected-role-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.selected-role-title-row h2 {
    max-width: min(420px, 45vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-role-key {
    display: inline-block;
    max-width: 240px;
    overflow: hidden;
    padding: 2px 7px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    background: #f8fafc;
    color: var(--gray-600);
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-role-remark {
    max-width: 640px;
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--gray-500);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-permission-save {
    flex: 0 0 auto;
    min-width: 132px;
}

.menu-permission-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    overflow: hidden;
}

.menu-tree-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.menu-tree-toolbar strong {
    display: block;
    color: var(--gray-800);
    font-size: 0.86rem;
}

.menu-tree-toolbar span {
    display: block;
    margin-top: 2px;
    color: var(--gray-500);
    font-size: 0.74rem;
}

.menu-tree-actions {
    display: flex;
    gap: 6px;
}

.text-action {
    padding: 5px 7px;
    border: 0;
    background: transparent;
    color: #2563eb;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.text-action:hover {
    text-decoration: underline;
}

.role-menu-tree {
    max-height: none;
    min-height: 0;
    padding: 10px 14px;
    border-radius: 6px;
    background: #f8fafc;
}

.role-menu-tree td {
    height: 32px;
    padding: 3px 2px;
    vertical-align: middle;
}

.role-menu-tree input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0 8px 0 0;
    accent-color: #2563eb;
    vertical-align: middle;
}

.role-menu-tree a,
.role-menu-tree span {
    letter-spacing: 0;
    line-height: 1.4;
}

.menu-permission-footer {
    flex: 0 0 auto;
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 9px 18px;
    border-top: 1px solid var(--gray-200);
    background: #f8fafc;
    color: var(--gray-500);
    font-size: 0.74rem;
}

@media (max-width: 820px) {
    .role-permission-page {
        overflow: auto;
    }

    .role-permission-workspace {
        min-height: 680px;
        grid-template-columns: 220px minmax(0, 1fr);
    }

}

@media (max-width: 600px) {
    .role-permission-workspace {
        min-height: 760px;
        grid-template-columns: 1fr;
        grid-template-rows: 230px minmax(0, 1fr);
        overflow: visible;
    }

    .role-selector-panel {
        border-right: 0;
        border-bottom: 1px solid var(--gray-200);
    }

    .role-selector-header,
    .menu-permission-header {
        min-height: 68px;
        padding: 12px 14px;
    }

    .selected-role-key,
    .selected-role-remark {
        display: none;
    }

    .role-permission-save {
        min-width: 0;
        padding-inline: 12px;
    }

    .menu-permission-body {
        padding: 12px;
    }

    .menu-tree-toolbar {
        align-items: flex-end;
    }

    .menu-tree-toolbar span {
        display: none;
    }
}

/* ============================================
   首页模块卡片
   使用文件：Home.aspx
   ============================================ */
.home-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 12px;
}

.home-header {
    padding: 12px 0 4px;
}

.home-eyebrow {
    margin-bottom: 6px;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.home-header h1 {
    color: var(--gray-900);
    font-size: 1.7rem;
    line-height: 1.25;
}

.home-subtitle {
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.home-modules {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-section-heading h2 {
    color: var(--gray-900);
    font-size: 1rem;
}

.home-section-heading span {
    color: var(--gray-500);
    font-size: 0.8rem;
}

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

.home-module-card {
    min-height: 116px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.home-module-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 1.1rem;
}

.home-module-content {
    min-width: 0;
}

.home-module-content h3 {
    overflow: hidden;
    color: var(--gray-900);
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-module-content p {
    margin-top: 5px;
    overflow: hidden;
    color: var(--gray-500);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-module-link {
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.home-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 22px;
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    color: var(--gray-700);
    background: var(--white);
}

.home-empty span {
    color: var(--gray-500);
    font-size: 0.84rem;
}

@media (max-width: 980px) {
    .home-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .home-module-grid {
        grid-template-columns: 1fr;
    }

    .home-module-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .home-module-link {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* 管理列表紧凑表格：Menu.aspx、Role.aspx、User.aspx、UserRole.aspx。 */
.management-table {
    min-width: 1080px;
}

.management-table thead th {
    padding-top: 11px;
    padding-bottom: 11px;
    background: #f8fafc;
    border-bottom: 1px solid #dbe3ee;
    box-shadow: none;
    color: #334155;
}

.management-table tbody td {
    height: 62px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.management-table thead th:last-child,
.management-table tbody td:last-child {
    text-align: right;
}

.management-table .table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
}

.management-table .btn-icon {
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    box-shadow: none;
}

.management-table .btn-icon:hover {
    transform: none;
}

/* ============================================
   ASP.NET Menu 列表渲染补充
   使用文件：Site.Master
   ============================================ */
.nav-menu {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    height: 60px;
    margin: 0;
    overflow: visible;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > ul,
.nav-menu-list {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu a:focus-visible,
.nav-menu a.selected {
    background: var(--primary-light);
    color: var(--primary);
    outline: none;
}

.nav-menu a.selected {
    font-weight: 600;
}

.nav-menu-item,
.nav-submenu-item {
    white-space: nowrap;
}

.nav-menu ul.nav-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 300 !important;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    overflow: visible;
}

.nav-menu ul.nav-submenu ul.nav-submenu {
    top: -7px;
    left: calc(100% + 7px);
}

.nav-menu ul.nav-submenu a {
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
}

/* Fallback while the built-in ASP.NET Menu script initializes. */
.nav-menu li:hover > ul.nav-submenu,
.nav-menu li:focus-within > ul.nav-submenu {
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .site-brand-name {
        display: none;
    }

    .nav-menu {
        height: 54px;
        overflow: visible;
    }

    .nav-menu a {
        padding: 0 9px;
        font-size: 0.82rem;
    }

    .nav-menu ul.nav-submenu {
        min-width: 190px;
        max-width: calc(100vw - 28px);
    }
}

@media (max-width: 600px) {
    .navbar {
        padding-inline: 10px;
    }

    .site-brand-mark {
        width: 30px;
        height: 30px;
    }

    .account-name,
    .account-caret,
    .badge-admin {
        display: none;
    }

    .account-avatar {
        display: inline-flex;
    }

    .account-trigger {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    .modal-dialog .form-row {
        flex-direction: column;
        gap: 0;
    }
}
