/* ============================================================
   粉丝监控系统 · 全局公共样式 (common.css v20260919)
   所有页面通用：Reset / 排版 / 按钮 / 表单 / 卡片 / 表格 / 徽章 / 告警 / 标签 / Modal 等
   主题色通过 --primary / --accent / --primary-soft / --accent-soft 变量切换
   ============================================================ */

/* ---------- 1. Reset + 基础盒模型 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

/* ---------- 2. 主题 CSS 变量（默认值，会被 app-admin / app-user 覆盖） ---------- */
:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-soft:  rgba(37, 99, 235, 0.12);
    --accent:        #22c55e;
    --accent-dark:   #16a34a;
    --accent-soft:   rgba(34, 197, 94, 0.12);
    --danger:        #ef4444;
    --warning:       #f59e0b;
    --info:          #06b6d4;
    --success:       #10b981;
    --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;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm:  0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow:     0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.10), 0 8px 10px -6px rgba(0,0,0,0.06);

    --font-zh:     -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                   "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-zh);
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- 3. 排版 ---------- */
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; color: var(--gray-900); line-height: 1.35; letter-spacing: 0.2px; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
h4 { font-size: 16px; } h5 { font-size: 15px; } h6 { font-size: 13px; }
p  { margin: 0; }
small, .text-small { font-size: 12.5px; }
code, kbd, pre { font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; font-size: 12.5px; }
code { padding: 2px 6px; border-radius: 5px; background: rgba(0,0,0,0.06); color: var(--gray-900); }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
.text-muted { color: var(--gray-500) !important; }

/* ---------- 4. 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none !important;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    letter-spacing: 0.2px;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn i { font-size: 15px; line-height: 1; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-sm i { font-size: 13.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--radius); }
.btn-block, .btn.w-100 { width: 100%; display: inline-flex; }

.btn-primary   { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-success   { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.btn-outline-success { background: transparent; border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-danger    { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.btn-outline-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-warning   { background: var(--warning); border-color: var(--warning); color: var(--gray-900); }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.btn-info      { background: var(--info); border-color: var(--info); color: #fff; }
.btn-info:hover { background: #0891b2; border-color: #0891b2; color: #fff; }
.btn-secondary { background: var(--gray-200); border-color: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); border-color: var(--gray-300); color: var(--gray-800); }
.btn-light     { background: #fff; border-color: var(--gray-200); color: var(--gray-700); }
.btn-light:hover { background: var(--gray-50); color: var(--gray-800); }

/* 渐变按钮（登录页、卡片大按钮） */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff; border: none;
    box-shadow: 0 4px 14px var(--primary-soft);
}
.btn-gradient-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px var(--primary-soft); color: #fff; }
.btn-gradient-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--info) 100%);
    color: #fff; border: none;
    box-shadow: 0 4px 14px var(--accent-soft);
}
.btn-gradient-accent:hover { transform: translateY(-1px); box-shadow: 0 8px 22px var(--accent-soft); color: #fff; }

.btn-gradient-admin {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: #fff; border: none;
    box-shadow: 0 4px 14px rgba(245,158,11,0.35);
}
.btn-gradient-admin:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(245,158,11,0.45); color: #fff; }

.btn:disabled, .btn.disabled {
    opacity: 0.72; cursor: not-allowed !important;
    pointer-events: none; transform: none !important; box-shadow: none !important;
}

/* ---------- 5. 表单 ---------- */
.form-label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-label.small, label.small, label.form-label.small {
    font-size: 12px; margin-bottom: 5px;
}

.form-control, .form-select, textarea.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--gray-900);
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: all .2s ease;
    height: auto;
    font-family: inherit;
}
.form-control::placeholder, textarea.form-control::placeholder { color: var(--gray-400); }
.form-control:hover, .form-select:hover { border-color: var(--gray-300); }
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--gray-900);
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
}
.form-select { padding-right: 36px; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.7rem center; background-repeat: no-repeat; background-size: 1.2rem; appearance: none; }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.65; }

