/**
 * RuoYi 现代化主题美化覆盖层
 * 仅做视觉增强，不修改任何业务逻辑/HTML 结构
 * 加载顺序：放在所有基础 CSS 之后，确保生效
 * 如需回滚：从 include.html 移除此文件引用即可
 */

/* ========== 主题变量 ========== */
:root {
    --ry-primary: #4f7cff;
    --ry-primary-dark: #3b63e0;
    --ry-primary-soft: #eef3ff;
    --ry-success: #18b566;
    --ry-warning: #f5a623;
    --ry-danger: #f04f43;
    --ry-info: #36b9cc;
    --ry-text: #2c3e50;
    --ry-text-light: #6b7a8d;
    --ry-border: #e8ecf1;
    --ry-bg: #f4f6fb;
    --ry-card-bg: #ffffff;
    --ry-radius: 8px;
    --ry-radius-sm: 5px;
    --ry-shadow: 0 2px 12px rgba(31, 45, 61, 0.06);
    --ry-shadow-hover: 0 6px 20px rgba(31, 45, 61, 0.1);
    --ry-sidebar-bg: #1f2a44;
    --ry-sidebar-text: #a9b4c7;
    --ry-sidebar-active: #4f7cff;
    --ry-transition: all .2s ease;
}

/* ========== 全局基础 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--ry-bg) !important;
    color: var(--ry-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.gray-bg { background-color: var(--ry-bg) !important; }
.white-bg { background-color: var(--ry-card-bg) !important; }

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #c7d0dd;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #aeb9c9; }

/* ========== 内容容器 ========== */
.container-div {
    padding: 16px;
}

/* 搜索面板 */
.search-collapse {
    background: var(--ry-card-bg);
    border-radius: var(--ry-radius);
    box-shadow: var(--ry-shadow);
    padding: 18px 18px 4px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--ry-border) !important;
}
.search-collapse > form { margin: 0; }

.select-list ul { list-style: none; }

.select-list ul li {
    margin-bottom: 14px;
}

/* 输入框 / 下拉框统一 */
.form-control,
.select-list input[type="text"],
.select-list select,
.select-list .time-input {
    border: 1px solid #dce3ec !important;
    border-radius: var(--ry-radius-sm) !important;
    color: var(--ry-text);
    background-color: #fbfcfe !important;
    transition: var(--ry-transition);
    height: 34px;
    line-height: 1.42857143;
    box-shadow: none;
}
.form-control:hover,
.select-list input[type="text"]:hover,
.select-list select:hover {
    border-color: #b9c6d6 !important;
}
.form-control:focus,
.select-list input[type="text"]:focus,
.select-list select:focus,
.time-input:focus {
    border-color: var(--ry-primary) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12) !important;
    outline: none;
}
.select-list select { -webkit-appearance: none; appearance: none; }

/* ========== 按钮 ========== */
.btn {
    border-radius: var(--ry-radius-sm);
    transition: var(--ry-transition);
    font-weight: 500;
    letter-spacing: .2px;
}
.btn-sm { border-radius: 4px; }
.btn-rounded { border-radius: 50px !important; }

.btn:focus, .btn:active:focus { outline: none; }

/* 主色按钮 */
.btn-primary {
    background-color: var(--ry-primary) !important;
    border-color: var(--ry-primary) !important;
    box-shadow: 0 2px 6px rgba(79, 124, 255, .25);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ry-primary-dark) !important;
    border-color: var(--ry-primary-dark) !important;
    box-shadow: 0 4px 12px rgba(79, 124, 255, .35);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--ry-success) !important;
    border-color: var(--ry-success) !important;
    box-shadow: 0 2px 6px rgba(24, 181, 102, .22);
}
.btn-success:hover, .btn-success:focus {
    background-color: #159953 !important;
    border-color: #159953 !important;
    box-shadow: 0 4px 12px rgba(24, 181, 102, .32);
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--ry-warning) !important;
    border-color: var(--ry-warning) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(245, 166, 35, .22);
}
.btn-warning:hover, .btn-warning:focus {
    background-color: #e0940f !important;
    border-color: #e0940f !important;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--ry-danger) !important;
    border-color: var(--ry-danger) !important;
    box-shadow: 0 2px 6px rgba(240, 79, 67, .22);
}
.btn-danger:hover, .btn-danger:focus {
    background-color: #d83b30 !important;
    border-color: #d83b30 !important;
    transform: translateY(-1px);
}

.btn-info {
    background-color: var(--ry-info) !important;
    border-color: var(--ry-info) !important;
}
.btn-info:hover, .btn-info:focus {
    background-color: #289fb0 !important;
    border-color: #289fb0 !important;
}

