/* ============================================================
   FoxOMS 后台样式  — 参考风格主题（深色侧栏 + 顶部工具条 + KPI/图表卡片）
   ============================================================ */

:root {
  --fox-primary:   #2e7eff;
  --fox-primary-d: #1f66e0;
  --fox-primary-l: #eaf2ff;
  --fox-side:      #1f2d3d;
  --fox-side-2:    #182433;
  --fox-side-text: #b6c2d1;
  --fox-side-sub:  #8b9aad;
  --fox-bg:        #f4f6f9;
  --fox-card:      #ffffff;
  --fox-line:      #edf0f5;
  --fox-text:      #2c3444;
  --fox-muted:     #8a94a6;
  --fox-radius:    10px;
  --fox-shadow:    0 1px 2px rgba(31, 45, 61, .05), 0 2px 8px rgba(31, 45, 61, .04);
  --fox-header-h:  56px;
  --fox-side-w:    220px;
}

/* ---------- 基础 ---------- */
html, body { margin: 0; padding: 0; }
body {
  background: var(--fox-bg);
  color: var(--fox-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }

/* ============================================================
   1. 后台框架：顶部工具条 + 深色侧栏
   ============================================================ */
.layui-layout-admin .fox-header {
  height: var(--fox-header-h);
  background: #fff;
  border-bottom: 1px solid var(--fox-line);
  box-shadow: 0 1px 4px rgba(31, 45, 61, .04);
  display: flex;
  align-items: center;
  z-index: 1000;
}

/* 侧栏顶部 LOGO 区（与侧栏同色，形成视觉整体） */
.layui-layout-admin .fox-logo {
  position: absolute;
  left: 0; top: 0;
  width: var(--fox-side-w);
  height: var(--fox-header-h);
  background: var(--fox-side);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
  box-sizing: border-box;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .5px;
}
.layui-layout-admin .fox-logo .layui-icon { font-size: 22px; color: #6aa8ff; }
.layui-layout-admin .fox-logo .fox-logo-sub {
  font-size: 12px; font-weight: 400; color: var(--fox-side-sub); margin-left: 2px;
}

.fox-header-left { display: flex; align-items: center; margin-left: var(--fox-side-w); flex: 1; min-width: 0; }
.fox-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 8px;
  color: #61708a; font-size: 18px; border-radius: 8px;
}
.fox-collapse:hover { background: #f2f5fa; color: var(--fox-primary); }

.fox-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  color: #5a6a82; font-size: 14px; margin-left: 4px;
}
.fox-breadcrumb .layui-icon { font-size: 15px; color: #9aa7ba; }
.fox-breadcrumb .fox-crumb-sep { color: #c8d0dc; }
.fox-breadcrumb .fox-crumb-cur { color: var(--fox-text); font-weight: 500; }

/* 顶部右侧图标/用户区 */
.layui-layout-admin .fox-header .layui-nav {
  position: absolute; right: 14px; top: 0; height: var(--fox-header-h);
  background: transparent; padding: 0;
}
.layui-layout-admin .fox-header .layui-nav .layui-nav-item { line-height: var(--fox-header-h); background: transparent; }
.layui-layout-admin .fox-header .layui-nav .layui-nav-item > a {
  color: #61708a; padding: 0 10px; height: var(--fox-header-h);
  display: inline-flex; align-items: center; gap: 6px;
}
.layui-layout-admin .fox-header .layui-nav .layui-nav-item > a:hover { color: var(--fox-primary); }
.layui-layout-admin .fox-header .layui-nav .layui-nav-item > a .layui-icon { font-size: 18px; }

/* 图标按钮（通知 / 全屏 / 刷新） */
.layui-layout-admin .fox-header .fox-header-right .layui-nav-item > a {
  width: 40px; padding: 0; justify-content: center;
  position: relative; border-radius: 8px;
}
.layui-layout-admin .fox-header .fox-header-right .layui-nav-item > a:hover { background: #f2f5fa; }
.layui-layout-admin .fox-header .fox-header-right .layui-nav-item.fox-user-item > a {
  width: auto; padding: 0 10px; gap: 8px;
}
.fox-dot {
  position: absolute; top: 11px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff4d4f; box-shadow: 0 0 0 2px #fff;
}
.fox-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #4d94ff, #2e7eff);
  color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.fox-uname { color: #3b4a5e; font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 深色侧栏 */
.layui-layout-admin .fox-side {
  top: var(--fox-header-h);
  width: var(--fox-side-w);
  background: var(--fox-side);
  box-shadow: none;
}
.layui-layout-admin .fox-side .layui-side-scroll { width: calc(var(--fox-side-w) + 20px); }

.layui-layout-admin .fox-menu.layui-nav-tree {
  width: var(--fox-side-w);
  background: transparent;
  padding: 10px;
  box-sizing: border-box;
}
.fox-menu.layui-nav-tree .layui-nav-item { background: transparent; }
.fox-menu.layui-nav-tree .layui-nav-item > a {
  display: flex; align-items: center; gap: 11px;
  height: 44px; line-height: 44px; padding: 0 13px; margin: 3px 0;
  border-radius: 8px; color: var(--fox-side-text);
  font-size: 14px; transition: background .15s, color .15s;
}
.fox-menu.layui-nav-tree .layui-nav-item > a .fox-mi { font-size: 17px; width: 18px; text-align: center; color: #7f8fa6; }
.fox-menu.layui-nav-tree .layui-nav-item > a .fox-mt { flex: 1; }
.fox-menu.layui-nav-tree .layui-nav-item > a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.fox-menu.layui-nav-tree .layui-nav-item > a:hover .fox-mi { color: #9fc0ff; }

.fox-menu.layui-nav-tree .layui-nav-itemed > a,
.fox-menu.layui-nav-tree .layui-this > a {
  background: var(--fox-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(46, 126, 255, .35);
}
.fox-menu.layui-nav-tree .layui-nav-itemed > a .fox-mi,
.fox-menu.layui-nav-tree .layui-this > a .fox-mi { color: #fff !important; }

/* 子菜单 */
.fox-menu.layui-nav-tree .layui-nav-child {
  background: transparent;
  border: none; padding: 0;
}
.fox-menu.layui-nav-tree .layui-nav-child dd { background: transparent; }
.fox-menu.layui-nav-tree .layui-nav-child dd a {
  display: block;
  height: 38px; line-height: 38px;
  padding: 0 13px 0 42px;
  margin: 2px 0; border-radius: 8px;
  color: var(--fox-side-sub); font-size: 13px;
}
.fox-menu.layui-nav-tree .layui-nav-child dd a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.fox-menu.layui-nav-tree .layui-nav-child dd.layui-this a {
  background: rgba(46, 126, 255, .22) !important;
  color: #fff !important;
}
.fox-menu.layui-nav-tree .layui-nav-itemed > .layui-nav-child { display: block; }

/* 内容区 */
.layui-layout-admin .layui-body { top: var(--fox-header-h); left: var(--fox-side-w); bottom: 0; background: var(--fox-bg); }
.fox-body { padding: 16px 18px 26px; }

/* ============================================================
   2. 通用卡片 / 页签
   ============================================================ */
.fox-panel {
  background: var(--fox-card);
  border-radius: var(--fox-radius);
  box-shadow: var(--fox-shadow);
  border: 1px solid var(--fox-line);
}
.fox-panel + .fox-panel { margin-top: 14px; }
.fox-panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--fox-line);
}
.fox-panel-title { font-size: 15px; font-weight: 600; color: var(--fox-text); display: flex; align-items: center; gap: 8px; }
.fox-panel-title::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px;
  background: var(--fox-primary);
}
.fox-panel-bd { padding: 16px 18px; }

/* 页面标签（面包屑下方的小标签，参考图风格） */
.fox-page-tab {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 14px; margin-bottom: 14px;
  background: var(--fox-primary-l); color: var(--fox-primary);
  border: 1px solid #cfe1ff; border-radius: 6px;
  font-size: 13px; font-weight: 500;
}

/* ============================================================
   3. KPI 指标卡
   ============================================================ */
.fox-kpi-row { margin-bottom: 0; }
.fox-kpi {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--fox-card);
  border: 1px solid var(--fox-line);
  border-radius: var(--fox-radius);
  box-shadow: var(--fox-shadow);
  padding: 16px 16px 14px;
  min-height: 76px; box-sizing: border-box;
  transition: transform .16s, box-shadow .16s;
}
.fox-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 45, 61, .09); }
.fox-kpi-meta { min-width: 0; }
.fox-kpi-label { color: var(--fox-muted); font-size: 13px; margin-bottom: 8px; white-space: nowrap; }
.fox-kpi-num { font-size: 24px; font-weight: 700; color: var(--fox-text); line-height: 1.1; }
.fox-kpi-num small { font-size: 12px; font-weight: 500; color: var(--fox-muted); margin-left: 3px; }
.fox-kpi-icon {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.fox-kpi-tip { margin-top: 6px; font-size: 12px; color: #a3aebe; }

/* 图标配色（浅底 + 主题色） */
.fox-i-blue   { background: #eaf2ff; color: #2e7eff; }
.fox-i-green  { background: #e8f8ef; color: #22c26a; }
.fox-i-orange { background: #fff3e6; color: #ff9f2e; }
.fox-i-pink   { background: #ffeaef; color: #ff5c8a; }
.fox-i-purple { background: #f0ecff; color: #7c5cff; }
.fox-i-cyan   { background: #e6f8fb; color: #17b8cf; }

/* ============================================================
   4. 图表卡
   ============================================================ */
.fox-chart-legend { display: flex; flex-wrap: wrap; gap: 16px; }
.fox-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7a90; }
.fox-legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.fox-chart-box { position: relative; padding: 6px 4px 0; }
.fox-chart-box svg { display: block; width: 100%; height: auto; }
.fox-chart-tip { font-size: 12px; color: var(--fox-muted); padding: 10px 18px 4px; }

/* ============================================================
   5. 右栏卡片（公告 / 待办 / 热销）
   ============================================================ */
.fox-side-col .fox-panel + .fox-panel { margin-top: 14px; }
.fox-notice-item { display: flex; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--fox-line); font-size: 13px; color: #4d5b70; line-height: 1.6; }
.fox-notice-item:last-child { border-bottom: none; }
.fox-notice-item .layui-icon { color: var(--fox-primary); font-size: 14px; margin-top: 3px; }

.fox-todo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fox-todo {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px;
  border: 1px solid #d8e6ff; background: #f7fbff;
  color: #3d6fd6; border-radius: 6px; font-size: 13px;
}
.fox-todo:hover { border-color: var(--fox-primary); color: var(--fox-primary); background: #f0f7ff; }
.fox-todo .fox-todo-n { color: #ff7a45; font-weight: 600; }

.fox-hot-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--fox-line); }
.fox-hot-item:last-child { border-bottom: none; }
.fox-hot-idx {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 5px;
  background: #f0f3f8; color: #8492a6; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.fox-hot-item:nth-child(1) .fox-hot-idx { background: #ff5c5c; color: #fff; }
.fox-hot-item:nth-child(2) .fox-hot-idx { background: #ff9f2e; color: #fff; }
.fox-hot-item:nth-child(3) .fox-hot-idx { background: #2e7eff; color: #fff; }
.fox-hot-name { flex: 1; font-size: 13px; color: #3b4a5e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fox-hot-val { font-size: 13px; color: #ff7a45; font-weight: 600; }
.fox-empty { text-align: center; color: #b3bcc9; font-size: 13px; padding: 22px 0; }

/* ============================================================
   6. 表格 / 工具栏 / 弹层表单
   ============================================================ */
.fox-toolbar { margin-bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fox-toolbar .fox-search { width: 250px; }
.fox-toolbar .layui-input { border-radius: 7px; }
.fox-toolbar .layui-btn { border-radius: 7px; }
.fox-toolbar .layui-btn.fox-btn-primary { background: var(--fox-primary); }
.fox-toolbar-spacer { flex: 1; }

.fox-form-wrap { padding: 20px 22px 4px 6px; }
.fox-form-btn { margin-top: 6px; text-align: center; }
.fox-form-btn .layui-btn { margin: 0 6px; border-radius: 7px; }

.layui-table-view { border-radius: var(--fox-radius); }
.layui-table th { background: #f7f9fc !important; color: #5a6a82; font-weight: 600; }
.layui-table-hover, .layui-table tbody tr:hover { background: #f7fbff !important; }

/* 顶部下拉菜单 */
.fox-header-right .layui-nav-child {
  border: 1px solid var(--fox-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 45, 61, .13);
  min-width: 132px; padding: 6px;
  background: #fff;
}
.fox-header-right .layui-nav-child dd a {
  color: #4d5b70 !important;
  height: 36px; line-height: 36px;
  border-radius: 6px; padding: 0 12px;
  font-size: 13px;
}
.fox-header-right .layui-nav-child dd a:hover { background: #f4f7fc; color: var(--fox-primary) !important; }
.fox-header-right .layui-nav-child dd a .layui-icon { font-size: 14px; margin-right: 6px; }

/* 侧栏收起态 */
body.fox-side-collapsed .layui-layout-admin .fox-logo { width: 56px; padding-left: 17px; }
body.fox-side-collapsed .layui-layout-admin .fox-logo .fox-logo-txt,
body.fox-side-collapsed .layui-layout-admin .fox-logo .fox-logo-sub { display: none; }
body.fox-side-collapsed .layui-layout-admin .fox-side { width: 0; overflow: hidden; }
body.fox-side-collapsed .layui-layout-admin .layui-body { left: 0; }
body.fox-side-collapsed .fox-header-left { margin-left: 56px; }

/* ============================================================
   8. 登录页（蓝图网格底 + 左右分栏卡片）
   ============================================================ */
body.fox-login {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background-color: #f2f6fd;
  background-image:
    radial-gradient(circle at 82% 18%, rgba(46, 126, 255, .10), transparent 42%),
    radial-gradient(circle at 12% 86%, rgba(46, 126, 255, .08), transparent 40%),
    linear-gradient(rgba(46, 126, 255, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 126, 255, .075) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  padding: 28px 16px;
  box-sizing: border-box;
}

.fox-login-card {
  display: flex;
  width: 840px; max-width: 100%;
  min-height: 428px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(31, 45, 61, .16), 0 2px 8px rgba(31, 45, 61, .06);
}

/* 左侧欢迎区 */
.fox-login-left {
  position: relative;
  width: 300px; flex: 0 0 300px;
  background: linear-gradient(160deg, #4a93ff 0%, #2e6fe8 55%, #1f5fd6 100%);
  color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px; overflow: hidden;
}
.fox-login-left::before,
.fox-login-left::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}
.fox-login-left::before { width: 240px; height: 240px; top: -90px; right: -90px; }
.fox-login-left::after  { width: 180px; height: 180px; bottom: -70px; left: -70px; background: rgba(255, 255, 255, .07); }
.fox-login-welcome { position: relative; }
.fox-login-welcome h1 { margin: 0 0 12px; font-size: 27px; font-weight: 600; letter-spacing: 1px; }
.fox-login-welcome .fox-login-cn { font-size: 15px; opacity: .92; letter-spacing: 2px; }
.fox-login-welcome .fox-login-line { width: 42px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.7); margin: 18px auto 0; }

/* 右侧表单区 */
.fox-login-right {
  flex: 1; min-width: 0;
  padding: 44px 52px 22px;
  display: flex; flex-direction: column;
  box-sizing: border-box;
}
.fox-login-head { text-align: center; margin-bottom: 26px; }
.fox-login-head .fox-login-brand { font-size: 24px; font-weight: 700; color: #1f2d3d; letter-spacing: .5px; }
.fox-login-head .fox-login-slogan { margin-top: 9px; font-size: 13px; color: var(--fox-muted); letter-spacing: 3px; }

.fox-field { margin-bottom: 17px; }
.fox-field-label { display: block; font-size: 13px; color: #4d5b70; margin-bottom: 8px; }
.fox-field-label .fox-req { color: #ff4d4f; margin-right: 3px; }
.fox-input-wrap { position: relative; }
.fox-input-wrap .fox-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: #aab4c4; pointer-events: none;
}
.fox-input-wrap input.fox-input {
  width: 100%; height: 42px; box-sizing: border-box;
  padding: 0 40px 0 38px;
  border: 1px solid #dfe4ec; border-radius: 7px;
  background: #fff; color: #2c3444; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fox-input-wrap input.fox-input::placeholder { color: #b6bfcd; }
.fox-input-wrap input.fox-input:hover { border-color: #c6d3e6; }
.fox-input-wrap input.fox-input:focus { border-color: var(--fox-primary); box-shadow: 0 0 0 3px rgba(46, 126, 255, .12); }
.fox-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: #aab4c4; cursor: pointer; font-size: 16px; border-radius: 5px;
}
.fox-eye:hover { color: var(--fox-primary); }

/* 验证码行 */
.fox-captcha-row { display: flex; gap: 10px; }
.fox-captcha-row .fox-input-wrap { flex: 1; min-width: 0; }
.fox-captcha-img {
  width: 108px; height: 42px; flex: 0 0 108px;
  border: 1px solid #dfe4ec; border-radius: 7px;
  cursor: pointer; background: #f7faff;
}

.fox-login-btn {
  width: 100%; height: 44px; margin-top: 4px;
  border: none; border-radius: 7px; cursor: pointer;
  background: linear-gradient(90deg, #3d8bff, #2e7eff);
  color: #fff; font-size: 15px; font-weight: 500; letter-spacing: 4px;
  box-shadow: 0 6px 16px rgba(46, 126, 255, .32);
  transition: filter .15s, transform .1s;
}
.fox-login-btn:hover { filter: brightness(1.05); }
.fox-login-btn:active { transform: translateY(1px); }
.fox-login-btn[disabled] { opacity: .7; cursor: not-allowed; box-shadow: none; }

.fox-login-hint {
  margin-top: 16px; font-size: 12px; line-height: 1.7; color: #98a3b3;
  text-align: center;
}
.fox-login-hint a { color: var(--fox-primary); }

/* 卡片底部版权 */
.fox-login-foot {
  margin-top: auto; padding-top: 22px;
  text-align: center; font-size: 12px; color: #b0b9c6; line-height: 1.8;
}

/* 页面级底部信息 */
.fox-login-pagefoot {
  margin-top: 22px; text-align: center;
  font-size: 12px; color: #9aa7ba; letter-spacing: .3px;
}
.fox-foot-sep { color: #ccd4e0; margin: 0 8px; }

/* 小屏适配 */
@media (max-width: 760px) {
  .fox-login-card { flex-direction: column; width: 100%; }
  .fox-login-left { width: 100%; flex: 0 0 auto; min-height: 140px; padding: 26px 20px; }
  .fox-login-welcome h1 { font-size: 22px; }
  .fox-login-right { padding: 30px 24px 18px; }
}