.input-group { display: flex; align-items: stretch; }
.input-group .input-group-text {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200); border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--gray-500); font-size: 14px;
}
.input-group .form-control, .input-group .form-select {
    border-top-left-radius: 0; border-bottom-left-radius: 0;
}
.input-group > .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* 带左侧图标的输入框（登录页常用） */
.input-wrap { position: relative; }
.input-wrap .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 16px; pointer-events: none;
    transition: color .2s;
}
.input-wrap .form-control { padding-left: 44px; }
.input-wrap input[type="password"].form-control { padding-right: 44px; }
.input-wrap:focus-within .input-icon { color: var(--primary); }
.input-wrap .toggle-pass {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border: none; background: transparent;
    color: var(--gray-400); cursor: pointer; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.input-wrap .toggle-pass:hover { background: var(--gray-100); color: var(--gray-700); }

/* 复选框 / 单选 */
.form-check { display: flex; align-items: center; gap: 8px; margin: 0; }
.form-check-input {
    width: 17px; height: 17px; margin: 0; cursor: pointer;
    border: 1.5px solid var(--gray-300); border-radius: 5px;
    background: #fff;
    accent-color: var(--primary);
}
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--primary-soft); }
.form-check-label { cursor: pointer; color: var(--gray-600); font-size: 13px; user-select: none; }

/* ---------- 6. 卡片 ---------- */
.card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 0;
    transition: box-shadow .25s;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header h5, .card-header h6 {
    font-size: 15px; font-weight: 600; color: var(--gray-800);
    display: flex; align-items: center; gap: 8px;
    margin: 0;
}
.card-header h5 i, .card-header h6 i { color: var(--accent); font-size: 16px; }
.card-body   { padding: 20px; }
.card-body.py-3 { padding-top: 12px; padding-bottom: 12px; }
.card-body.p-0 { padding: 0; }
.card-footer {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid var(--gray-100);
    border-radius: 0 0 var(--radius) var(--radius);
}
.card-footer.border-0 { border-top: none; }
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--gray-900); }

/* ---------- 7. 表格 ---------- */
.table { width: 100%; margin-bottom: 0; color: var(--gray-700); border-collapse: separate; border-spacing: 0; }
.table thead th {
    font-size: 12.5px; font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1.5px solid var(--gray-100);
    padding: 11px 14px;
    text-align: left;
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.table tbody td {
    font-size: 13px; color: var(--gray-700);
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    line-height: 1.5;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }
.table.table-hover tbody tr:hover { background: var(--primary-soft); }
.table.align-middle td, .table.align-middle th { vertical-align: middle; }
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

/* ---------- 8. 徽章 / 标签 ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: 0.3px;
    line-height: 1.5;
    white-space: nowrap;
}
.badge.rounded-pill { border-radius: 999px; padding: 4px 12px; }

.badge.bg-primary   { background: #dbeafe !important; color: #1e40af !important; border: 1px solid #bfdbfe; }
.badge.bg-success   { background: #dcfce7 !important; color: #166534 !important; border: 1px solid #bbf7d0; }
.badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a; }
.badge.bg-info      { background: #cffafe !important; color: #164e63 !important; border: 1px solid #a5f3fc; }
.badge.bg-danger     { background: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca; }
.badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0; }
.badge.bg-light     { background: #f8fafc !important; color: #334155 !important; border: 1px solid #e2e8f0; }

.badge.expiry-long    { background: #e0f2fe !important; color: #0c4a6e !important; border: 1px solid #bae6fd; }
.badge.expiry-mid     { background: #ede9fe !important; color: #5b21b6 !important; border: 1px solid #ddd6fe; }
.badge.expiry-soon    { background: #ffedd5 !important; color: #9a3412 !important; border: 1px solid #fed7aa; }
.badge.expiry-expired { background: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca; }

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1.6;
}
.tag-blue   { background: #dbeafe; color: #1e40af; }
.tag-green  { background: #dcfce7; color: #166534; }
.tag-orange { background: #ffedd5; color: #9a3412; }
.tag-red    { background: #fee2e2; color: #991b1b; }
.tag-gray   { background: #f3f4f6; color: #4b5563; }
.tag-purple { background: #f3e8ff; color: #6b21a8; }
.tag-cyan   { background: #cffafe; color: #164e63; }

/* ---------- 9. 告警提示 ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; line-height: 1.65;
    margin-bottom: 16px;
}
.alert > i { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.alert > div { flex: 1; }
.alert.alert-dismissible { padding-right: 44px; position: relative; }
.alert .btn-close { position: absolute; right: 12px; top: 12px; }

.alert-info {
    background: #ecfeff; color: #164e63; border-color: #a5f3fc;
}
.alert-info i { color: var(--info); }
.alert-success {
    background: #f0fdf4; color: #166534; border-color: #bbf7d0;
}
.alert-success i { color: var(--success); }
.alert-warning {
    background: #fffbeb; color: #92400e; border-color: #fde68a;
}
.alert-warning i { color: var(--warning); }
.alert-danger, .alert-error {
    background: #fef2f2; color: #991b1b; border-color: #fecaca;
}
.alert-danger i, .alert-error i { color: var(--danger); }

/* ---------- 10. 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination .page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    font-size: 13px; color: var(--gray-700); background: #fff;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    text-decoration: none; cursor: pointer; transition: all .2s;
}
.pagination .page-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pagination .page-item.active .page-link {
    background: var(--primary); border-color: var(--primary); color: #fff;
    box-shadow: 0 2px 6px var(--primary-soft);
}
.pagination .page-item.disabled .page-link {
    opacity: 0.5; cursor: not-allowed; pointer-events: none;
    background: var(--gray-50); color: var(--gray-400);
}

/* ---------- 11. Modal (Bootstrap 5 覆盖) ---------- */
.modal { backdrop-filter: blur(4px); background: rgba(15, 23, 42, 0.45); }
.modal-dialog { margin: 1.75rem auto; }
.modal-content {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.modal-lg { --bs-modal-width: 960px; }
.modal-xl { --bs-modal-width: 1180px; }
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header .modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.modal-header .btn-close { padding: 8px; border-radius: 8px; transition: background .2s; }
.modal-header .btn-close:hover { background: var(--gray-100); }
.modal-body { padding: 22px 24px; }
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ---------- 12. 栅格 gap（防止页面 g-4 过大，这里给个默认） ---------- */
.row > [class*="col-"] { padding-left: 12px; padding-right: 12px; }
.g-0, .gx-0, .gy-0 { --bs-gutter-x: 0; --bs-gutter-y: 0; }
.g-1, .gx-1, .gy-1 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
.g-2, .gx-2, .gy-2 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.g-3, .gx-3, .gy-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.g-4, .gx-4, .gy-4 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
.g-5, .gx-5, .gy-5 { --bs-gutter-x: 2rem; --bs-gutter-y: 2rem; }

/* ---------- 13. 面包屑 ---------- */
.breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding: 0; margin: 0; list-style: none;
    font-size: 13px;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: ""; display: inline-block; width: 4px; height: 4px;
    border-radius: 50%; background: var(--gray-300); margin-right: 6px;
    vertical-align: middle;
}
.breadcrumb-item a { color: var(--gray-500); }
.breadcrumb-item a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--gray-800); font-weight: 500; }

