/* ========== 全局样式 ========== */
* {
    box-sizing: border-box;
}

.backend-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

.backend-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== 顶部导航栏 ========== */
.backend-header {
    height: 60px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.logo {
    display: flex;
    align-items: center;
    margin-right: 40px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.logo i {
    font-size: 24px;
    margin-right: 10px;
}

.logo-text {
    color: #fff;
}

.top-nav {
    flex: 1;
}

.top-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-nav-item {
    position: relative;
}

.top-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.top-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.top-nav-item.active .top-nav-link {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

.top-nav-link i {
    margin-right: 6px;
    font-size: 16px;
}

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

.user-dropdown {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.user-info i.fa-user-circle {
    font-size: 24px;
    margin-right: 8px;
}

.user-info .username {
    margin-right: 8px;
    font-weight: 500;
}

.user-info .fa-chevron-down {
    font-size: 12px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    list-style: none;
    display: none;
    z-index: 1001;
}

.user-dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f5f7fa;
    color: #27ae60;
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    color: #6c757d;
}

.dropdown-item:hover i {
    color: #27ae60;
}

.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 8px 0;
}

.login-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.login-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ========== 主体内容区域 ========== */
.backend-main {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* ========== 左侧边栏 ========== */
.backend-sidebar {
    width: 240px;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.side-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-nav-item {
    margin: 2px 0;
}

.side-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
}

.side-nav-link:hover {
    background-color: #f0f7f4;
    color: #27ae60;
    padding-left: 24px;
}

.side-nav-item.active > .side-nav-link {
    background-color: #e8f5e9;
    color: #27ae60;
    font-weight: 600;
    border-left: 3px solid #27ae60;
}

.side-nav-link i:first-child {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
    color: #6c757d;
}

.side-nav-item.active > .side-nav-link i:first-child,
.side-nav-link:hover i:first-child {
    color: #27ae60;
}

.side-nav-link .fa-angle-left {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #999;
}

.side-nav-item.has-treeview.menu-open > .side-nav-link .fa-angle-left {
    transform: rotate(-90deg);
}

/* 子菜单 */
.side-nav-treeview {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #fafbfc;
    display: none;
}

.side-nav-item.has-treeview.menu-open > .side-nav-treeview {
    display: block;
}

.side-nav-treeview .side-nav-link {
    padding-left: 52px;
    font-size: 13px;
    color: #666;
}

.side-nav-treeview .side-nav-link:hover {
    padding-left: 56px;
    background-color: #f0f7f4;
    color: #27ae60;
}

.side-nav-treeview .side-nav-item.active > .side-nav-link {
    background-color: #e8f5e9;
    color: #27ae60;
    font-weight: 500;
}

/* ========== 右侧内容区 ========== */
.backend-content {
    flex: 1;
    margin-left: 240px;
    background: #f5f7fa;
    min-height: calc(100vh - 60px);
}

.content-header {
    background: #fff;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 8px 0;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 0;
}

.breadcrumb-label {
    color: #6c757d;
    margin-right: 8px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-inline {
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
}

.breadcrumb-item {
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.breadcrumb-item a {
    color: #27ae60;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #adb5bd;
    margin: 0 8px;
    display: inline-block;
}

.content-body {
    padding: 0 24px 24px;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fafbfc;
    border-radius: 8px 8px 0 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.card-title i {
    margin-right: 8px;
    color: #27ae60;
}

.card-body {
    padding: 20px;
}

/* ========== 列表 & 搜索通用样式 ========== */
.search-card {
    margin-bottom: 20px;
}

.search-form-row {
    margin: 0;
}

.search-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 0;
}

.search-input-group {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-search {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.quick-search-input {
    width: 100%;
}

.search-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toggle-advanced {
    margin-left: 0;
}

.toggle-advanced i {
    margin-left: 4px;
    font-size: 0.85em;
}

/* 新增按钮使用主色调绿色 */
.btn-new {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: #27ae60;
    color: #fff;
}

.btn-new:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    border-color: #229954;
    color: #fff;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0;
}

.action-buttons .btn,
.action-buttons .btn-group {
    white-space: nowrap;
}

/* 高级搜索区域 */
.advanced-search {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.advanced-search-content {
    width: 100%;
}

.advanced-search .row {
    margin: 0;
}

.advanced-search .col-md-3 {
    padding-left: 15px;
    padding-right: 15px;
}

/* GridView 分页与留白 */
.grid-wrapper {
    padding: 0 16px 16px;
}

.pagination-top,
.pagination-bottom {
    padding: 8px 0;
}

.pagination {
    margin: 0;
    justify-content: center;
}

.pagination .page-link {
    color: #27ae60;
}

.pagination .page-item.active .page-link {
    background-color: #27ae60;
    border-color: #27ae60;
}

.pagination .page-link:hover {
    color: #229954;
}

/* 下拉菜单样式 */
.dropdown-menu {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
}

.dropdown-item {
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #27ae60;
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* GridView 操作图标样式 */
.grid-action-cell {
    white-space: nowrap;
}

.grid-action-cell .grid-action-icon {
    margin-right: 6px;
    font-size: 1.4rem;
}

.grid-action-cell .grid-action-icon:last-child {
    margin-right: 0;
}

/* ========== 统计卡片 ========== */
.small-box {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: block;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.small-box.bg-info {
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
}

.small-box.bg-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.small-box.bg-warning {
    background: linear-gradient(135deg, #f39c12 0%, #f7dc6f 100%);
}

.small-box.bg-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #ec7063 100%);
}

.small-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.small-box .inner {
    padding: 20px;
    color: #fff;
}

.small-box .inner h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #fff;
}

.small-box .inner p {
    font-size: 15px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.small-box .icon {
    position: absolute;
    right: 20px;
    top: 20px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 70px;
    z-index: 0;
}

.small-box:hover .icon {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

.small-box .small-box-footer {
    background-color: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.9);
    display: block;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.small-box .small-box-footer:hover {
    background-color: rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* ========== 按钮样式 ========== */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: #27ae60;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    border-color: #229954;
}

.btn-outline-primary {
    border-color: #27ae60;
    color: #27ae60;
}

.btn-outline-primary:hover {
    background-color: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

/* ========== 表格样式 ========== */
.table {
    background: #fff;
    margin-bottom: 0;
}

.table thead th {
    background-color: #fafbfc;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: #495057;
    padding: 12px;
    font-size: 14px;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

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

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    font-size: 14px;
    color: #555;
}

/* ========== 信息框 ========== */
.info-box {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background-color: #fff;
    display: flex;
    margin-bottom: 20px;
    min-height: 80px;
    border: 1px solid #e9ecef;
}

.info-box-icon {
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    color: #fff;
    font-size: 32px;
}

.bg-gradient-primary .info-box-icon {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    padding: 16px 20px;
}

.info-box-text {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 4px;
}

.info-box-number {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

/* ========== 页脚 ========== */
/* Footer 已移除，相关样式已删除 */

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .backend-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .backend-content {
        margin-left: 0;
    }
    
    .top-nav {
        display: none;
    }
}

/* ========== 滚动条美化 ========== */
.backend-sidebar::-webkit-scrollbar {
    width: 6px;
}

.backend-sidebar::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.backend-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.backend-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========== 其他组件 ========== */
code {
    background-color: #f4f4f4;
    border-radius: 4px;
    color: #e83e8c;
    font-size: 87.5%;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
}

.badge {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    /* 略微加深的浅绿色，保持柔和不刺眼 */
    background-color: #e3f2e8 !important;
    border-color: #c1e3cf !important;
    color: #21613a !important;
}

.alert-danger {
    /* 略微加浅的红色，保持提示清晰但不刺眼 */
    background-color: #fbeaec !important;
    border-color: #f4cfd4 !important;
    color: #8a1f30 !important;
}

.alert-info {
    /* 略微加浅的蓝色信息提示 */
    background-color: #e6f3f7 !important;
    border-color: #c9e3ee !important;
    color: #14546b !important;
}

/* ========== Kartik TreeView（行政区域树）细节调整 ========== */
/* 树节点、根节点、标题、搜索条字体稍微放大一点，提升可读性 */
.kv-tree-container .kv-tree,
.kv-tree-container .kv-tree .kv-node-label,
.kv-tree-container .kv-tree-root,
.kv-header-container .kv-heading-container,
.kv-header-container .kv-search-container,
.kv-header-container .kv-search-input {
    font-size: 14px !important;
}

/* 底部工具栏按钮区放大（树左侧底部刷新等按钮） */
.kv-footer-container .kv-toolbar-container {
    font-size: 14px;
}

.kv-footer-container .kv-toolbar-container .btn,
.kv-footer-container .kv-toolbar-container .kv-toolbar-btn {
    font-size: 14px !important;
    padding: 10px 10px !important;
    min-height: 20px;
}

/* 右侧详情区顶部保存/重置按钮放大 */
.kv-detail-container .kv-detail-heading .btn {
    font-size: 15px !important;
    padding: 10px 18px !important;
    min-height: 40px;
}
.kv-detail-container .kv-detail-heading .btn.btn-sm {
    font-size: 15px !important;
    padding: 10px 18px !important;
}

/* 右侧编辑表单区域字体与全局表单保持一致 */
.kv-detail-container {
    font-size: 14px;
}

.kv-detail-container .form-control,
.kv-detail-container label,
.kv-detail-container .control-label {
    font-size: 14px;
}

