/* policy-ex55.css */
body.policy-admin-page {font-family: 'Inter', sans-serif;
            background: #08080e;
            color: #e0e0e0;
            min-height: 100vh;
            padding: 24px;}

* { margin: 0; padding: 0; box-sizing: border-box; }
        
        .container { max-width: 1400px; margin: 0 auto; }

        /* 页头 */
        .page-head {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
        }
        .page-head .title {
            font-family: 'Orbitron', sans-serif; font-size: 20px; font-weight: 700;
            background: linear-gradient(90deg, #00f0ff, #00ffc8);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        }
        .page-head .sub { font-size: 12px; color: #4a6a8a; margin-top: 4px; }
        .head-actions { display: flex; gap: 8px; align-items: center; }
        .user-chip {
            padding: 6px 12px; border-radius: 8px; font-size: 12px;
            background: rgba(0,255,200,0.06); border: 1px solid rgba(0,255,200,0.2);
            color: #00ffc8;
        }
        .btn {
            padding: 7px 16px; border-radius: 8px; border: 1px solid rgba(0,240,255,0.2);
            background: rgba(0,240,255,0.06); color: #00f0ff; font-size: 13px;
            cursor: pointer; transition: 0.2s; font-family: 'Inter', sans-serif;
        }
        .btn:hover { background: rgba(0,240,255,0.14); }
        .btn.warn { color: #ff6b6b; border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.05); }
        .btn.primary {
            background: linear-gradient(135deg, #00f0ff, #00c8a0); color: #060610; border: none; font-weight: 600;
        }
        .btn:disabled { opacity: 0.4; cursor: not-allowed; }

        /* 登录门 */
        .gate {
            background: rgba(10,14,26,0.9); border: 1px solid rgba(0,240,255,0.12);
            border-radius: 14px; padding: 32px; max-width: 420px; margin: 60px auto;
            text-align: center;
        }
        .gate h2 { color: #00f0ff; font-size: 16px; margin-bottom: 6px; }
        .gate p { color: #5a6a8a; font-size: 12px; margin-bottom: 16px; }
        .gate input {
            width: 100%; padding: 10px 14px; margin-bottom: 10px;
            background: #0a0a14; border: 1px solid #1a1a30; border-radius: 8px;
            color: #e0e0e0; font-size: 13px; outline: none;
        }
        .gate input:focus { border-color: #00f0ff; }
        .gate .err { color: #ff6b6b; font-size: 12px; margin-top: 8px; min-height: 18px; }
        .gate .login-btn {
            width: 100%; padding: 10px; border: none; border-radius: 8px;
            background: linear-gradient(135deg, #00f0ff, #00c8a0); color: #060610;
            font-weight: 600; cursor: pointer; font-size: 13px;
        }

        /* 矩阵 */
        .matrix-card {
            background: rgba(10,14,26,0.9); border: 1px solid rgba(0,240,255,0.08);
            border-radius: 14px; padding: 20px; overflow-x: auto;
        }
        .matrix-card .mc-head {
            display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px;
        }
        .mc-head .t { font-size: 14px; font-weight: 600; color: #00f0ff; }
        .mc-head .dirty-hint { font-size: 12px; color: #ffb400; display: none; }
        table.policy-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
        .policy-table th, .policy-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: center; }
        .policy-table th { font-size: 12px; color: #4a6a8a; font-weight: 500; }
        .policy-table th.role-col { text-align: left; min-width: 110px; }
        .policy-table td.role-col {
            text-align: left; font-size: 13px; font-weight: 600; color: #b0c0d0;
            white-space: nowrap;
        }
        .policy-table td.role-col .en { font-size: 10px; color: #4a6a8a; font-weight: 400; }
        .policy-table tr:hover td { background: rgba(255,255,255,0.02); }

        .seg-mini { display: flex; gap: 2px; justify-content: center; }
        .seg-mini button {
            border: 1px solid transparent; background: transparent; color: #3a4a5a;
            width: 30px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 11px;
            transition: 0.15s; font-family: 'Inter', sans-serif;
        }
        .seg-mini button:hover { color: #8ab0d0; }

        /* 页面权限矩阵 */
        .page-perm-table .pg-code { font-family: 'JetBrains Mono', monospace; color: #00f0ff; font-size: 12px; }
        .pg-cell {
            border: 1px solid transparent; border-radius: 6px; padding: 4px 10px;
            font-size: 11px; cursor: pointer; min-width: 52px; transition: 0.15s;
            font-family: 'Inter', sans-serif;
        }
        .pg-cell.pg-deny { background: rgba(255,107,107,0.12); color: #ff6b6b; border-color: rgba(255,107,107,0.25); }
        .pg-cell.pg-read { background: rgba(255,180,0,0.12); color: #ffb400; border-color: rgba(255,180,0,0.25); }
        .pg-cell.pg-allow { background: rgba(0,255,200,0.12); color: #00ffc8; border-color: rgba(0,255,200,0.25); }
        .pg-cell:hover { filter: brightness(1.15); }
        .seg-mini button.on-allow { background: rgba(0,255,200,0.12); color: #00ffc8; border-color: rgba(0,255,200,0.25); }
        .seg-mini button.on-deny { background: rgba(255,107,107,0.1); color: #ff6b6b; border-color: rgba(255,107,107,0.25); }
        .seg-mini button.on-confirm { background: rgba(255,180,0,0.1); color: #ffb400; border-color: rgba(255,180,0,0.25); }
        .seg-mini button.dirty { box-shadow: 0 0 8px rgba(255,180,0,0.3); }

        /* 状态条 */
        .toast {
            position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(16px);
            padding: 10px 20px; border-radius: 10px; font-size: 13px;
            background: rgba(10,16,30,0.96); border: 1px solid rgba(0,240,255,0.3);
            box-shadow: 0 8px 30px rgba(0,0,0,0.5); color: #e0f0ff; z-index: 300;
            opacity: 0; pointer-events: none; transition: 0.3s;
        }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
        .toast.ok { border-color: rgba(0,255,200,0.4); }
        .toast.err { border-color: rgba(255,107,107,0.4); }

        .legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: #4a6a8a; flex-wrap: wrap; }
        .legend .lg { display: flex; align-items: center; gap: 6px; }
        .legend .dot { width: 10px; height: 10px; border-radius: 3px; }
        .legend .d-allow { background: rgba(0,255,200,0.4); }
        .legend .d-deny { background: rgba(255,107,107,0.4); }
        .legend .d-confirm { background: rgba(255,180,0,0.4); }

        /* ===== 标签页 ===== */
        .tabs-row { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
        .tab-btn {
            padding: 8px 18px; border-radius: 8px; border: 1px solid rgba(0,240,255,0.12);
            background: rgba(0,240,255,0.04); color: #5a6a8a; font-size: 13px;
            cursor: pointer; transition: 0.2s; font-family: 'Inter', sans-serif; font-weight: 500;
        }
        .tab-btn:hover { color: #8ab0d0; }
        .tab-btn.active {
            color: #00f0ff; background: rgba(0,240,255,0.1);
            border-color: rgba(0,240,255,0.3); box-shadow: 0 0 12px rgba(0,240,255,0.1);
        }
        .tab-panel { display: none; }
        .tab-panel.active { display: block; }

        /* ===== 策略矩阵引导 ===== */
        .guide-bar {
            display: flex; align-items: flex-start; gap: 10px;
            padding: 10px 14px; margin-bottom: 14px;
            background: rgba(0,240,255,0.04); border: 1px solid rgba(0,240,255,0.14);
            border-radius: 10px; font-size: 12px; color: #8ab0d0; line-height: 1.8;
        }
        .guide-bar b { color: #00f0ff; font-weight: 600; }
        .guide-bar .g-close { margin-left: auto; cursor: pointer; color: #4a6a8a; flex-shrink: 0; }
        .guide-bar .g-close:hover { color: #ff6b6b; }
        .policy-table tr.locked td { opacity: 0.6; }
        .policy-table td.role-col .r-info { cursor: help; color: #3a5a7a; margin-left: 4px; font-size: 11px; }
        .wildcard-badge {
            display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px;
            background: rgba(255,255,255,0.05); color: #6a8aaa; border: 1px dashed rgba(255,255,255,0.15);
            white-space: nowrap;
        }
        .policy-table .seg-mini button { position: relative; }
        .policy-table .seg-mini button::after {
            content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%;
            transform: translateX(-50%) translateY(-2px); background: #0a1020; border: 1px solid rgba(0,240,255,0.2);
            color: #b0c0d0; font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
            opacity: 0; pointer-events: none; transition: 0.15s; z-index: 10;
        }
        .policy-table .seg-mini button:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

        /* ===== 用户管理 ===== */
        .create-user {
            display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
            padding: 14px; background: rgba(255,255,255,0.02);
            border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; margin-bottom: 16px;
        }
        .create-user input, .create-user select {
            background: #0a0a14; border: 1px solid #1a1a30; border-radius: 8px;
            padding: 8px 12px; color: #e0e0e0; font-size: 12px; outline: none;
            font-family: 'Inter', sans-serif;
        }
        .create-user input:focus, .create-user select:focus { border-color: #00f0ff; }
        .create-user .cu-label { font-size: 11px; color: #4a6a8a; }
        table.user-table { width: 100%; border-collapse: collapse; }
        .user-table th, .user-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: left; font-size: 12px; }
        .user-table th { color: #4a6a8a; font-weight: 500; white-space: nowrap; }
        .user-table td .u-name { color: #e0f0ff; font-weight: 600; }
        .user-table td .u-id { color: #4a6a8a; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
        .badge-role { padding: 2px 10px; border-radius: 12px; font-size: 11px; }
        .badge-role.r-admin { background: rgba(255,107,107,0.12); color: #ff6b6b; }
        .badge-role.r-executive { background: rgba(0,240,255,0.12); color: #00f0ff; }
        .badge-role.r-manager { background: rgba(0,255,200,0.12); color: #00ffc8; }
        .badge-role.r-staff { background: rgba(168,85,247,0.12); color: #c084fc; }
        .badge-role.r-guest { background: rgba(255,255,255,0.06); color: #8a9aaa; }
        .badge-status { padding: 2px 10px; border-radius: 12px; font-size: 11px; }
        .badge-status.s-active { background: rgba(0,255,200,0.1); color: #00ffc8; }
        .badge-status.s-disabled { background: rgba(255,107,107,0.1); color: #ff6b6b; }
        .row-ops { display: flex; gap: 4px; flex-wrap: wrap; }
        .row-ops select {
            background: #0a0a14; border: 1px solid #1a1a30; border-radius: 6px;
            color: #b0c0d0; font-size: 11px; padding: 3px 6px; outline: none;
            font-family: 'Inter', sans-serif;
        }
        .mini-btn {
            background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.15);
            color: #8ab0d0; font-size: 11px; padding: 3px 8px; border-radius: 6px; cursor: pointer; transition: 0.15s;
        }
        .mini-btn:hover { color: #00f0ff; border-color: rgba(0,240,255,0.3); }
        .mini-btn.danger { color: #ff9a9a; border-color: rgba(255,107,107,0.2); background: rgba(255,107,107,0.05); }
        .mini-btn.danger:hover { color: #ff6b6b; }

        /* ===== 审计日志 ===== */
        .audit-filters { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
        .audit-filters select, .audit-filters input {
            background: #0a0a14; border: 1px solid #1a1a30; border-radius: 8px;
            padding: 7px 12px; color: #e0e0e0; font-size: 12px; outline: none;
            font-family: 'Inter', sans-serif;
        }
        .audit-filters select:focus, .audit-filters input:focus { border-color: #00f0ff; }
        table.audit-table { width: 100%; border-collapse: collapse; }
        .audit-table th, .audit-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); text-align: left; font-size: 12px; }
        .audit-table th { color: #4a6a8a; font-weight: 500; white-space: nowrap; }
        .audit-table td.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #8a9aaa; }
        .audit-table td.cmd { color: #e0f0ff; }
        .tag-result { padding: 1px 8px; border-radius: 10px; font-size: 10px; }
        .tag-result.success { background: rgba(0,255,200,0.12); color: #00ffc8; }
        .tag-result.denied { background: rgba(255,107,107,0.12); color: #ff6b6b; }
        .tag-result.confirmed { background: rgba(255,180,0,0.12); color: #ffb400; }
        .tag-result.cancelled { background: rgba(168,85,247,0.12); color: #c084fc; }

        /* ===== 确认/输入弹窗 ===== */
        .sso-btn {
            width: 100%; padding: 10px; border: 1px solid rgba(168,85,247,0.3);
            border-radius: 8px; background: rgba(168,85,247,0.08); color: #c084fc;
            font-weight: 500; cursor: pointer; font-size: 13px; transition: 0.2s;
            font-family: 'Inter', sans-serif;
        }
        .sso-btn:hover { background: rgba(168,85,247,0.16); }
        .divider { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
        .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
        .divider span { color: #4a6a8a; font-size: 11px; }

        .sso-ident { display: flex; align-items: center; justify-content: space-between; gap: 10px;
            padding: 12px 14px; border: 1px solid rgba(168,85,247,0.15); border-radius: 10px;
            background: rgba(168,85,247,0.04); margin-bottom: 8px; flex-wrap: wrap; }
        .sso-ident .si-name { color: #e0f0ff; font-size: 13px; font-weight: 600; }
        .sso-ident .si-meta { color: #4a6a8a; font-size: 11px; margin-top: 2px; }
        .sso-ident .si-ops { display: flex; gap: 6px; }
        .empty-tip { color: #4a6a8a; font-size: 12px; padding: 20px; text-align: center; }

        /* ===== 确认/输入弹窗 ===== */
        .modal-mask {
            position: fixed; inset: 0; z-index: 400;
            background: rgba(3,6,15,0.72); backdrop-filter: blur(6px);
            display: none; align-items: center; justify-content: center;
        }
        .modal-mask.show { display: flex; }
        .modal {
            width: 400px; max-width: 92vw;
            background: rgba(12,18,34,0.98);
            border: 1px solid rgba(0,240,255,0.18);
            border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,0.6);
            padding: 20px;
        }
        .modal .m-title { color: #00f0ff; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
        .modal .m-body { color: #b0c0d0; font-size: 13px; line-height: 1.6; }
        .modal .m-body input {
            width: 100%; margin-top: 8px; padding: 9px 12px;
            background: #0a0a14; border: 1px solid #1a1a30; border-radius: 8px;
            color: #e0e0e0; font-size: 13px; outline: none; font-family: 'Inter', sans-serif;
        }
        .modal .m-body input:focus { border-color: #00f0ff; }
        .modal .m-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

body.policy-admin-page {
    background: #08080e !important;
    color: #e0e0e0 !important;
}

.gov-json-editor {
    width: 100%;
    min-height: 280px;
    margin-top: 12px;
    padding: 12px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    background: #0a0a14;
    border: 1px solid #1a1a30;
    border-radius: 8px;
    color: #c8e6ff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 12px;
}
.data-table th, .data-table td {
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 10px;
    text-align: left;
}
.data-table th { color: #00ffc8; background: rgba(0,255,200,0.04); }