/* 默认/轮廓按钮 */
.btn-default {
    background-color: #fff;
    border-color: #dce3ec;
    color: var(--ry-text-light);
}
.btn-default:hover {
    background-color: var(--ry-primary-soft);
    border-color: var(--ry-primary);
    color: var(--ry-primary);
}

/* 工具栏按钮组 */
#toolbar .btn,
.btn-group-sm .btn { margin-right: 6px; }

/* 禁用态柔化 */
.btn.disabled, .btn[disabled] { opacity: .55; box-shadow: none; transform: none !important; }

/* ========== 表格（bootstrap-table） ========== */
.fixed-table-body,
.table-striped table,
.select-table table {
    border-collapse: separate;
    border-spacing: 0;
}
.select-table {
    background: var(--ry-card-bg);
    border-radius: var(--ry-radius);
    box-shadow: var(--ry-shadow);
    border: 1px solid var(--ry-border);
    padding: 6px;
    margin-top: 4px;
}

.table > thead > tr > th {
    background-color: #f7f9fc !important;
    color: var(--ry-text-light) !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--ry-border) !important;
    letter-spacing: .3px;
    padding: 12px 8px !important;
}
.table > tbody > tr > td {
    border-top: 1px solid #f0f3f7 !important;
    padding: 10px 8px !important;
    color: var(--ry-text);
}
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafbfd;
}
.table-hover > tbody > tr:hover {
    background-color: var(--ry-primary-soft) !important;
}
.table > thead > tr > th .sortable { color: var(--ry-primary); }

/* bootstrap-table 分页 */
.pagination > li > a, .pagination > li > span {
    color: var(--ry-text-light);
    border: 1px solid var(--ry-border);
    margin: 0 2px;
    border-radius: var(--ry-radius-sm) !important;
}
.pagination > li > a:hover, .pagination > li > span:hover {
    background-color: var(--ry-primary-soft);
    color: var(--ry-primary);
    border-color: var(--ry-primary);
}
.pagination > .active > a, .pagination > .active > span,
.pagination > .active > a:hover, .pagination > .active > span:hover {
    background-color: var(--ry-primary) !important;
    border-color: var(--ry-primary) !important;
    color: #fff !important;
}

/* bootstrap-table 工具栏搜索框对齐 */
.fixed-table-toolbar .search input { border-radius: var(--ry-radius-sm); }

/* ========== 卡片面板（ibox） ========== */
.ibox {
    clear: both;
    margin-bottom: 20px;
    background: var(--ry-card-bg);
    border: 1px solid var(--ry-border);
    border-radius: var(--ry-radius);
    box-shadow: var(--ry-shadow);
}
.ibox-title {
    background-color: transparent;
    border-bottom: 1px solid var(--ry-border);
    padding: 14px 20px;
}
.ibox-title h5 { font-weight: 600; color: var(--ry-text); }
.ibox-content {
    background-color: #fff;
    border: none;
    padding: 20px;
}

/* 表单弹层内容区 */
.wrapper-content { padding: 16px; }
.ibox-content .form-horizontal .form-group { margin-bottom: 18px; }

.control-label { color: var(--ry-text); font-weight: 500; }

/* ========== 表单标签/必填星号 ========== */
.form-horizontal .required:after,
label.required:after { color: var(--ry-danger); }

/* ========== 侧边栏（左侧导航） ========== */
.navbar-default {
    background: var(--ry-sidebar-bg) !important;
}
.navbar-static-side {
    background: var(--ry-sidebar-bg);
    box-shadow: 2px 0 12px rgba(0,0,0,.08);
}

/* ========== LOGO 品牌区 ========== */
nav .logo {
    background: linear-gradient(135deg, rgba(79,124,255,.22), rgba(79,124,255,.05)) !important;
    height: 60px !important;
    line-height: 60px !important;
    width: 100% !important;
    padding: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: var(--ry-transition);
}
/* 顶部高光装饰条 */
nav .logo::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ry-primary), transparent);
    opacity: .7;
}
/* logo 链接仅去除下划线，不改变高度（避免遮挡菜单） */
nav .logo > a,
nav > a { text-decoration: none; }
nav .logo .logo-lg {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 19px !important;
    letter-spacing: 1.5px;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    display: inline-flex !important;
    align-items: center;
    line-height: 1;
    padding: 0 18px;
}
/* 文字前的圆角图标徽标 */
nav .logo .logo-lg::before {
    content: "G";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ry-primary), #6f5bff);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    font-family: "Segoe UI", Arial, sans-serif;
    box-shadow: 0 3px 10px rgba(79,124,255,.45);
    letter-spacing: 0;
}
/* 收起菜单时（mini-navbar）只显示徽标 */
body.mini-navbar nav .logo .logo-lg {
    font-size: 0 !important;
    padding: 0;
}
body.mini-navbar nav .logo .logo-lg::before {
    margin-right: 0;
    width: 34px;
    height: 34px;
    font-size: 18px;
}

