/* AdminLTE 扁平化风格 - 后台管理样式 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #495057;
    background-color: #f4f6f9;
}

body.admin-layout {
    overflow-x: hidden;
}

/* ========== 主容器 ========== */
.admin-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: #f4f6f9;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 250px;
    background-color: #343a40;
    color: #c2c7d0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    background-color: #2c3136;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo i {
    font-size: 24px;
    color: #007bff;
}

.menu {
    padding: 10px 0;
    list-style: none;
    margin: 0;
}

.menu-section-title {
    padding: 10px 20px 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #c2c7d0;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.menu a span {
    white-space: nowrap;
}

.menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: #007bff;
}

.menu a.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border-left-color: #007bff;
}

/* 侧边栏折叠 */
.admin-shell.sidebar-collapsed .sidebar {
    width: 64px;
}

.admin-shell.sidebar-collapsed .sidebar .logo span {
    display: none;
}

.admin-shell.sidebar-collapsed .menu a span {
    display: none;
}

.admin-shell.sidebar-collapsed .menu-section-title {
    display: none;
}

.admin-shell.sidebar-collapsed .content-wrapper {
    margin-left: 64px;
}

/* ========== 内容区域 ========== */
.content-wrapper {
    flex: 1;
    margin-left: 250px;
    transition: margin-left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background-color: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #495057;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 15px;
    transition: color 0.2s;
}

.sidebar-toggle:hover {
    color: #007bff;
}

.page-title {
    font-size: 18px;
    font-weight: 500;
    color: #212529;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content {
    flex: 1;
    padding: 20px;
}

/* ========== 卡片样式 ========== */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #495057;
}

/* ========== 按钮样式 ========== */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-outline-light {
    border: 1px solid #dee2e6;
    color: #6c757d;
    background-color: transparent;
}

.btn-outline-light:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* ========== 表格样式 ========== */
.table {
    width: 100%;
    margin-bottom: 0;
    background-color: transparent;
}

.table-dark {
    color: #212529;
    background-color: #fff;
}

.table-dark thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding: 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-dark tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-dark tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
}

/* ========== 表单样式 ========== */
.form-control,
.form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-select-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-item {
    margin-bottom: 15px;
}

.form-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-item input[type="text"],
.form-item input[type="number"],
.form-item input[type="password"],
.form-item textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-item input:focus,
.form-item textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========== 徽章样式 ========== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-success {
    background-color: #28a745;
    color: #fff;
}

.bg-warning {
    background-color: #ffc107;
    color: #212529;
}

.bg-danger {
    background-color: #dc3545;
    color: #fff;
}

.bg-secondary {
    background-color: #6c757d;
    color: #fff;
}

/* ========== 链接样式 ========== */
.link-light {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

.link-light:hover {
    color: #0056b3;
    text-decoration: underline;
}

.link-danger {
    color: #dc3545;
    text-decoration: none;
    transition: color 0.2s;
}

.link-danger:hover {
    color: #c82333;
    text-decoration: underline;
}

/* ========== 导航标签页 ========== */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    padding: 10px 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: #dee2e6;
    color: #495057;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: transparent;
}

/* ========== 模态框样式 ========== */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
}

/* ========== 工具类 ========== */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.text-muted {
    color: #6c757d;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }

/* ========== 卡片内容 ========== */
.card-body {
    padding: 20px;
}

.metric-icon {
    opacity: 0.3;
}

.text-warning {
    color: #ffc107;
}

.text-danger {
    color: #dc3545;
}

.text-primary {
    color: #007bff;
}

.text-muted {
    color: #6c757d;
}

h3 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

h6 {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

/* ========== Bootstrap 工具类补充 ========== */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.flex-fill {
    flex: 1 1 auto;
}

.gap-2 {
    gap: 0.5rem;
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col-md-3,
.col-md-4,
.col-md-6,
.col-md-12 {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-3 {
        width: 25%;
    }
    
    .col-md-4 {
        width: 33.3333%;
    }
    
    .col-md-6 {
        width: 50%;
    }
    
    .col-md-12 {
        width: 100%;
    }
}

.g-2 {
    gap: 0.5rem;
}

.g-3 {
    gap: 1rem;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .admin-shell.sidebar-collapsed .sidebar {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
}
