/* ============================================================================
 * 少典 · 后台专业版样式（Admin Pro）
 * 覆盖于 admin.css 之上：组件紧凑化、弹窗最大化、表格、批量条、抽屉、外壳
 * ========================================================================= */

:root {
    --kt-accent: #2563eb;
    --kt-accent-weak: #eff6ff;
    --kt-ink: #0f172a;
    --kt-ink-2: #475569;
    --kt-ink-3: #94a3b8;
    --kt-line: #e6ebf2;
    --kt-bg: #f3f6fb;
    --kt-radius: 10px;
    --kt-shadow: 0 1px 2px rgba(15, 39, 68, .06), 0 8px 24px rgba(15, 39, 68, .04);
    --kt-top-h: 54px;
    --kt-side-w: 224px;
    --kt-side-w-min: 62px;
}

body.page-body,
body.page-wrap {
    background: var(--kt-bg);
}

.page-header {
    margin-bottom: 12px !important;
    align-items: center !important;
}

.page-header h2 {
    font-size: 17px !important;
    letter-spacing: .2px;
}

.page-desc {
    font-size: 12.5px !important;
    color: var(--kt-ink-3) !important;
    margin-top: 2px !important;
}

.page-desc.is-moved,
.page-desc[data-moved="1"] {
    display: none !important;
}

.filter-bar {
    padding: 10px 12px !important;
    gap: 8px 10px !important;
    margin-bottom: 12px !important;
    box-shadow: var(--kt-shadow);
}

.filter-field label {
    font-size: 11.5px !important;
}

.filter-bar .form-control-sm {
    height: 32px !important;
    min-width: 132px !important;
}

.card,
.card-panel,
.list-card {
    box-shadow: var(--kt-shadow) !important;
    border-color: var(--kt-line) !important;
}

.data-table-inner th,
.data-table th {
    padding: 9px 12px !important;
    font-size: 12.5px !important;
    color: var(--kt-ink-2) !important;
    white-space: nowrap;
    background: #f7f9fc !important;
}

.data-table-inner td,
.data-table td {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    line-height: 1.5;
}

.data-table-inner tr:hover td {
    background: #f8fafd;
}

.table-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--kt-radius);
}

.table-scroll-wrap > .data-table-inner,
.table-scroll-wrap > .data-table {
    min-width: 640px;
}

.kt-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--kt-ink-3);
    font-size: 13px;
}

.kt-empty strong {
    display: block;
    font-size: 14px;
    color: var(--kt-ink-2);
    margin-bottom: 4px;
}

.kt-skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: ktShimmer 1.3s ease infinite;
    border-radius: 6px;
}

@keyframes ktShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- 弹窗：最大化 ---------- */
.modal-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.modal-tool {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--kt-ink-3);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.modal-tool:hover {
    background: #eef2f8;
    color: var(--kt-ink);
}

.modal-dialog.modal-dialog--max,
.modal.is-max .modal-dialog {
    max-width: none !important;
    width: calc(100vw - 32px) !important;
    height: calc(100vh - 32px) !important;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.modal.is-max .modal-dialog > form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.modal.is-max .modal-body {
    max-height: none !important;
    flex: 1;
}

.modal.is-max .modal-header,
.modal.is-max .modal-footer {
    flex-shrink: 0;
}

/* ---------- 批量操作条 ---------- */
.kt-batch-bar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 140%);
    z-index: 1900;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .94);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .28);
    transition: transform .22s ease;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
}

.kt-batch-bar.is-show {
    transform: translate(-50%, 0);
}

.kt-batch-bar .kt-batch-count {
    color: #93c5fd;
    font-weight: 600;
    white-space: nowrap;
}

.kt-batch-bar .btn {
    height: 28px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .16);
    white-space: nowrap;
}

.kt-batch-bar .btn:hover {
    background: rgba(255, 255, 255, .22);
}

