/* 精简管理后台样式 - 替代Bootstrap */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.5; color: #212529; background-color: #f8f9fa; }

/* Container */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 15px; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }

/* Flex */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* Navbar */
.navbar { background: #007ACC; color: white; padding: 0.75rem 1rem; margin-bottom: 0; }
.navbar .container-fluid { display: flex; justify-content: space-between; align-items: center; max-width: 100%; }
.navbar-brand { color: white; text-decoration: none; font-size: 1.1rem; font-weight: 500; }
.navbar .text-white { color: white; }

/* Card */
.card { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 1.5rem; }
.card-header { padding: 0.75rem 1rem; border-bottom: 1px solid #e9ecef; font-weight: 600; }
.card-body { padding: 1rem; }
.stat-card { text-align: center; padding: 0.75rem 0.5rem; }
.stat-num { font-size: 1.5rem; font-weight: 600; color: #007ACC; margin: 0; line-height: 1.2; }
.stat-label { margin-top: 0.25rem; color: #666; font-size: 0.8rem; white-space: nowrap; }

/* Row & Col */
.row { display: flex; flex-wrap: wrap; margin: 0 -0.5rem; }
.row-cols-3 > * { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 0.5rem; }
.row-cols-md-6 > * { flex: 0 0 16.666%; max-width: 16.666%; }
.col { flex: 1; padding: 0 0.5rem; }
.col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; padding: 0 0.5rem; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 0.5rem; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 0.5rem; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.5rem; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; padding: 0 0.5rem; }
.g-2 { gap: 0.5rem; }
.g-3 { gap: 1rem; }

/* Buttons */
.btn { display: inline-block; padding: 0.375rem 0.75rem; font-size: 0.875rem; border: 1px solid transparent; border-radius: 4px; cursor: pointer; text-decoration: none; text-align: center; transition: all 0.15s; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: #007ACC; color: white; border-color: #007ACC; }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-info { background: #17a2b8; color: white; }
.btn-outline-light { background: transparent; color: white; border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); }
.btn-outline-primary { background: white; color: #007ACC; border-color: #007ACC; }
.btn-outline-secondary { background: white; color: #6c757d; border-color: #6c757d; }
.btn-outline-danger { background: white; color: #dc3545; border-color: #dc3545; }
.btn-outline-success { background: white; color: #28a745; border-color: #28a745; }
.btn-outline-warning { background: white; color: #ffc107; border-color: #ffc107; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-light { background: white; color: #212529; }
.btn.active { background: white; color: #007ACC; }
.w-100 { width: 100%; }

/* Badge */
.badge { display: inline-block; padding: 0.25em 0.5em; font-size: 0.75rem; font-weight: 600; line-height: 1; border-radius: 3px; white-space: nowrap; }
.bg-primary { background: #007ACC; color: white; }
.bg-secondary { background: #6c757d; color: white; }
.bg-success { background: #28a745; color: white; }
.bg-danger { background: #dc3545; color: white; }
.bg-warning { background: #ffc107; color: #212529; }
.bg-info { background: #17a2b8; color: white; }
.text-dark { color: #212529; }
.text-white { color: white; }
.fs-6 { font-size: 1rem; }

/* Table */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead { background: #f8f9fa; }
.table th, .table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #dee2e6; }
.table tbody tr:hover { background: #f8f9fa; }
.text-center { text-align: center; }
.text-muted { color: #6c757d; }

/* Form */
.form-label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-control, .form-select { display: block; width: 100%; padding: 0.375rem 0.75rem; font-size: 0.875rem; border: 1px solid #ced4da; border-radius: 4px; }
.form-control:focus, .form-select:focus { outline: none; border-color: #007ACC; box-shadow: 0 0 0 2px rgba(0,122,204,0.25); }
.form-control-sm, .form-select-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.form-check { display: flex; align-items: center; margin-bottom: 0.5rem; }
.form-check-input { margin-right: 0.5rem; }
.form-check-label { cursor: pointer; }
.font-monospace { font-family: monospace; }

/* Pagination */
.pagination { display: flex; list-style: none; gap: 0.25rem; }
.pagination-sm .page-item { font-size: 0.75rem; }
.page-item { display: inline-block; }
.page-link { display: block; padding: 0.375rem 0.75rem; color: #007ACC; text-decoration: none; border: 1px solid #dee2e6; border-radius: 4px; }
.page-link:hover { background: #e9ecef; }
.page-item.active .page-link { background: #007ACC; color: white; border-color: #007ACC; }
.page-item.disabled .page-link { color: #6c757d; pointer-events: none; opacity: 0.5; }
.pagination-info { font-size: 0.9rem; color: #666; }

/* Modal */
.modal { display: none; position: fixed; z-index: 1050; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); overflow: auto; }
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-dialog { background: white; border-radius: 8px; max-width: 500px; width: 90%; margin: 1rem; }
.modal-lg { max-width: 800px; }
.modal-content { border-radius: 8px; }
.modal-header { padding: 1rem; border-bottom: 1px solid #dee2e6; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.modal-body { padding: 1rem; }
.modal-footer { padding: 1rem; border-top: 1px solid #dee2e6; display: flex; justify-content: flex-end; gap: 0.5rem; }
.btn-close { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; opacity: 0.5; }
.btn-close:hover { opacity: 1; }

/* Alert */
.alert { padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 4px; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* Utility */
.text-end { text-align: right; }
small { font-size: 0.875em; }
.code-cell { font-family: monospace; font-size: 0.85rem; }
.permission-badge { font-size: 0.75rem; }

/* Tabs */
.nav-tabs { display: flex; border-bottom: 2px solid #dee2e6; margin-bottom: 1.5rem; list-style: none; padding: 0; gap: 0; }
.nav-tabs .nav-item { margin-bottom: -2px; list-style: none; }
.nav-tabs .nav-link { display: block; padding: 0.75rem 1.5rem; color: #495057; text-decoration: none; border: 2px solid transparent; border-bottom: none; background: transparent; cursor: pointer; transition: all 0.15s; font-family: inherit; font-size: 14px; }
.nav-tabs .nav-link:hover { color: #007ACC; background: #f8f9fa; }
.nav-tabs .nav-link.active { color: #007ACC; background: white; border-color: #dee2e6 #dee2e6 white; font-weight: 600; }
.tab-content { display: block; }
.tab-pane { display: none; }
.tab-pane.show.active { display: block; }
.tab-pane.active { display: block; }

/* List Group */
.list-group { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; }
.list-group-item { position: relative; display: block; padding: 0.75rem 1rem; background-color: #fff; border: 1px solid rgba(0,0,0,.125); margin-bottom: -1px; }
.list-group-item:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; }
.list-group-item:last-child { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }

/* Additional utilities */
.flex-grow-1 { flex-grow: 1; }
.btn-group { display: inline-flex; }
.btn-group .btn { margin-left: -1px; border-radius: 0; }
.btn-group .btn:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.btn-group .btn:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.ms-3 { margin-left: 1rem; }
.ms-2 { margin-left: 0.5rem; }
.float-end { float: right; }
.d-inline-block { display: inline-block; }
.w-auto { width: auto; }

/* Responsive */
@media (max-width: 768px) {
    .row-cols-md-6 > * { flex: 0 0 50%; max-width: 50%; }
    .col-md-2, .col-md-3, .col-md-4, .col-md-6, .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
