/* CA478 本地 UI 样式（内网可用，不依赖 CDN） */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; color: #212529; background: #f8f9fa; }
a { color: #0d6efd; text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: .5rem; font-weight: 600; }
p { margin-top: 0; margin-bottom: 1rem; }
pre { white-space: pre-wrap; word-break: break-word; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 12px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row.g-2 > *, .row.g-3 > * { padding: 0 8px; }
.g-3 { gap: 12px; }
.col-12,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-lg-4,.col-lg-8 { padding: 0 8px; width: 100%; }
@media (min-width: 768px) {
  .col-md-3 { width: 25%; flex: 0 0 25%; }
  .col-md-4 { width: 33.333%; flex: 0 0 33.333%; }
  .col-md-5 { width: 41.666%; flex: 0 0 41.666%; }
  .col-md-6 { width: 50%; flex: 0 0 50%; }
  .col-md-7 { width: 58.333%; flex: 0 0 58.333%; }
  .col-md-8 { width: 66.666%; flex: 0 0 66.666%; }
}
@media (min-width: 992px) {
  .col-lg-4 { width: 33.333%; flex: 0 0 33.333%; }
  .col-lg-8 { width: 66.666%; flex: 0 0 66.666%; }
}

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.fw-bold { font-weight: 700; }
.d-inline { display: inline; }
.flex-grow-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.min-vh-100 { min-height: 100vh; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.text-success { color: #198754; }
.text-danger { color: #dc3545; }
.text-white { color: #fff; }
.text-white-50 { color: rgba(255,255,255,.6); }
.bg-light { background: #f8f9fa; }
.bg-dark { background: #212529; }
.bg-primary { background: #0d6efd; color: #fff; }
.bg-secondary { background: #6c757d; color: #fff; }
.bg-warning { background: #ffc107; color: #000; }
.bg-danger { background: #dc3545; color: #fff; }
.small { font-size: 12px; }
.font-monospace { font-family: ui-monospace, Consolas, monospace; }
.shadow-sm { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075); }

.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-auto { margin-top: auto; }
.me-2 { margin-right: 8px; } .ms-2 { margin-left: 8px; }
.p-3 { padding: 12px; } .p-4 { padding: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-5 { padding-top: 32px; padding-bottom: 32px; }
.pt-4 { padding-top: 16px; }

.card { background: #fff; border: 1px solid #dee2e6; border-radius: 8px; margin-bottom: 16px; }
.card-header { padding: 10px 14px; background: #f8f9fa; border-bottom: 1px solid #dee2e6; font-weight: 600; border-radius: 8px 8px 0 0; }
.card-body { padding: 14px; }
.stat-card { border-left: 4px solid #0d6efd; }

.btn { display: inline-block; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 14px; text-align: center; background: #e9ecef; color: #212529; }
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn-primary { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.btn-success { background: #198754; border-color: #198754; color: #fff; }
.btn-warning { background: #ffc107; border-color: #ffc107; color: #000; }
.btn-danger, .btn-outline-danger { border-color: #dc3545; color: #dc3545; background: #fff; }
.btn-outline-secondary { border-color: #6c757d; color: #6c757d; background: #fff; }
.btn-outline-primary { border-color: #0d6efd; color: #0d6efd; background: #fff; }
.btn-outline-light { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.form-label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-control, .form-select { display: block; width: 100%; padding: 8px 10px; border: 1px solid #ced4da; border-radius: 6px; font-size: 14px; background: #fff; }
.form-control-sm, .form-select-sm { padding: 4px 8px; font-size: 12px; }
.form-check { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.form-text { font-size: 12px; color: #6c757d; margin-top: 4px; }

.table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid #dee2e6; text-align: left; vertical-align: top; }
.table thead th { background: #f8f9fa; font-weight: 600; font-size: 13px; }
.table-hover tbody tr:hover { background: #f8f9fa; }
.table-sm th, .table-sm td { padding: 6px 8px; font-size: 13px; }
.table-responsive { overflow-x: auto; }

.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-success { background: #d1e7dd; border-color: #badbcc; color: #0f5132; }
.alert-danger { background: #f8d7da; border-color: #f5c2c7; color: #842029; }
.alert-info { background: #cff4fc; border-color: #b6effb; color: #055160; }
.alert-warning { background: #fff3cd; border-color: #ffecb5; color: #664d03; }

.badge { display: inline-block; padding: 3px 8px; font-size: 11px; border-radius: 4px; font-weight: 600; }

.nav { list-style: none; padding: 0; margin: 0; }
.nav-item { margin-bottom: 4px; }
.nav-link { display: block; padding: 8px 12px; color: inherit; border-radius: 6px; }
.nav-link:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.15); }
.nav-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #dee2e6; padding-bottom: 8px; margin-bottom: 12px; }
.nav-tabs .nav-link { background: #e9ecef; color: #495057; }
.nav-tabs .nav-link.active { background: #0d6efd; color: #fff; }
.nav-pills .nav-link.active { background: rgba(255,255,255,.2); }

.border-top { border-top: 1px solid #dee2e6; }
.border-secondary { border-color: #6c757d !important; }

.h4 { font-size: 1.25rem; } .h5 { font-size: 1.1rem; } .h6 { font-size: 1rem; }

:root { --ca478-sidebar-width: 240px; }
.ca478-sidebar { width: var(--ca478-sidebar-width); min-height: 100vh; flex-shrink: 0; display: flex; flex-direction: column; }
.ca478-main { flex: 1; min-width: 0; padding: 16px 20px; }
@media (max-width: 991px) {
  .ca478-sidebar { width: 100%; min-height: auto; }
  body > .d-flex { flex-direction: column; }
}