.navbar-default .nav > li > a {
    color: var(--ry-sidebar-text);
    font-weight: 500;
    transition: var(--ry-transition);
    border-radius: var(--ry-radius-sm);
    margin: 2px 10px;
    padding: 11px 16px;
}
.navbar-default .nav > li > a:hover,
.navbar-default .nav > li > a:focus {
    background: rgba(255, 255, 255, .06) !important;
    color: #fff;
}
.navbar-default .nav > li.active > a,
.navbar-default .nav > li > a.active {
    background: var(--ry-sidebar-active) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(79, 124, 255, .35);
}
/* 二级/三级菜单 */
.nav-second-level li a,
.nav-third-level li a,
.nav-four-level li a {
    color: var(--ry-sidebar-text);
    padding: 9px 14px 9px 38px;
    transition: var(--ry-transition);
}
.nav-second-level li a:hover,
.nav-third-level li a:hover {
    background: rgba(255, 255, 255, .05) !important;
    color: #fff;
}

/* ========== 用户信息面板 ========== */
.sidebar-collapse .user-panel {
    margin: 10px 12px 14px;
    padding: 14px 14px !important;
    background: linear-gradient(135deg, rgba(79,124,255,.18), rgba(79,124,255,.04));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--ry-radius);
    transition: var(--ry-transition);
    overflow: visible;
}
.sidebar-collapse .user-panel:hover {
    background: linear-gradient(135deg, rgba(79,124,255,.26), rgba(79,124,255,.08));
    border-color: rgba(79,124,255,.35);
}
/* 头像容器 */
.sidebar-collapse .user-panel .image {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}
.sidebar-collapse .user-panel .image > img {
    width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    border: 2px solid rgba(79,124,255,.5) !important;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: var(--ry-transition);
    object-fit: cover;
}
.sidebar-collapse .user-panel:hover .image > img {
    border-color: var(--ry-primary) !important;
    transform: scale(1.05);
}
/* 头像在线状态指示点（通过 .text-success 节点叠加） */
.sidebar-collapse .user-panel .image {
    position: relative;
}
.sidebar-collapse .user-panel .image::after {
    content: "";
    position: absolute;
    right: 1px; bottom: 1px;
    width: 11px; height: 11px;
    background: #18b566;
    border: 2px solid #1f2a44;
    border-radius: 50%;
    z-index: 2;
}
/* 用户名 */
.sidebar-collapse .user-panel > .info {
    padding: 4px 0 0 54px !important;
    left: 14px !important;
    right: 14px;
}
.sidebar-collapse .user-panel > .info > p {
    color: #fff !important;
    font-weight: 600;
    font-size: 13px !important;
    margin-bottom: 7px !important;
    letter-spacing: .3px;
}
/* 状态链接（在线 / 注销） */
.sidebar-collapse .user-panel > .info > a {
    color: var(--ry-sidebar-text) !important;
    font-size: 12px;
    transition: var(--ry-transition);
    opacity: .85;
}
.sidebar-collapse .user-panel > .info > a:hover {
    color: #fff !important;
    opacity: 1;
}
/* 在线圆点改色 */
.sidebar-collapse .user-panel .text-success { color: #18b566 !important; }
.sidebar-collapse .user-panel .text-danger { color: var(--ry-danger) !important; }

/* 收起菜单时隐藏文字信息，头像居中 */
body.mini-navbar .sidebar-collapse .user-panel {
    padding: 10px 0 !important;
    text-align: center;
    overflow: hidden;
}
body.mini-navbar .sidebar-collapse .user-panel .image,
body.mini-navbar .sidebar-collapse .user-panel .image > img {
    margin: 0 auto;
    float: none;
}
body.mini-navbar .sidebar-collapse .user-panel > .info { display: none; }

/* ========== 顶部导航栏 ========== */
.navbar-static-top {
    background: #fff !important;
    border-bottom: 1px solid var(--ry-border) !important;
    box-shadow: 0 1px 6px rgba(31,45,61,.05);
}
.nav.navbar-top-links > li > a {
    color: var(--ry-text-light) !important;
    transition: var(--ry-transition);
    border-radius: var(--ry-radius-sm);
    margin: 6px 2px;
    height: 38px;
    padding: 8px 12px !important;
}
.nav.navbar-top-links > li > a:hover {
    background: var(--ry-primary-soft) !important;
    color: var(--ry-primary) !important;
}
.navbar-minimalize.minimalize-styl-2 {
    background: var(--ry-primary) !important;
    border-radius: var(--ry-radius-sm);
    margin: 8px 0 0 14px;
    height: 38px;
    width: 38px;
    text-align: center;
    padding: 0 !important;
    line-height: 38px;
}
.navbar-minimalize.minimalize-styl-2:hover { background: var(--ry-primary-dark) !important; }

/* 顶部用户头像下拉 */
.user-menu .user-image {
    border-radius: 50%;
    width: 30px; height: 30px;
    margin-right: 6px;
}
.dropdown-menu {
    border: 1px solid var(--ry-border) !important;
    border-radius: var(--ry-radius) !important;
    box-shadow: var(--ry-shadow-hover) !important;
    padding: 6px 0 !important;
}
.dropdown-menu > li > a {
    padding: 8px 16px;
    color: var(--ry-text);
    transition: var(--ry-transition);
}
.dropdown-menu > li > a:hover {
    background: var(--ry-primary-soft) !important;
    color: var(--ry-primary) !important;
}

/* ========== 页签（标签栏） ========== */
/* 保持原生 float + line-height 布局，仅做视觉增强 */
.content-tabs {
    background: #fff;
    border-bottom: 1px solid var(--ry-border);
}
.page-tabs a {
    border-right: none !important;
    padding: 0 16px !important;
    color: var(--ry-text-light);
    transition: var(--ry-transition);
    font-size: 13px;
}
.page-tabs a:hover,
.content-tabs .roll-nav:hover {
    color: var(--ry-primary) !important;
    background: var(--ry-primary-soft) !important;
}
.page-tabs a.active {
    color: var(--ry-primary) !important;
    font-weight: 600;
    position: relative;
}
.page-tabs a.active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 0;
    height: 2px;
    background: var(--ry-primary);
    border-radius: 2px;
}
.content-tabs .roll-nav {
    color: var(--ry-text-light);
}
.content-tabs .roll-nav:hover {
    color: var(--ry-primary) !important;
    background: var(--ry-primary-soft) !important;
}