.kt-batch-bar .btn-danger {
    background: rgba(239, 68, 68, .82);
    border-color: transparent;
}

.kt-check-all,
.kt-check-row {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--kt-accent);
}

/* ---------- 内页浮动返回 ---------- */
.kt-back-float {
    position: fixed;
    left: 12px;
    bottom: 16px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 14px 0 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--kt-ink-2);
    border: 1px solid var(--kt-line);
    box-shadow: 0 6px 18px rgba(15, 39, 68, .12);
    font-size: 12.5px;
    cursor: pointer;
    opacity: .92;
}

.kt-back-float:hover {
    color: var(--kt-accent);
    border-color: #c7d9f7;
}

/* ---------- 二维码 ---------- */
.kt-qr svg,
.kt-qr img,
.kt-qr canvas {
    display: block;
    margin: 0 auto;
    border: 6px solid #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 39, 68, .12);
}

/* ---------- 打印 ---------- */
.kt-print-sheet {
    background: #fff;
    color: #000;
    padding: 16px;
}

.kt-print-sheet h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.kt-print-meta {
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
}

.kt-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.kt-print-table th,
.kt-print-table td {
    border: 1px solid #333;
    padding: 5px 7px;
    text-align: left;
}

.kt-print-table th {
    background: #f0f0f0;
}

@media print {
    body { background: #fff !important; }
    .no-print,
    .kt-back-float,
    .kt-batch-bar { display: none !important; }
    .data-table th { background: #eee !important; -webkit-print-color-adjust: exact; }
    @page { margin: 10mm; }
}

/* ---------- 按钮组 ---------- */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group > .btn {
    border-radius: 0;
    margin-left: -1px;
}

.btn-group > .btn:first-child {
    border-radius: 6px 0 0 6px;
    margin-left: 0;
}

.btn-group > .btn:last-child {
    border-radius: 0 6px 6px 0;
}

.btn-sm {
    height: 30px;
    padding: 0 11px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 7px;
}

.btn-default {
    background: #fff;
    border: 1px solid var(--kt-line);
    color: var(--kt-ink-2);
}

.btn-default:hover {
    border-color: #c7d9f7;
    color: var(--kt-accent);
    background: #f8fbff;
}

/* ---------- 数据字典 ---------- */
.dict-layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.dict-side {
    background: #fff;
    border: 1px solid var(--kt-line);
    border-radius: var(--kt-radius);
    box-shadow: var(--kt-shadow);
    overflow: hidden;
}

.dict-side__head {
    padding: 8px;
    border-bottom: 1px solid var(--kt-line);
}

.dict-side__list {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 4px;
}

.dict-type {
    display: block;
    padding: 7px 9px;
    border-radius: 7px;
    color: var(--kt-ink-2);
}

.dict-type:hover { background: #f4f7fc; }

.dict-type.is-active {
    background: var(--kt-accent-weak);
    color: var(--kt-accent);
}

.dict-type__name {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.dict-type__code {
    display: block;
    font-size: 11px;
    color: var(--kt-ink-3);
    font-family: ui-monospace, Consolas, monospace;
}

.dict-main {
    background: #fff;
    border: 1px solid var(--kt-line);
    border-radius: var(--kt-radius);
    box-shadow: var(--kt-shadow);
    padding: 12px 14px;
    min-height: 320px;
}

.dict-main__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--kt-line);
}

.dict-main__head h3 {
    margin: 0;
    font-size: 15px;
    color: var(--kt-ink);
}

.dict-main__head h3 small {
    font-weight: 400;
    font-size: 11.5px;
    color: var(--kt-ink-3);
    margin-left: 6px;
}

.dict-main__head p { margin: 3px 0 0; }

.dict-main .list-card { border: 0; box-shadow: none; }

@media (max-width: 860px) {
    .dict-layout { grid-template-columns: 1fr; }
    .dict-side__list { max-height: 220px; }
}
