* { margin: 0; padding: 0; box-sizing: border-box; }
/* 默认按浅色渲染表单控件/滚动条；换肤后由 theme-bootstrap.js 以内联 color-scheme 覆盖 */
:root { color-scheme: light; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--surface-page, #f6f7fb);
    color: var(--text-primary, #0f172a);
    font-size: 14px;
}
a { text-decoration: none; color: inherit; }

/* Navbar */
.navbar {
    height: 56px;
    background: var(--surface-card, #ffffff);
    box-shadow: 0 1px 4px var(--shadow-sm, rgba(15,23,42,0.06));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
.navbar-brand { font-size: 18px; font-weight: 600; color: var(--color-primary, #4f46e5); }
.navbar-right { display: flex; align-items: center; gap: 16px; }
.navbar-user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary, #475569); }
.navbar-user img { width: 32px; height: 32px; border-radius: 50%; }

/* Buttons
   高度由 height 给死、描边统一是 1px 实边框：这样"实心 / 描边 / 中性"三种按钮
   排在同一行里等高，宽度也不会因边框多出 2px。 */
.btn {
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px);
    font-size: 13px;
    cursor: pointer;
    background: var(--surface-card, #ffffff);
    color: var(--text-secondary, #475569);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-weight: 500; line-height: 1; white-space: nowrap;
    position: relative; overflow: hidden;
}
/* 裸 .btn（弹窗/抽屉里的"取消"）就是一枚中性描边按钮，不至于看着像一块空白 */
.btn:hover {
    background: var(--surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    border-color: var(--text-placeholder, #94a3b8);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
/* 只在键盘走到按钮上时画环：鼠标点完还留一圈描边，看着像没关掉 */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint-primary, rgb(79,70,229)) 18%, transparent);
}
/* 四个实底族把描边收成透明：透明边框露出的是按钮自己的底色，
   留着灰描边会在色块边上圈出一圈脏边 */
.btn-primary, .btn-success, .btn-danger, .btn-warning { border-color: transparent; }
.btn-primary { background: var(--color-primary-solid, #4338ca); color: var(--color-primary-solid-text, #ffffff); }
.btn-primary:hover { background: var(--color-primary-solid-hover, #3930ac); box-shadow: 0 2px 8px color-mix(in srgb, var(--tint-primary, rgb(79,70,229)) 30%, transparent); }
.btn-success { background: var(--color-success-solid, #065f46); color: var(--color-success-solid-text, #ffffff); }
.btn-success:hover { background: var(--color-success-solid-hover, #05513c); box-shadow: 0 2px 8px color-mix(in srgb, var(--color-success, #047857) 30%, transparent); }
.btn-danger { background: var(--color-danger-solid, #be123c); color: var(--color-danger-solid-text, #ffffff); }
.btn-danger:hover { background: var(--color-danger-solid-hover, #a20f33); box-shadow: 0 2px 8px color-mix(in srgb, var(--color-danger, #e11d48) 30%, transparent); }
.btn-warning { background: var(--color-warning-solid, #92400e); color: var(--color-warning-solid-text, #ffffff); }
.btn-warning:hover { background: var(--color-warning-solid-hover, #7c360c); box-shadow: 0 2px 8px color-mix(in srgb, var(--color-warning, #b45309) 30%, transparent); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: var(--radius-sm, 4px); }
.btn-outline {
    background: var(--surface-card, #ffffff); color: var(--color-primary, #4f46e5); border-color: var(--color-primary, #4f46e5);
}
.btn-outline:hover { background: var(--color-primary-solid, #4338ca); color: var(--color-primary-solid-text, #ffffff); border-color: var(--color-primary-solid, #4338ca); }
.btn-outline.danger { color: var(--color-danger, #e11d48); border-color: var(--color-danger, #e11d48); }
.btn-outline.danger:hover { background: var(--color-danger-solid, #be123c); color: var(--color-danger-solid-text, #ffffff); border-color: var(--color-danger-solid, #be123c); }

/* 列表页工具栏配对：查询=主动作（btn-primary 主色实心），重置=辅助动作（中性描边）。 */
.btn-reset {
    background: var(--surface-card, #ffffff);
    color: var(--text-secondary, #475569);
    border-color: var(--border-input, #cbd5e1);
}
.btn-reset:hover {
    color: var(--color-primary, #4f46e5);
    background: var(--surface-active, #eef2ff);
    border-color: var(--color-primary, #4f46e5);
}
/* 表格行里的文字动作：不带底色边框，靠颜色区分，间距由父级 .actions 给 */
.btn-link { cursor: pointer; background: none; border: none; padding: 2px 4px; border-radius: var(--radius-xs, 2px); color: var(--color-primary, #4f46e5); font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--color-danger, #e11d48); }
.btn-link.danger:hover { text-decoration: underline; }
.btn-logout {
    height: 32px; padding: 0 12px; border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-card, #ffffff); color: var(--text-secondary, #475569); font-size: 13px; cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-logout:hover { border-color: var(--color-danger, #e11d48); color: var(--color-danger, #e11d48); background: var(--color-danger-soft, #fbe3e8); }

/* Main */
.main-content { margin-top: 56px; padding: 16px; }

/* Card */
.card {
    background: var(--surface-card, #ffffff);
    border-radius: var(--radius-xl, 16px);
    border: 1px solid var(--border-divider, #eef2f6);
    padding: 18px;
    box-shadow: 0 1px 3px var(--shadow-sm, rgba(15,23,42,0.06));
    margin-bottom: 16px;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border-divider, #eef2f6);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary, #0f172a); }
/* 卡片右上角那组按钮：标题永远只一个，动作可能有几个，靠这一层收在右边不换行 */
.card-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* 说明条里的代码片段（命令、字段名），比正文窄一档、不抢视线 */
.card-desc code {
    font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
    font-size: 12px;
    padding: 1px 5px;
    border-radius: var(--radius-sm, 4px);
    background: var(--surface-header, #f1f5f9);
    color: var(--text-primary, #0f172a);
}
/* 说明条：左边一道主色竖线把"这是解释，不是数据"标出来 */
.card-desc {
    font-size: 13px; color: var(--text-muted, #5c6a7d); line-height: 1.7;
    padding: 10px 14px;
    background: var(--surface-soft, #f8fafc);
    border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
    margin-bottom: 12px;
    border-left: 3px solid var(--color-primary, #4f46e5);
}

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 11px 14px; text-align: center; border-bottom: 1px solid var(--border-divider, #eef2f6);
    font-size: 13px;
    /* 行背景默认透明：这样 tr:hover 的浅底才画得出来（td 自己带底色的话会把行的 hover 盖掉） */
    background: transparent;
    transition: background-color 0.15s;
}
.data-table th {
    background: var(--surface-soft, #f8fafc); color: var(--text-muted, #5c6a7d);
    font-weight: 600; font-size: 12px; letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border-base, #e2e8f0);
    white-space: nowrap;
}
/* 首列贴着卡片圆角，不该有硬边：表头左上角跟着卡片一起收圆 */
.data-table th:first-child { border-top-left-radius: var(--radius-md, 8px); }
.data-table th:last-child { border-top-right-radius: var(--radius-md, 8px); }
.data-table tbody tr:hover { background: var(--surface-soft, #f8fafc); }
.data-table > tbody > tr:last-child > td { border-bottom: none; }
.data-table .actions { white-space: nowrap; }
.data-table .actions .btn-link + .btn-link { margin-left: 6px; }

/* Status badge —— 胶囊形，浅底 + 同族深字（soft-text 已保证对卡片底 ≥4.5:1） */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 10px; border-radius: var(--radius-full, 999px);
    font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.badge-normal, .badge-success { background: var(--color-success-soft, #e0eeea); color: var(--color-success-soft-text, #047857); }
.badge-hidden, .badge-warning { background: var(--color-warning-soft, #f6eae0); color: var(--color-warning-soft-text, #92400e); }
.badge-closed, .badge-danger { background: var(--color-danger-soft, #fbe3e8); color: var(--color-danger-soft-text, #be123c); }
.badge-info { background: var(--color-info-soft, #dff0f8); color: var(--color-info-soft-text, #0369a1); }
/* 中性态：既不是成功也不是风险（"未设置""已解绑"这类），别借主色浅底 */
.badge-neutral { background: var(--surface-header, #f1f5f9); color: var(--text-muted, #5c6a7d); }

/* Modal */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: color-mix(in srgb, var(--shadow-base, rgb(15,23,42)) 50%, transparent); z-index: 200;
    justify-content: center; align-items: flex-start; padding-top: 60px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--surface-card, #ffffff); border-radius: var(--radius-lg, 12px);
    width: 520px; max-width: 90vw;
    max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 30px var(--shadow-md, rgba(15,23,42,0.10));
}
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border-divider, #eef2f6);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 30px; height: 30px; border: none; background: none;
    font-size: 18px; cursor: pointer; color: var(--text-muted, #5c6a7d);
    border-radius: var(--radius-full, 999px);
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface-header, #f1f5f9); color: var(--text-primary, #0f172a); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px; border-top: 1px solid var(--border-divider, #eef2f6);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* Form */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; margin-bottom: 6px; font-size: 13px;
    color: var(--text-secondary, #475569); font-weight: 500;
}
.form-label .required { color: var(--color-danger, #e11d48); margin-left: 2px; }
.form-control {
    width: 100%; height: 36px; padding: 0 12px;
    border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px); font-size: 13px; color: var(--text-primary, #0f172a);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface-card, #ffffff);
}
.form-control:hover { border-color: var(--text-placeholder, #94a3b8); }
.form-control:focus { outline: none; border-color: var(--color-primary, #4f46e5); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint-primary, rgb(79,70,229)) 10%, transparent); }
.form-control::placeholder { color: var(--text-placeholder, #94a3b8); }
.form-control:disabled { background: var(--surface-header, #f1f5f9); color: var(--text-muted, #5c6a7d); cursor: not-allowed; }
select.form-control {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c0c4cc'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 28px; cursor: pointer;
}
/* textarea 没有 height 36 的份：靠 padding 会挤掉行高，单独回退成上下留白 */
textarea.form-control { height: auto; padding: 8px 12px; resize: vertical; min-height: 80px; line-height: 1.6; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
/* 控件下方的说明文字：小一号、弱一档，别和标签抢 */
.field-hint { margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--text-muted, #5c6a7d); }

/* 勾选行：label 本身就是命中区域，比"文字 + 远处一个小方框"好点 */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 0;
}

.form-checkbox {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary, #4f46e5);
}

.form-checkbox:focus-visible {
    outline: 2px solid var(--color-primary, #4f46e5);
    outline-offset: 1px;
}

/* 表格里"看得懂就行、不该抢视线"的次要列。
   选择器带 .data-table 是为了压过 .data-table td 的 13px 字号（权重相同、靠后覆盖） */
.data-table .cell-muted { font-size: 12px; color: var(--text-muted, #5c6a7d); }
.data-table .cell-soft  { font-size: 12px; color: var(--text-secondary, #475569); }
.cell-empty { color: var(--text-placeholder, #94a3b8); }

/* Permission tree */
.perm-tree {
    max-height: 300px; overflow-y: auto; border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px); padding: 10px 12px; background: var(--surface-soft, #f8fafc);
}
.perm-tree-item { padding: 4px 0; }
.perm-tree-item label {
    cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 4px; border-radius: var(--radius-xs, 2px); transition: background-color 0.15s;
}
.perm-tree-item label:hover { background: color-mix(in srgb, var(--tint-primary, rgb(79,70,229)) 6%, transparent); }
.perm-tree-item input[type="checkbox"] {
    width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent, #4f46e5); margin: 0;
}
.perm-tree-item .children { padding-left: 22px; border-left: 1px dashed var(--border-input, #cbd5e1); margin-left: 7px; }

/* Toast —— 深色胶囊、底部居中：顶部有外壳的 toast 位与页签，底部这条视线不打架，
   而且深底白字在四套主题下都是最醒的一档。语义靠左侧那道色条区分，不整体染色。 */
.toast {
    position: fixed; left: 50%; bottom: 32px; z-index: 99999;
    padding: 11px 18px 11px 14px; border-radius: var(--radius-lg, 12px); font-size: 13px;
    max-width: 60vw;
    background: var(--text-primary, #0f172a); color: var(--surface-card, #ffffff);
    box-shadow: 0 10px 30px -8px var(--shadow-lg, rgba(15,23,42,0.14));
    opacity: 0; pointer-events: none;
    transform: translate(-50%, 14px);
    transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { box-shadow: inset 3px 0 0 var(--color-success, #047857), 0 10px 30px -8px var(--shadow-lg, rgba(15,23,42,0.14)); }
.toast-error { box-shadow: inset 3px 0 0 var(--color-danger, #e11d48), 0 10px 30px -8px var(--shadow-lg, rgba(15,23,42,0.14)); }

/* Loading */
.loading { text-align: center; padding: 44px 0; color: var(--text-muted, #5c6a7d); font-size: 13px; }

/* Empty —— 空表/无搜索结果：一句话说明，比一片空白更不容易被当成"加载失败" */
.empty {
    text-align: center; padding: 48px 16px; color: var(--text-placeholder, #94a3b8); font-size: 13px;
    line-height: 1.8;
}
.empty .fa { display: block; font-size: 26px; margin-bottom: 8px; }

/* Tree indent */
.tree-spacer { color: var(--text-placeholder, #94a3b8); font-size: 12px; }

/* Search bar */
.search-bar {
    display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: flex-end;
    padding: 14px 16px; background: var(--surface-card, #ffffff);
    border: 1px solid var(--border-divider, #eef2f6);
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 1px 3px var(--shadow-sm, rgba(15,23,42,0.06));
}
.search-bar .form-group { margin-bottom: 0; }
.search-bar .form-control { min-width: 160px; }

/* Pagination */
.pagination {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-secondary, #475569);
}
.pagination button {
    height: 30px; padding: 0 12px; border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-card, #ffffff); cursor: pointer; font-size: 13px; color: var(--text-primary, #0f172a);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}
.pagination button:hover { border-color: var(--color-primary, #4f46e5); color: var(--color-primary, #4f46e5); }
.pagination button:active { background: var(--color-primary-soft, #e9e8fc); }
.pagination button:disabled { opacity: 0.45; cursor: not-allowed; }
.pagination .page-size-select {
    height: 30px; padding: 0 8px; border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px);
    font-size: 13px; color: var(--text-primary, #0f172a); background: var(--surface-card, #ffffff); cursor: pointer;
    transition: border-color 0.2s;
}
.pagination .page-size-select:hover { border-color: var(--text-placeholder, #94a3b8); }
.pagination .page-size-select:focus { outline: none; border-color: var(--color-primary, #4f46e5); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint-primary, rgb(79,70,229)) 10%, transparent); }
.pagination-wrap { margin-top: 16px; }
.pagination-wrap .pagination { margin-top: 0; }

/* Form divider */
.form-divider {
    font-size: 13px; font-weight: 600; color: var(--text-secondary, #475569); padding: 10px 0 6px;
    margin-top: 8px; border-top: 1px solid var(--border-base, #e2e8f0);
}

/* Confirm Dialog */
/* Confirm Dialog —— 交互层置顶：必须盖过 dc-modal/浮动窗(≤10001)、富文本全屏与 toast(99999)；
   唯一保留在其上的是 AdminPermission 无权限遮罩 perm-veil(100000)，安全屏不可被确认框绕过 */
.confirm-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: color-mix(in srgb, var(--shadow-base, rgb(15,23,42)) 45%, transparent); z-index: 100000;
    justify-content: center; align-items: center;
}
.confirm-overlay.show { display: flex; }
.confirm-dialog {
    background: var(--surface-card, #ffffff); border-radius: var(--radius-xl, 16px);
    padding: 30px 32px 20px;
    width: 380px; max-width: 90vw; text-align: center;
    box-shadow: 0 12px 40px var(--shadow-lg, rgba(15,23,42,0.14)); position: relative;
}
.confirm-close {
    position: absolute; top: 10px; right: 12px;
    width: 30px; height: 30px; border: none; background: none;
    font-size: 18px; cursor: pointer; color: var(--text-muted, #5c6a7d);
    border-radius: var(--radius-full, 999px);
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.15s, color 0.15s;
}
.confirm-close:hover { background: var(--surface-header, #f1f5f9); color: var(--text-primary, #0f172a); }
.confirm-icon { font-size: 42px; color: var(--color-primary, #4f46e5); margin-bottom: 14px; }
.confirm-msg {
    font-size: 14px; color: var(--text-primary, #0f172a); line-height: 1.6;
    margin-bottom: 24px; word-break: break-word;
    /* 文案用 textContent 写入（不解析 HTML，防注入），换行只能由 white-space 还原 */
    white-space: pre-line;
}
.confirm-btns { display: flex; justify-content: center; gap: 12px; }
.confirm-btns .btn { min-width: 80px; justify-content: center; }

/* Floating Dialog System */
.float-dialog-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--mask-dialog, rgba(15,23,42,0.40));
}
.float-dialog {
    position: fixed; z-index: 9000;
    background: var(--surface-card, #ffffff); border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 30px var(--shadow-lg, rgba(15,23,42,0.14));
    display: flex; flex-direction: column;
    min-width: 320px; min-height: 120px;
    transition: width 0.2s, height 0.2s;
}
.float-dialog.maximized {
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    border-radius: 0; transition: none;
}
.float-dialog.minimized {
    display: none;
}
.float-dialog-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; height: 40px; cursor: move; user-select: none;
    background: var(--surface-soft, #f8fafc); border-bottom: 1px solid var(--border-base, #e2e8f0);
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
    flex-shrink: 0;
}
.float-dialog.maximized .float-dialog-header { border-radius: 0; }
.float-dialog-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary, #0f172a);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.float-dialog-title .float-data-hint { color: var(--color-primary, #4f46e5); font-weight: 400; }
.float-dialog-controls { display: flex; gap: 2px; flex-shrink: 0; }
.float-dialog-controls button {
    width: 28px; height: 28px; border: none; background: none;
    font-size: 14px; cursor: pointer; color: var(--text-muted, #5c6a7d); border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.float-dialog-controls button:hover { background: var(--border-base, #e2e8f0); color: var(--text-primary, #0f172a); }
.float-dialog-controls .float-close-btn:hover { background: var(--color-danger-solid, #be123c); color: var(--color-danger-solid-text, #ffffff); }
.float-dialog-body {
    flex: 1; overflow-y: auto; padding: 16px 20px;
}
.float-dialog-footer {
    padding: 10px 20px; border-top: 1px solid var(--border-divider, #eef2f6);
    display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}
.float-dock {
    /* 8999 只是"没有带遮罩的浮窗时"的基准层：有遮罩时 admin-common.js 的 _syncMask()
       会按当前顶层浮窗现算一个行内 z-index 把它抬到遮罩之上、顶层浮窗之下，
       好让最小化掉的窗口随时能点回来（行内样式，优先级高于这里） */
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 8999;
    display: flex; gap: 4px; padding: 4px 8px;
    background: var(--border-divider, #eef2f6); border-top: 1px solid var(--border-base, #e2e8f0);
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
}
.float-dock::-webkit-scrollbar { display: none; }
.float-dock:empty { display: none; }
.float-dock-item {
    padding: 4px 8px 4px 12px; background: var(--surface-card, #ffffff); border-radius: 4px 4px 0 0;
    font-size: 12px; cursor: pointer; border: 1px solid var(--border-base, #e2e8f0); border-bottom: none;
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex-shrink: 0; display: flex; align-items: center; gap: 6px;
}
.float-dock-item:hover { background: var(--surface-active, #eef2ff); }
.float-dock-item .dock-close {
    width: 16px; height: 16px; border: none; background: none;
    font-size: 12px; cursor: pointer; color: var(--text-muted, #5c6a7d); border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; padding: 0; line-height: 1;
}
.float-dock-item .dock-close:hover { background: var(--color-danger-solid, #be123c); color: var(--color-danger-solid-text, #ffffff); }
.float-dock-item .dock-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
 * 右侧滑出抽屉（Drawer）—— 和浮窗的分工写在这一处，别各页自己选
 *   抽屉：新增/编辑这类要填一整列的表单、以及只读详情。关掉后人回到列表原位，
 *         中间只留一个纵向滚动区，不用一边滚一边躲窗口。
 *   浮窗：要最小化/拖动/多开的工具窗（图标选择器、嵌 iframe 看页面），
 *         以及"改着 A 顺手看一眼 B"的非模态场合。
 *   确认框：一两句说得清的破坏性动作，别拿抽屉装。
 * 宽度走 .drawer / .drawer-lg 两个类，不让 JS 塞行内 style：响应式和换肤只改 CSS。
 * ============================================================ */
.drawer-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9000;
    background: var(--mask-dialog, rgba(15,23,42,0.40));
    opacity: 0; transition: opacity 0.25s;
}
.drawer-mask.show { opacity: 1; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 9001;
    display: flex; flex-direction: column;
    width: 420px; max-width: 94vw;
    background: var(--surface-card, #ffffff);
    box-shadow: -18px 0 44px -16px var(--shadow-lg, rgba(15,23,42,0.14));
    transform: translateX(100%); transition: transform 0.3s;
}
.drawer.show { transform: translateX(0); }
.drawer-lg { width: 640px; }
.drawer-header {
    flex-shrink: 0; height: 60px; padding: 0 20px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border-divider, #eef2f6);
}
.drawer-title {
    font-size: 15px; font-weight: 600; color: var(--text-primary, #0f172a);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.drawer-close {
    flex-shrink: 0; width: 30px; height: 30px; padding: 0;
    border: none; background: var(--surface-header, #f1f5f9);
    color: var(--text-muted, #5c6a7d);
    border-radius: var(--radius-full, 999px);
    font-size: 18px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.15s, color 0.15s;
}
.drawer-close:hover { background: var(--color-danger-soft, #fbe3e8); color: var(--color-danger-soft-text, #be123c); }
.drawer-body {
    flex: 1; overflow-y: auto; padding: 20px;
    /* 抽屉比窗口窄，字段上下再松一点才不挤 */
    overscroll-behavior: contain;
}
.drawer-footer {
    flex-shrink: 0; padding: 14px 20px;
    border-top: 1px solid var(--border-divider, #eef2f6);
    display: flex; justify-content: flex-end; gap: 8px;
}
/* 一行放到底的操作：主放在右，次放在主左边（和弹窗同一取向） */
.drawer-footer .btn { min-width: 80px; }

/* Organization form groups */
.org-form-group { margin-bottom: 18px; }
.org-form-group-title {
    font-size: 14px; font-weight: 600; color: var(--text-secondary, #475569);
    padding: 8px 0 6px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border-base, #e2e8f0);
    border-left: 3px solid var(--color-primary, #4f46e5); padding-left: 10px;
}

/* Upload: image */
.org-upload-wrap { position: relative; }
.org-upload-preview {
    width: 120px; height: 120px; border: 1px dashed var(--border-input, #cbd5e1);
    border-radius: var(--radius-md, 8px); cursor: pointer; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-soft, #f8fafc); transition: border-color 0.2s;
}
.org-upload-preview:hover { border-color: var(--color-primary, #4f46e5); }
.org-preview-img { width: 100%; height: 100%; object-fit: cover; }
.org-upload-placeholder {
    text-align: center; color: var(--text-placeholder, #94a3b8); font-size: 12px; line-height: 1.6;
}
.org-upload-placeholder i { font-size: 24px; }

/* Upload: file */
.org-upload-file-info {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
    font-size: 13px; color: var(--text-secondary, #475569);
}
.org-file-name { color: var(--text-muted, #5c6a7d); }
.org-upload-btn { margin-top: 2px; }

/* Multi-select checkboxes */
.org-multi-select {
    display: flex; flex-wrap: wrap; gap: 4px 10px;
    border: 1px solid var(--border-input, #cbd5e1); border-radius: var(--radius-md, 8px); padding: 10px 12px;
    background: var(--surface-soft, #f8fafc); transition: border-color 0.2s;
}
.org-multi-select:hover { border-color: var(--text-placeholder, #94a3b8); }
.org-checkbox-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--text-secondary, #475569); cursor: pointer;
    padding: 3px 6px; border-radius: 3px; user-select: none;
    transition: background 0.15s;
}
.org-checkbox-label:hover { background: color-mix(in srgb, var(--tint-primary, rgb(79,70,229)) 6%, transparent); }
.org-checkbox-label input[type="checkbox"] {
    width: 15px; height: 15px; cursor: pointer; accent-color: var(--color-primary, #4f46e5); margin: 0;
}

/* Rich text area */
.org-rich-text {
    resize: vertical; min-height: 100px; line-height: 1.6;
    font-family: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content { padding: 12px; }
    .modal { width: 95vw; }
}

/* ============================================================
 * 一键换肤（index.html 顶栏按钮 + 主题面板）
 * 颜色一律走 token；过渡仅限背景/文字/边框/阴影
 * ============================================================ */
.topbar-icon-btn {
    width: 30px; height: 30px; border-radius: var(--radius-md, 8px);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; cursor: pointer;
    /* 按钮元素自带边框与底色，这里复位成"就是个图标"，换肤后跟随 token 变色 */
    border: none; padding: 0; background: transparent;
    color: var(--text-secondary, #475569);
    transition: background-color 0.15s, color 0.15s;
}
.topbar-icon-btn:hover {
    background: var(--surface-header, #f1f5f9);
    color: var(--color-primary, #4f46e5);
}
/* 面板挂在按钮下方：定位基准由这层包裹给出，不写在 HTML 的行内样式上 */
.theme-switch-wrap { position: relative; }
.theme-panel {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    min-width: 200px; padding: 6px;
    background: var(--surface-card, #ffffff);
    border: 1px solid var(--border-input, #cbd5e1);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 4px 16px var(--shadow-md, rgba(15,23,42,0.10));
    z-index: 1000;
    /* 收起是默认态，admin-theme.js 只在 .theme-panel 上加/去 .show */
    display: none;
}
.theme-panel.show { display: block; }
.theme-panel-title {
    padding: 6px 10px; font-size: 12px;
    color: var(--text-muted, #5c6a7d);
}
.theme-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 4px; cursor: pointer;
    font-size: 13px; color: var(--text-primary, #0f172a);
    transition: background-color 0.15s, color 0.15s;
}
.theme-item:hover { background: var(--surface-header, #f1f5f9); }
.theme-item.active { background: var(--surface-active, #eef2ff); }
.theme-swatch {
    width: 26px; height: 26px; border-radius: 6px;
    border: 2px solid; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    /* 这两项是"被预览的那个主题"自己的底色与主色，由脚本按主题注册表写进来。
       故意不跟当前主题走——面板要的就是"切过去长什么样"，跟了 token 就全一个色。
       给默认值是为了脚本没来得及写时也不是一块透明空框。 */
    background: var(--swatch-surface, #f6f7fb);
    border-color: var(--swatch-color, #4f46e5);
}
.theme-swatch .fa { color: var(--swatch-color, #4f46e5); }
.theme-item-name { flex: 1; white-space: nowrap; }
.theme-item-check { color: var(--color-primary, #4f46e5); font-size: 13px; }

/* ============================================================
 * 树形列表（菜单管理 / 角色组管理 等）：折叠展开 + 层级路径行
 * 从 menu-manage.css 上移，保证各列表页的层级交互是同一套观感
 * ============================================================ */

.tree-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 2px;
}

.tree-toolbar-left {
    display: flex;
    gap: 6px;
}

/* 折叠/展开这类工具栏按钮比通用 .btn-sm 再矮一点，两页（菜单管理、角色组管理）保持同一观感 */
.tree-toolbar .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.tree-hint {
    font-size: 12px;
    color: var(--text-muted, #5c6a7d);
}

.tree-hint .fa {
    margin-right: 3px;
}

.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: var(--text-muted, #5c6a7d);
    font-size: 12px;
    border-radius: 3px;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.tree-toggle:hover {
    background: var(--surface-active, #eef2ff);
    color: var(--color-primary, #4f46e5);
}

.tree-toggle-placeholder {
    display: inline-block;
    width: 18px;
    flex-shrink: 0;
}

.tree-indent {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}

.tree-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.tree-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 弹性容器里必须给 min-width:0，省略号才会真的生效（默认 min-width:auto 会顶宽） */
    min-width: 0;
}

/* 标题后面的徽章不参与截断：宁可折行也不能把「只读」这种提示切掉 */
.tree-collapsed-badge,
.tree-path-badge {
    flex-shrink: 0;
}

.tree-collapsed-badge {
    display: inline-block;
    background: var(--surface-active, #eef2ff);
    color: var(--color-primary, #4f46e5);
    font-size: 11px;
    padding: 0 6px;
    border-radius: 8px;
    margin-left: 4px;
    font-weight: 500;
}

/* 为"挂住命中子级"而补进来的父级行：整体弱化，避免被当成查询结果。
   选择器层级与 .data-table > tbody > tr > td 对齐，否则会被它的 transparent 背景盖掉 */
.data-table > tbody > tr.tree-path-row > td {
    background: var(--surface-soft, #f8fafc);
    color: var(--text-muted, #5c6a7d);
}

tr.tree-path-row .tree-title-text {
    color: var(--text-muted, #5c6a7d);
}

.tree-path-badge {
    display: inline-block;
    background: var(--surface-header, #f1f5f9);
    border: 1px solid var(--border-divider, #eef2f6);
    color: var(--text-muted, #5c6a7d);
    font-size: 11px;
    line-height: 16px;
    padding: 0 5px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 400;
}

/* --- 只读附件明细（审核详情等业务数据明细共用） --- */
.ac-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    justify-content: space-around;
}

.ac-attach {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    border: 1px solid var(--border-base, #e2e8f0);
    border-radius: 4px;
    background: var(--surface-soft, #f8fafc);
    padding: 4px 6px;
    font-size: 12px;
    color: var(--text-secondary, #475569);
}

.ac-attach-image {
    flex-direction: column;
    align-items: center;
    width: 92px;
    cursor: pointer;
}

.ac-attach-image img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    background: var(--surface-header, #f1f5f9);
}

.ac-attach-image:hover {
    border-color: var(--color-primary, #4f46e5);
}

.ac-attach-file:hover {
    border-color: var(--color-primary, #4f46e5);
}

.ac-attach-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-attach-image .ac-attach-name {
    max-width: 88px;
    text-align: center;
}

.ac-attach-file .ac-attach-name {
    color: var(--color-primary, #4f46e5);
    text-decoration: none;
}

/* ---------------- 审核详情「业务数据明细」的醒目标记随审核插件一起走 ----------------
   这套 .audit-diff-* 原本在这里，但它服务的是审核插件的详情页，骨架里没有使用者；
   留在公共层等于让核心样式表替插件背一段配色说明。插件页的样式归插件自己的 css，
   故此处删除。 */

.ac-preview-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-soft, #f8fafc);
    overflow: auto;
}

.ac-preview-img {
    max-width: 100%;
    max-height: calc(100% - 32px);
    object-fit: contain;
}

.ac-preview-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    font-size: 12px;
    color: var(--text-muted, #5c6a7d);
}

.ac-preview-download {
    color: var(--color-primary, #4f46e5);
}

/* ============================================================
 * 抽屉里的键值详情行 + 说明条（.kv-*）
 * 从 menu-manage.css 的 .menu-view-row 与 plugin-manage.css 的 .plg-detail-row 上移：
 * 两页本来就画的是同一种东西（左侧标签 + 右侧值 + 底部分隔线），各自留一份
 * 就会开始漂移（标签列一个 96px 一个 92px 已经是结果）。
 * 第三类内容（图标预览、配置正文）仍留在各自页里，它们不是同一形状。
 * ============================================================ */

/* 抽屉里"一节一节"的小标题：详情超过十行时必须分组，否则人找不到自己要的那一列 */
.kv-section-title {
    margin: 18px 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .4px;
    color: var(--text-muted, #5c6a7d);
}

.kv-section-title:first-child {
    margin-top: 0;
}

.kv-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.6;
    border-radius: var(--radius-md, 8px);
    background: var(--surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
    box-shadow: inset 0 0 0 1px var(--border-divider, #eef2f6);
}

.kv-note .fa {
    margin-top: 3px;
    color: var(--color-warning, #b45309);
}

.kv-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 2px;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid var(--border-divider, #eef2f6);
}

.kv-row:last-child {
    border-bottom: none;
}

.kv-label {
    flex-shrink: 0;
    width: 96px;
    color: var(--text-muted, #5c6a7d);
}

.kv-value {
    flex: 1;
    min-width: 0;
    color: var(--text-primary, #0f172a);
    word-break: break-all;
    white-space: pre-wrap;
}

/* ============================================================
 * 显隐：JS 里不用 style.display 手工开关，统一切这个 class
 * （从 menu-manage.css 上移——各页都有"这一栏此刻不该出现"的时刻，
 *   内联样式和 CSS 打架之后就只能靠刷新碰运气）
 * ============================================================ */

.field-hidden {
    display: none;
}