/* ========== 标签 / 徽章 ========== */
.label-primary { background-color: var(--ry-primary) !important; }
.label-success { background-color: var(--ry-success) !important; }
.label-warning { background-color: var(--ry-warning) !important; }
.label-danger  { background-color: var(--ry-danger)  !important; }
.label-info    { background-color: var(--ry-info)    !important; }
.badge { font-weight: 600; border-radius: 10px; }

/* ========== 警告框 ========== */
.alert { border-radius: var(--ry-radius); border: none; }
.alert-success { background-color: #e8f8f0; color: var(--ry-success); }
.alert-info    { background-color: #e6f7fa; color: var(--ry-info); }
.alert-warning { background-color: #fdf3e0; color: #c97f0a; }
.alert-danger  { background-color: #fdeceb; color: var(--ry-danger); }

/* ========== layer 弹层增强（不破坏功能） ========== */
.layui-layer {
    border-radius: var(--ry-radius) !important;
    box-shadow: var(--ry-shadow-hover) !important;
    border: none !important;
}
.layui-layer-title {
    background: #fff !important;
    border-bottom: 1px solid var(--ry-border) !important;
    color: var(--ry-text) !important;
    font-weight: 600;
    border-radius: var(--ry-radius) var(--ry-radius) 0 0 !important;
    padding: 0 16px !important;
    height: 46px !important;
    line-height: 46px !important;
}
.layui-layer-btn { padding: 12px 16px !important; border-top: 1px solid var(--ry-border); }
.layui-layer-btn .layui-layer-btn0 {
    background-color: var(--ry-primary) !important;
    border-color: var(--ry-primary) !important;
    border-radius: var(--ry-radius-sm) !important;
}
.layui-layer-btn .layui-layer-btn1 {
    background-color: #fff !important;
    border: 1px solid var(--ry-border) !important;
    color: var(--ry-text-light) !important;
    border-radius: var(--ry-radius-sm) !important;
}

/* ========== 提示气泡/工具 ========== */
.tooltip-inner {
    border-radius: var(--ry-radius-sm);
    background: #2c3e50;
}

/* ========== 时间输入图标对齐 ========== */
.time-input {
    cursor: pointer;
}

/* ========== 搜索区按钮组行间距 ========== */
.select-list ul li:last-child { margin-bottom: 6px; }

/* ========== 适配小屏 ========== */
@media (max-width: 768px) {
    .container-div { padding: 10px; }
    .navbar-minimalize.minimalize-styl-2 { margin-left: 8px; }
}