/* ---------- 14. 滚动条（细） ---------- */
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---------- 15. 通用工具类 ---------- */
.min-h-screen { min-height: 100vh; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow    { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.text-nowrap { white-space: nowrap !important; }
.text-ellipsis { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.truncate-2 {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.mb-0 { margin-bottom: 0 !important; }
.mt-auto { margin-top: auto !important; }
.ml-auto, .ms-auto { margin-left: auto !important; }
.mr-auto, .me-auto { margin-right: auto !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.opacity-75 { opacity: 0.75; } .opacity-50 { opacity: 0.5; }

/* ---------- 16. 权限卡片 + 角色卡片选择器 ---------- */
.perm-grid, .role-grid {
    display: grid;
    gap: 12px;
}
.role-grid {
    grid-template-columns: repeat(2, 1fr);
}
.perm-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.perm-card, .role-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 14px 16px 14px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.perm-card:hover, .role-card:hover {
    border-color: #cbd5e1;
    background: #fafbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.perm-card input[type="checkbox"],
.role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.perm-card .pc-icon,
.role-card .rc-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
}
.perm-card .pc-text,
.role-card .rc-text {
    flex: 1;
    min-width: 0;
}
.perm-card .pc-title,
.role-card .rc-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.perm-card .pc-title .bit {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
.perm-card .pc-desc,
.role-card .rc-desc {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.perm-card .pc-check,
.role-card .rc-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s ease;
}

/* 角色卡片 — 选中态 */
.role-card input:checked ~ .rc-check {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}
.role-card input:checked ~ .rc-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    color: #92400e !important;
}
.role-card.role-user .rc-icon {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}
.role-card.role-admin .rc-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    color: #9a3412;
}
.role-card input:checked ~ .rc-text .rc-title {
    color: #92400e;
}
.role-card input:checked + * + * + * { /* fallback if not adjacent */ }
.role-card:has(input:checked) {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

/* 权限卡片 5 种语义色 */
.perm-card[data-bit="1"]  .pc-icon { background: #dbeafe; color: #1e40af; } /* 监控 蓝 */
.perm-card[data-bit="2"]  .pc-icon { background: #dcfce7; color: #166534; } /* 查有效 绿 */
.perm-card[data-bit="4"]  .pc-icon { background: #cffafe; color: #164e63; } /* AD 青 */
.perm-card[data-bit="8"]  .pc-icon { background: #fef3c7; color: #92400e; } /* 查看 黄 */
.perm-card[data-bit="16"] .pc-icon { background: #fee2e2; color: #991b1b; } /* 抖加 红 */

.perm-card[data-bit="1"]  input:checked ~ .pc-check { background: #2563eb; color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.35); }
.perm-card[data-bit="2"]  input:checked ~ .pc-check { background: #16a34a; color: #fff; box-shadow: 0 2px 6px rgba(22,163,74,.35); }
.perm-card[data-bit="4"]  input:checked ~ .pc-check { background: #0891b2; color: #fff; box-shadow: 0 2px 6px rgba(8,145,178,.35); }
.perm-card[data-bit="8"]  input:checked ~ .pc-check { background: #d97706; color: #fff; box-shadow: 0 2px 6px rgba(217,119,6,.35); }
.perm-card[data-bit="16"] input:checked ~ .pc-check { background: #dc2626; color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.35); }

.perm-card:has(input:checked) { background: #ffffff; }
.perm-card[data-bit="1"]:has(input:checked)  { border-color: #93c5fd; background: #eff6ff; }
.perm-card[data-bit="2"]:has(input:checked)  { border-color: #86efac; background: #f0fdf4; }
.perm-card[data-bit="4"]:has(input:checked)  { border-color: #67e8f9; background: #ecfeff; }
.perm-card[data-bit="8"]:has(input:checked)  { border-color: #fcd34d; background: #fffbeb; }
.perm-card[data-bit="16"]:has(input:checked) { border-color: #fca5a5; background: #fef2f2; }

.perm-card.disabled, .role-card.disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.perm-section-notice {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #92400e;
    font-size: 13px;
    margin-bottom: 10px;
}
.perm-section-notice i { margin-right: 8px; font-size: 16px; }

/* ---------- 17. 表格操作列按钮组（胶囊式） ---------- */
.action-btn-group {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}
.action-btn-group:hover {
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.btn-act {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.btn-act + .btn-act {
    border-left: 1px solid #e2e8f0;
}
.btn-act:hover { transform: translateY(-1px); }
.btn-act:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

.btn-act-edit:hover {
    background: #fffbeb;
    color: #92400e;
}
.btn-act-toggle[data-togglable="1"]:hover {
    background: #f1f5f9;
    color: #334155;
}
.btn-act-toggle[data-togglable="0"]:hover {
    background: #f0fdf4;
    color: #166534;
}
.btn-act-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}

.btn-act .act-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent !important;
    border-radius: 50%;
    animation: act-spin 0.7s linear infinite;
}
.btn-act.is-loading i { display: none; }
.btn-act.is-loading .act-spinner { display: inline-block; }

@keyframes act-spin { to { transform: rotate(360deg); } }

/* 删除二次确认框内联提示条 */
.delete-inline-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 13px;
    margin-top: 10px;
}

/* =======================================================================
 * 18. 网站全局统一弹窗 + Toast 提示体系
 *    - showAlert(title, message, type)        -> 提示（无确认回调）
 *    - showConfirm(config)                   -> 确认（确定/取消两按钮）
 *    - toast(message, type)                  -> 右下轻提示（保留语义色）
 * ======================================================================= */

/* ---------- 遮罩层 ---------- */
.ux-modal-backdrop {
    position: fixed; inset: 0; z-index: 9990;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    padding: 20px;
}
.ux-modal-backdrop.show { opacity: 1; visibility: visible; }
.ux-modal {
    width: 100%; max-width: 460px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22),
                0 10px 30px rgba(15, 23, 42, 0.10);
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.22s ease;
}
.ux-modal-backdrop.show .ux-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ---------- 头部：图标条 + 关闭按钮 ---------- */
.ux-modal-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 22px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
}
.ux-modal-title-row {
    display: flex; align-items: center; gap: 12px; flex: 1;
}
.ux-modal-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.ux-modal-title {
    margin: 0;
    font-size: 17px; font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}
.ux-modal-close {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.ux-modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

/* 语义色：图标 */
.ux-icon-success { background: #dcfce7; color: #16a34a; }
.ux-icon-warning { background: #fef3c7; color: #d97706; }
.ux-icon-error   { background: #fee2e2; color: #dc2626; }
.ux-icon-info    { background: #cffafe; color: #0891b2; }
.ux-icon-question{ background: #ede9fe; color: #7c3aed; }

/* ---------- 内容区 ---------- */
.ux-modal-body {
    padding: 18px 24px 24px;
}
.ux-modal-message {
    margin: 0 0 4px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #475569;
    white-space: pre-wrap;
}
.ux-modal-hint-box {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}
.ux-hint-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.ux-hint-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.ux-hint-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.ux-hint-info    { background: #ecfeff; border: 1px solid #a5f3fc; color: #164e63; }
.ux-hint-question{ background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6; }

.ux-modal-check-row {
    margin-top: 14px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #92400e;
    cursor: pointer;
}
.ux-modal-check-row input { cursor: pointer; margin: 0; }

/* ---------- 底部双按钮 ---------- */
.ux-modal-foot {
    padding: 14px 24px 22px;
    display: flex; gap: 12px; justify-content: flex-end;
}
.ux-btn {
    height: 40px; min-width: 96px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    white-space: nowrap;
}
.ux-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08); }
.ux-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* 语义色：主按钮（确定/知道了）默认继承弹框类型色；取消按钮灰色 */
.ux-btn-cancel {
    background: #fff;
    color: #475569;
    border-color: #e2e8f0;
}
.ux-btn-cancel:hover { background: #f8fafc; }

.ux-btn-primary-success   { background: #16a34a; color: #fff; }
.ux-btn-primary-success:hover   { background: #15803d; }
.ux-btn-primary-warning   { background: #d97706; color: #fff; }
.ux-btn-primary-warning:hover   { background: #b45309; }
.ux-btn-primary-error     { background: #dc2626; color: #fff; }
.ux-btn-primary-error:hover     { background: #b91c1c; }
.ux-btn-primary-info      { background: #0891b2; color: #fff; }
.ux-btn-primary-info:hover      { background: #0e7490; }
.ux-btn-primary-question  { background: #7c3aed; color: #fff; }
.ux-btn-primary-question:hover  { background: #6d28d9; }

/* ---------- Toast 提示（语义色，浅+深）---------- */
.ux-toast-wrap {
    position: fixed;
    right: 24px; top: 92px;
    z-index: 10000;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 360px;
    pointer-events: none;
}
.ux-toast {
    position: relative;
    padding: 13px 16px 13px 46px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10),
                0 4px 10px rgba(15, 23, 42, 0.06);
    font-size: 14px;
    line-height: 1.55;
    color: #0f172a;
    min-width: 220px;
    pointer-events: auto;
    animation: ux-toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    border-left: 4px solid transparent;
}
.ux-toast i.ux-t-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 18px;
}
.ux-toast-success   { border-left-color: #16a34a; color: #166534; background: #f0fdf4; }
.ux-toast-success   i.ux-t-icon { color: #16a34a; }
.ux-toast-warning   { border-left-color: #d97706; color: #92400e; background: #fffbeb; }
.ux-toast-warning   i.ux-t-icon { color: #d97706; }
.ux-toast-error     { border-left-color: #dc2626; color: #991b1b; background: #fef2f2; }
.ux-toast-error     i.ux-t-icon { color: #dc2626; }
.ux-toast-info      { border-left-color: #0891b2; color: #164e63; background: #ecfeff; }
.ux-toast-info      i.ux-t-icon { color: #0891b2; }
.ux-toast.ux-toast-out { animation: ux-toast-out 0.25s ease forwards; }

@keyframes ux-toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ux-toast-out {
    to { opacity: 0; transform: translateX(30px); max-height: 0; margin: 0; padding: 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 520px) {
    .ux-modal { max-width: 100%; border-radius: 14px; }
    .ux-modal-head, .ux-modal-body, .ux-modal-foot { padding-left: 18px; padding-right: 18px; }
    .ux-modal-foot { flex-direction: column-reverse; }
    .ux-btn { width: 100%; min-width: 0; }
    .ux-toast-wrap { right: 12px; left: 12px; top: 70px; max-width: none; }
}
